From owner-svn-src-stable-10@freebsd.org Sun May 15 03:15:39 2016 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 D73B8B3BADF; Sun, 15 May 2016 03:15:39 +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 A54091C16; Sun, 15 May 2016 03:15:39 +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 u4F3Fc1G056111; Sun, 15 May 2016 03:15:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3FbET056093; Sun, 15 May 2016 03:15:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605150315.u4F3FbET056093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 May 2016 03:15: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: r299826 - in stable/10: etc etc/ntp etc/rc.d share/examples/ipfilter share/examples/kld/cdev/test tools/regression/sockets/so_setfib tools/tools/fixwhite tools/tools/ipw tools/tools/nan... 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.22 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, 15 May 2016 03:15:39 -0000 Author: pfg Date: Sun May 15 03:15:36 2016 New Revision: 299826 URL: https://svnweb.freebsd.org/changeset/base/299826 Log: MFC r298881, 298882, 298883, 298885: Minor spelling fixes in: tools, share, bluetooth, pmcstat, etc Many of these have user-visible strings. Modified: stable/10/etc/ntp/leap-seconds stable/10/etc/protocols stable/10/etc/rc.d/sendmail stable/10/etc/rc.initdiskless stable/10/share/examples/ipfilter/ipf-howto.txt stable/10/share/examples/kld/cdev/test/Makefile stable/10/tools/regression/sockets/so_setfib/so_setfib.c stable/10/tools/tools/fixwhite/fixwhite.1 stable/10/tools/tools/fixwhite/fixwhite.c stable/10/tools/tools/ipw/ipwstats.c stable/10/tools/tools/nanobsd/dhcpd/common stable/10/tools/tools/shlib-compat/shlib-compat.py stable/10/tools/tools/wtap/vis_map/vis_map.c stable/10/tools/tools/wtap/wtap/wtap.c stable/10/usr.sbin/bluetooth/btpand/btpand.c stable/10/usr.sbin/bluetooth/hccontrol/node.c stable/10/usr.sbin/pmcstat/pmcpl_calltree.c stable/10/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- stable/10/etc/ntp/leap-seconds Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/ntp/leap-seconds Sun May 15 03:15:36 2016 (r299826) @@ -46,7 +46,7 @@ # by the International Bureau of Weights and Measures # (BIPM). See www.bipm.fr for more information. # -# 3. The current defintion of the relationship between UTC +# 3. The current definition of the relationship between UTC # and TAI dates from 1 January 1972. A number of different # time scales were in use before than epoch, and it can be # quite difficult to compute precise timestamps and time Modified: stable/10/etc/protocols ============================================================================== --- stable/10/etc/protocols Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/protocols Sun May 15 03:15:36 2016 (r299826) @@ -43,7 +43,7 @@ merit-inp 32 MERIT-INP # MERIT Internoda dccp 33 DCCP # Datagram Congestion Control Protocol 3pc 34 3PC # Third Party Connect Protocol idpr 35 IDPR # Inter-Domain Policy Routing Protocol -xtp 36 XTP # Xpress Tranfer Protocol +xtp 36 XTP # Xpress Transfer Protocol ddp 37 DDP # Datagram Delivery Protocol idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto tp++ 39 TP++ # TP++ Transport Protocol Modified: stable/10/etc/rc.d/sendmail ============================================================================== --- stable/10/etc/rc.d/sendmail Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/rc.d/sendmail Sun May 15 03:15:36 2016 (r299826) @@ -78,7 +78,7 @@ sendmail_cert_create() crlnumber = \$dir/crlnumber # the current crl number crl = \$dir/crl.pem # The current CRL private_key = \$dir/cakey.pem - x509_extensions = usr_cert # The extentions to add to the cert + x509_extensions = usr_cert # The extensions to add to the cert name_opt = ca_default # Subject Name options cert_opt = ca_default # Certificate field options default_days = 365 # how long to certify for @@ -99,7 +99,7 @@ sendmail_cert_create() default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes - x509_extensions = v3_ca # The extentions to add to the self signed cert + x509_extensions = v3_ca # The extensions to add to the self signed cert string_mask = utf8only prompt = no [ req_distinguished_name ] Modified: stable/10/etc/rc.initdiskless ============================================================================== --- stable/10/etc/rc.initdiskless Sun May 15 03:04:21 2016 (r299825) +++ stable/10/etc/rc.initdiskless Sun May 15 03:15:36 2016 (r299826) @@ -103,7 +103,7 @@ # will be created. In case of multiple entries for the same # directory M, the last one in the scanning order is used. # NOTE: If you only need to create a memory filesystem but not -# initialize it from a template, it is preferrable to specify +# initialize it from a template, it is preferable to specify # it in fstab e.g. as "md /tmp mfs -s=30m,rw 0 0" # # /conf/T/SUBDIR.cpio.gz Modified: stable/10/share/examples/ipfilter/ipf-howto.txt ============================================================================== --- stable/10/share/examples/ipfilter/ipf-howto.txt Sun May 15 03:04:21 2016 (r299825) +++ stable/10/share/examples/ipfilter/ipf-howto.txt Sun May 15 03:15:36 2016 (r299826) @@ -1036,11 +1036,11 @@ In this case, the server is running n it's not a server, it's a client. And this client doesn't want unauthorized packets entering its IP stack at all. However, the client wants full access to the internet and -the reply packets that such privledge entails. This simple +the reply packets that such privilege entails. This simple ruleset creates state entries for every new outgoing TCP session. Again, since a state entry is created, these new TCP sessions are free to talk back and forth as they please -without the hinderance or inspection of the firewall rule- +without the hindrance or inspection of the firewall rule- set. We mentioned that this also works for UDP and ICMP: block in quick on tun0 all @@ -1271,7 +1271,7 @@ forgeries and allow fragments: This works because every packet that should be allowed through makes it into the state table before the blocking rules are reached. The only scan this won't detect is a SYN -scan itself. If you're truely worried about that, you might +scan itself. If you're truly worried about that, you might even want to log all initial SYN packets. 3.6. Responding To a Blocked Packet Modified: stable/10/share/examples/kld/cdev/test/Makefile ============================================================================== --- stable/10/share/examples/kld/cdev/test/Makefile Sun May 15 03:04:21 2016 (r299825) +++ stable/10/share/examples/kld/cdev/test/Makefile Sun May 15 03:15:36 2016 (r299826) @@ -73,7 +73,7 @@ WARNS?= 5 MODSTAT= /sbin/kldstat load: - @echo "This test program will call the sample kld characer device "; + @echo "This test program will call the sample kld character device "; @echo "driver." @echo @echo "The sample driver will display a message on the" Modified: stable/10/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- stable/10/tools/regression/sockets/so_setfib/so_setfib.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/regression/sockets/so_setfib/so_setfib.c Sun May 15 03:15:36 2016 (r299826) @@ -175,7 +175,7 @@ main(int argc __unused, char *argv[] __u return (0); } - /* Initalize randomness. */ + /* Initialize randomness. */ srandomdev(); /* Get number of FIBs supported by kernel. */ Modified: stable/10/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- stable/10/tools/tools/fixwhite/fixwhite.1 Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/fixwhite/fixwhite.1 Sun May 15 03:15:36 2016 (r299826) @@ -43,6 +43,6 @@ trailing whitespace characters from ever Multiple successive empty lines are merged together. If the whitespace at the beginning of a sentence is exactly a multiple of eight spaces, the whitespace is replaced by tabs. -Also, spaces preceeding tabs will be merged into the tab character. +Also, spaces preceding tabs will be merged into the tab character. .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Modified: stable/10/tools/tools/fixwhite/fixwhite.c ============================================================================== --- stable/10/tools/tools/fixwhite/fixwhite.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/fixwhite/fixwhite.c Sun May 15 03:15:36 2016 (r299826) @@ -95,7 +95,7 @@ savewhite(char c, bool leading) savebyte(' '); break; case '\t': - /* Convert preceeding spaces to tabs. */ + /* Convert preceding spaces to tabs. */ ncolumn = (column / 8 + 1) * 8; while (peekbyte(1, ' ')) { queuelen--; Modified: stable/10/tools/tools/ipw/ipwstats.c ============================================================================== --- stable/10/tools/tools/ipw/ipwstats.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/ipw/ipwstats.c Sun May 15 03:15:36 2016 (r299826) @@ -89,7 +89,7 @@ static const struct statistic tbl[] = { { 27, "Number of reassociation requests transmitted", INT }, { 28, "Number of reassociation responses transmitted", INT }, { 29, "Number of probe requests transmitted", INT }, - { 30, "Number of probe reponses transmitted", INT }, + { 30, "Number of probe responses transmitted", INT }, { 31, "Number of beacons transmitted", INT }, { 32, "Number of ATIM frames transmitted", INT }, { 33, "Number of disassociation requests transmitted", INT }, @@ -137,7 +137,7 @@ static const struct statistic tbl[] = { { 89, "Number of reassociation requests received", INT }, { 90, "Number of reassociation responses received", INT }, { 91, "Number of probe requests received", INT }, - { 92, "Number of probe reponses received", INT }, + { 92, "Number of probe responses received", INT }, { 93, "Number of beacons received", INT }, { 94, "Number of ATIM frames received", INT }, { 95, "Number of disassociation requests received", INT }, Modified: stable/10/tools/tools/nanobsd/dhcpd/common ============================================================================== --- stable/10/tools/tools/nanobsd/dhcpd/common Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/nanobsd/dhcpd/common Sun May 15 03:15:36 2016 (r299826) @@ -229,7 +229,7 @@ add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` shift - # Check if package allready exist + # Check if package already exist # Need to: # 1. check ARCH of this package! # 2. Add a trap Modified: stable/10/tools/tools/shlib-compat/shlib-compat.py ============================================================================== --- stable/10/tools/tools/shlib-compat/shlib-compat.py Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/shlib-compat/shlib-compat.py Sun May 15 03:15:36 2016 (r299826) @@ -893,7 +893,7 @@ class DwarfdumpParser(Parser): offset = int(tag.args['DW_AT_low_pc'], 16) if self.offsetmap.has_key(offset): raise ValueError("Dwarf dump parse error: " + - "symbol is aleady defined at offset 0x%x" % offset) + "symbol is already defined at offset 0x%x" % offset) self.offsetmap[offset] = tag if len(self.stack) > 0: prev = self.stack.pop() Modified: stable/10/tools/tools/wtap/vis_map/vis_map.c ============================================================================== --- stable/10/tools/tools/wtap/vis_map/vis_map.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/wtap/vis_map/vis_map.c Sun May 15 03:15:36 2016 (r299826) @@ -110,7 +110,7 @@ main(int argc, const char* argv[]) link_op(&l); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); exit(1); } exit(0); Modified: stable/10/tools/tools/wtap/wtap/wtap.c ============================================================================== --- stable/10/tools/tools/wtap/wtap/wtap.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/tools/tools/wtap/wtap/wtap.c Sun May 15 03:15:36 2016 (r299826) @@ -75,7 +75,7 @@ int main( int argc, const char* argv[]) delete(id); break; default: - printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + printf("wtap ioctl: unknown command '%c'\n", *argv[1]); return -1; } return 0; Modified: stable/10/usr.sbin/bluetooth/btpand/btpand.c ============================================================================== --- stable/10/usr.sbin/bluetooth/btpand/btpand.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/bluetooth/btpand/btpand.c Sun May 15 03:15:36 2016 (r299826) @@ -65,7 +65,7 @@ static const struct { const char * desc; } services[] = { { "PANU", SDP_SERVICE_CLASS_PANU, "Personal Area Networking User" }, - { "NAP", SDP_SERVICE_CLASS_NAP, "Network Acess Point" }, + { "NAP", SDP_SERVICE_CLASS_NAP, "Network Access Point" }, { "GN", SDP_SERVICE_CLASS_GN, "Group Network" }, }; Modified: stable/10/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/node.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/bluetooth/hccontrol/node.c Sun May 15 03:15:36 2016 (r299826) @@ -591,7 +591,7 @@ struct hci_command node_commands[] = { "Write the value of the Role Switch parameter for the HCI node. By default,\n" \ "if Role Switch is supported, local device will try to perform Role Switch\n" \ "and become Master on incoming connection. Some devices do not support Role\n" \ -"Switch and thus incomming connections from such devices will fail. Setting\n" \ +"Switch and thus incoming connections from such devices will fail. Setting\n" \ "this parameter to zero will prevent Role Switch and thus accepting device\n" \ "will remain Slave", &hci_write_node_role_switch Modified: stable/10/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/pmcstat/pmcpl_calltree.c Sun May 15 03:15:36 2016 (r299826) @@ -830,7 +830,7 @@ pmcpl_ct_node_printchild(struct pmcpl_ct /* * Child cost. - * TODO: attach child cost to the real position in the funtion. + * TODO: attach child cost to the real position in the function. * TODO: cfn= / call addr() / addr(call ) */ for (i=0 ; ipct_narc; i++) { Modified: stable/10/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat_log.c Sun May 15 03:04:21 2016 (r299825) +++ stable/10/usr.sbin/pmcstat/pmcstat_log.c Sun May 15 03:15:36 2016 (r299826) @@ -1361,7 +1361,7 @@ pmcstat_analyze_log(void) assert(args.pa_flags & FLAG_DO_ANALYSIS); if (elf_version(EV_CURRENT) == EV_NONE) - err(EX_UNAVAILABLE, "Elf library intialization failed"); + err(EX_UNAVAILABLE, "Elf library initialization failed"); while (pmclog_read(args.pa_logparser, &ev) == 0) { assert(ev.pl_state == PMCLOG_OK); From owner-svn-src-stable-10@freebsd.org Sun May 15 03:53:07 2016 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 B8C59B3A885; Sun, 15 May 2016 03:53:07 +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 7E54B18DC; Sun, 15 May 2016 03:53:07 +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 u4F3r6wc068374; Sun, 15 May 2016 03:53:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4F3r6sx068373; Sun, 15 May 2016 03:53:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605150353.u4F3r6sx068373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 15 May 2016 03:53: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: r299836 - stable/10/share/mk 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.22 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, 15 May 2016 03:53:07 -0000 Author: ngie Date: Sun May 15 03:53:06 2016 New Revision: 299836 URL: https://svnweb.freebsd.org/changeset/base/299836 Log: MFC r298864: Allow FILESGROUPS to be specified more than once by pruning out duplicates Modified: stable/10/share/mk/bsd.files.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.files.mk ============================================================================== --- stable/10/share/mk/bsd.files.mk Sun May 15 03:45:58 2016 (r299835) +++ stable/10/share/mk/bsd.files.mk Sun May 15 03:53:06 2016 (r299836) @@ -9,7 +9,7 @@ ____: FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g} +_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} .for group in ${_FILESGROUPS} buildfiles: ${${group}} From owner-svn-src-stable-10@freebsd.org Mon May 16 02:21:56 2016 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 40D22B3C171; Mon, 16 May 2016 02:21:56 +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 0E40916B5; Mon, 16 May 2016 02:21:55 +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 u4G2Ltjd085822; Mon, 16 May 2016 02:21:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2LtBn085821; Mon, 16 May 2016 02:21:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160221.u4G2LtBn085821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:21:55 +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: r299881 - 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.22 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, 16 May 2016 02:21:56 -0000 Author: kib Date: Mon May 16 02:21:54 2016 New Revision: 299881 URL: https://svnweb.freebsd.org/changeset/base/299881 Log: MFC r298921: Fix reporting of NOTE_LINK when directory link count changes due to rename removing or adding subdirectory entry. Modified: stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 01:38:24 2016 (r299880) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:21:54 2016 (r299881) @@ -4365,10 +4365,26 @@ void vop_rename_post(void *ap, int rc) { struct vop_rename_args *a = ap; + long hint; if (!rc) { - VFS_KNOTE_UNLOCKED(a->a_fdvp, NOTE_WRITE); - VFS_KNOTE_UNLOCKED(a->a_tdvp, NOTE_WRITE); + hint = NOTE_WRITE; + if (a->a_fdvp == a->a_tdvp) { + if (a->a_tvp != NULL && a->a_tvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } else { + if (a->a_fvp->v_type == VDIR) + hint |= NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); + + if (a->a_fvp->v_type == VDIR && a->a_tvp != NULL && + a->a_tvp->v_type == VDIR) + hint &= ~NOTE_LINK; + VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); + } + VFS_KNOTE_UNLOCKED(a->a_fvp, NOTE_RENAME); if (a->a_tvp) VFS_KNOTE_UNLOCKED(a->a_tvp, NOTE_DELETE); From owner-svn-src-stable-10@freebsd.org Mon May 16 02:24:00 2016 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 03C2CB3C201; Mon, 16 May 2016 02:24:00 +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 A9589199B; Mon, 16 May 2016 02:23:59 +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 u4G2Nw85085959; Mon, 16 May 2016 02:23:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2NwWL085957; Mon, 16 May 2016 02:23:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160223.u4G2NwWL085957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:23:58 +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: r299882 - in stable/10: lib/libc/sys 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.22 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, 16 May 2016 02:24:00 -0000 Author: kib Date: Mon May 16 02:23:58 2016 New Revision: 299882 URL: https://svnweb.freebsd.org/changeset/base/299882 Log: MFC r298922: Issue NOTE_EXTEND when a directory entry is added to or removed from the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/vfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:21:54 2016 (r299881) +++ stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:23:58 2016 (r299882) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2016 +.Dd May 2, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -368,7 +368,13 @@ was called on the file referenced by the .It Dv NOTE_WRITE A write occurred on the file referenced by the descriptor. .It Dv NOTE_EXTEND -The file referenced by the descriptor was extended. +For regular file, the file referenced by the descriptor was extended. +.Pp +For directory, reports that a directory entry was added or removed, +as the result of rename operation. +The +.Dv NOTE_EXTEND +event is not reported when a name is changed inside the directory. .It Dv NOTE_ATTRIB The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:21:54 2016 (r299881) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:23:58 2016 (r299882) @@ -4375,6 +4375,7 @@ vop_rename_post(void *ap, int rc) VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); VFS_KNOTE_UNLOCKED(a->a_tdvp, hint); } else { + hint |= NOTE_EXTEND; if (a->a_fvp->v_type == VDIR) hint |= NOTE_LINK; VFS_KNOTE_UNLOCKED(a->a_fdvp, hint); From owner-svn-src-stable-10@freebsd.org Mon May 16 02:35:35 2016 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 2A8FEB3C4C2; Mon, 16 May 2016 02:35:35 +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 D85E8118F; Mon, 16 May 2016 02:35:34 +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 u4G2ZYCB089226; Mon, 16 May 2016 02:35:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2ZXGd089223; Mon, 16 May 2016 02:35:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160235.u4G2ZXGd089223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:35: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: r299885 - in stable/10/sys: kern 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.22 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, 16 May 2016 02:35:35 -0000 Author: kib Date: Mon May 16 02:35:33 2016 New Revision: 299885 URL: https://svnweb.freebsd.org/changeset/base/299885 Log: MFC r287831 (by cem): Note DOOMED vnodes with NOTE_REVOKE. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/kern/vnode_if.src stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:33 2016 (r299885) @@ -4351,6 +4351,15 @@ vop_mknod_post(void *ap, int rc) } void +vop_reclaim_post(void *ap, int rc) +{ + struct vop_reclaim_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_REVOKE); +} + +void vop_remove_post(void *ap, int rc) { struct vop_remove_args *a = ap; @@ -4647,7 +4656,7 @@ filt_vfsread(struct knote *kn, long hint * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. */ - if (hint == NOTE_REVOKE) { + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) { VI_LOCK(vp); kn->kn_flags |= (EV_EOF | EV_ONESHOT); VI_UNLOCK(vp); @@ -4676,7 +4685,7 @@ filt_vfswrite(struct knote *kn, long hin * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. */ - if (hint == NOTE_REVOKE) + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) kn->kn_flags |= (EV_EOF | EV_ONESHOT); kn->kn_data = 0; @@ -4693,7 +4702,7 @@ filt_vfsvnode(struct knote *kn, long hin VI_LOCK(vp); if (kn->kn_sfflags & hint) kn->kn_fflags |= hint; - if (hint == NOTE_REVOKE) { + if (hint == NOTE_REVOKE || (hint == 0 && vp->v_type == VBAD)) { kn->kn_flags |= EV_EOF; VI_UNLOCK(vp); return (1); Modified: stable/10/sys/kern/vnode_if.src ============================================================================== --- stable/10/sys/kern/vnode_if.src Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/kern/vnode_if.src Mon May 16 02:35:33 2016 (r299885) @@ -355,6 +355,7 @@ vop_inactive { %% reclaim vp E E E +%! reclaim post vop_reclaim_post vop_reclaim { IN struct vnode *vp; Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon May 16 02:35:23 2016 (r299884) +++ stable/10/sys/sys/vnode.h Mon May 16 02:35:33 2016 (r299885) @@ -774,6 +774,7 @@ void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); void vop_mknod_post(void *a, int rc); +void vop_reclaim_post(void *a, int rc); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); void vop_rename_pre(void *a); From owner-svn-src-stable-10@freebsd.org Mon May 16 02:42:54 2016 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 B599EB3C67D; Mon, 16 May 2016 02:42:54 +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 85EC116BF; Mon, 16 May 2016 02:42:54 +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 u4G2grua092116; Mon, 16 May 2016 02:42:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4G2grxU092111; Mon, 16 May 2016 02:42:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605160242.u4G2grxU092111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 May 2016 02:42:53 +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: r299886 - in stable/10: lib/libc/sys sys/kern 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.22 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, 16 May 2016 02:42:54 -0000 Author: kib Date: Mon May 16 02:42:53 2016 New Revision: 299886 URL: https://svnweb.freebsd.org/changeset/base/299886 Log: MFC r298982: Add EVFILT_VNODE open, read and close notifications. MFC r298984: Correct wording. Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/sys/kern/vfs_subr.c stable/10/sys/kern/vnode_if.src stable/10/sys/sys/event.h stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:35:33 2016 (r299885) +++ stable/10/lib/libc/sys/kqueue.2 Mon May 16 02:42:53 2016 (r299886) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2016 +.Dd May 3, 2016 .Dt KQUEUE 2 .Os .Sh NAME @@ -359,14 +359,28 @@ Takes a file descriptor as the identifie .Va fflags , and returns when one or more of the requested events occurs on the descriptor. The events to monitor are: -.Bl -tag -width "Dv NOTE_RENAME" +.Bl -tag -width "Dv NOTE_CLOSE_WRITE" +.It Dv NOTE_ATTRIB +The file referenced by the descriptor had its attributes changed. +.It Dv NOTE_CLOSE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor did not have write access. +.It Dv NOTE_CLOSE_WRITE +A file descriptor referencing the monitored file, was closed. +The closed file descriptor has write access. +.Pp +This note, as well as +.Dv NOTE_CLOSE , +are not activated when files are closed forcibly by +.Xr unmount 2 or +.Xr revoke 2 . +Instead, +.Dv NOTE_REVOKE +is sent for such events. .It Dv NOTE_DELETE The .Fn unlink -system call -was called on the file referenced by the descriptor. -.It Dv NOTE_WRITE -A write occurred on the file referenced by the descriptor. +system call was called on the file referenced by the descriptor. .It Dv NOTE_EXTEND For regular file, the file referenced by the descriptor was extended. .Pp @@ -375,20 +389,24 @@ as the result of rename operation. The .Dv NOTE_EXTEND event is not reported when a name is changed inside the directory. -.It Dv NOTE_ATTRIB -The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK The link count on the file changed. In particular, the .Dv NOTE_LINK event is reported if a subdirectory was created or deleted inside the directory referenced by the descriptor. +.It Dv NOTE_OPEN +The file referenced by the descriptor was opened. +.It Dv NOTE_READ +A read occurred on the file referenced by the descriptor. .It Dv NOTE_RENAME The file referenced by the descriptor was renamed. .It Dv NOTE_REVOKE Access to the file was revoked via .Xr revoke 2 or the underlying file system was unmounted. +.It Dv NOTE_WRITE +A write occurred on the file referenced by the descriptor. .El .Pp On return, Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/kern/vfs_subr.c Mon May 16 02:42:53 2016 (r299886) @@ -4446,6 +4446,45 @@ vop_symlink_post(void *ap, int rc) VFS_KNOTE_LOCKED(a->a_dvp, NOTE_WRITE); } +void +vop_open_post(void *ap, int rc) +{ + struct vop_open_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_OPEN); +} + +void +vop_close_post(void *ap, int rc) +{ + struct vop_close_args *a = ap; + + if (!rc && (a->a_cred != NOCRED || /* filter out revokes */ + (a->a_vp->v_iflag & VI_DOOMED) == 0)) { + VFS_KNOTE_LOCKED(a->a_vp, (a->a_fflag & FWRITE) != 0 ? + NOTE_CLOSE_WRITE : NOTE_CLOSE); + } +} + +void +vop_read_post(void *ap, int rc) +{ + struct vop_read_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + +void +vop_readdir_post(void *ap, int rc) +{ + struct vop_readdir_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); +} + static struct knlist fs_knlist; static void Modified: stable/10/sys/kern/vnode_if.src ============================================================================== --- stable/10/sys/kern/vnode_if.src Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/kern/vnode_if.src Mon May 16 02:42:53 2016 (r299886) @@ -121,6 +121,7 @@ vop_mknod { %% open vp L L L +%! open post vop_open_post vop_open { IN struct vnode *vp; @@ -132,6 +133,7 @@ vop_open { %% close vp L L L +%! close post vop_close_post vop_close { IN struct vnode *vp; @@ -186,6 +188,7 @@ vop_markatime { }; %% read vp L L L +%! read post vop_read_post vop_read { IN struct vnode *vp; @@ -326,6 +329,7 @@ vop_symlink { %% readdir vp L L L +%! readdir post vop_readdir_post vop_readdir { IN struct vnode *vp; Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/sys/event.h Mon May 16 02:42:53 2016 (r299886) @@ -118,6 +118,12 @@ struct kevent { #define NOTE_LINK 0x0010 /* link count changed */ #define NOTE_RENAME 0x0020 /* vnode was renamed */ #define NOTE_REVOKE 0x0040 /* vnode access was revoked */ +#define NOTE_OPEN 0x0080 /* vnode was opened */ +#define NOTE_CLOSE 0x0100 /* file closed, fd did not + allowed write */ +#define NOTE_CLOSE_WRITE 0x0200 /* file closed, fd did allowed + write */ +#define NOTE_READ 0x0400 /* file was read */ /* * data/hint flags for EVFILT_PROC, shared with userspace Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Mon May 16 02:35:33 2016 (r299885) +++ stable/10/sys/sys/vnode.h Mon May 16 02:42:53 2016 (r299886) @@ -765,6 +765,7 @@ int dead_read(struct vop_read_args *ap); int dead_write(struct vop_write_args *ap); /* These are called from within the actual VOPS. */ +void vop_close_post(void *a, int rc); void vop_create_post(void *a, int rc); void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); @@ -774,6 +775,9 @@ void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); void vop_mknod_post(void *a, int rc); +void vop_open_post(void *a, int rc); +void vop_read_post(void *a, int rc); +void vop_readdir_post(void *a, int rc); void vop_reclaim_post(void *a, int rc); void vop_remove_post(void *a, int rc); void vop_rename_post(void *a, int rc); From owner-svn-src-stable-10@freebsd.org Mon May 16 16:29:57 2016 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 E826AB3D07F; Mon, 16 May 2016 16:29:57 +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 C3C5E13A6; Mon, 16 May 2016 16:29:57 +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 u4GGTvsW048301; Mon, 16 May 2016 16:29:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GGTumH048298; Mon, 16 May 2016 16:29:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605161629.u4GGTumH048298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 May 2016 16:29:56 +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: r299954 - stable/10/sbin/restore 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.22 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, 16 May 2016 16:29:58 -0000 Author: pfg Date: Mon May 16 16:29:56 2016 New Revision: 299954 URL: https://svnweb.freebsd.org/changeset/base/299954 Log: MFC r298901: restore: promote some getfiles() parameters to size_t. This is based on a change from OpenBSD: "Fix restore so that it can actually restore files larger than 4GB by changing the type of "size" to off_t in getfiles() plus little dependent type cleanup, from Daniel Lucq." It is an important for machines with 32 bit longs. While here unsign the flags, also from OpenBSD. Obtained from: OpenBSD (with changes) Modified: stable/10/sbin/restore/dirs.c stable/10/sbin/restore/extern.h stable/10/sbin/restore/tape.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/restore/dirs.c ============================================================================== --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) @@ -85,7 +85,7 @@ struct modeinfo { mode_t mode; uid_t uid; gid_t gid; - int flags; + u_int flags; int extsize; }; @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct static void flushent(void); static struct inotab *inotablookup(ino_t); static RST_DIR *opendirfile(const char *); -static void putdir(char *, long); -static void putdirattrs(char *, long); +static void putdir(char *, size_t); +static void putdirattrs(char *, size_t); static void putent(struct direct *); static void rst_seekdir(RST_DIR *, long, long); static long rst_telldir(RST_DIR *); @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) * Put the directory entries in the directory file */ static void -putdir(char *buf, long size) +putdir(char *buf, size_t size) { struct direct *dp; - long loc, i; + size_t loc, i; for (loc = 0; loc < size; ) { dp = (struct direct *)(buf + loc); @@ -356,12 +356,12 @@ putdir(char *buf, long size) "reclen not multiple of 4 "); if (dp->d_reclen < DIRSIZ(0, dp)) vprintf(stdout, - "reclen less than DIRSIZ (%d < %zu) ", + "reclen less than DIRSIZ (%u < %zu) ", dp->d_reclen, DIRSIZ(0, dp)); #if NAME_MAX < 255 if (dp->d_namlen > NAME_MAX) vprintf(stdout, - "reclen name too big (%d > %d) ", + "reclen name too big (%u > %u) ", dp->d_namlen, NAME_MAX); #endif vprintf(stdout, "\n"); @@ -418,7 +418,7 @@ flushent(void) * Save extended attributes for a directory entry to a file. */ static void -putdirattrs(char *buf, long size) +putdirattrs(char *buf, size_t size) { if (mf != NULL && fwrite(buf, size, 1, mf) != 1) Modified: stable/10/sbin/restore/extern.h ============================================================================== --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) @@ -54,8 +54,8 @@ void freeentry(struct entry *); void freename(char *); int genliteraldir(char *, ino_t); char *gentempname(struct entry *); -void getfile(void (*)(char *, long), void (*)(char *, long), - void (*)(char *, long)); +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), + void (*)(char *, size_t)); void getvol(long); void initsymtable(char *); int inodetype(ino_t); @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); void treescan(char *, ino_t, long (*)(char *, ino_t, int)); ino_t upperbnd(ino_t); long verifyfile(char *, ino_t, int); -void xtrnull(char *, long); +void xtrnull(char *, size_t); /* From ../dump/dumprmt.c */ void rmtclose(void); Modified: stable/10/sbin/restore/tape.c ============================================================================== --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) @@ -104,7 +104,7 @@ static int checksum(int *); static void findinode(struct s_spcl *); static void findtapeblksize(void); static char *setupextattr(int); -static void xtrattr(char *, long); +static void xtrattr(char *, size_t); static void set_extattr_link(char *, void *, int); static void set_extattr_fd(int, char *, void *, int); static int gethead(struct s_spcl *); @@ -114,12 +114,12 @@ static u_long swabl(u_long); static u_char *swablong(u_char *, int); static u_char *swabshort(u_char *, int); static void terminateinput(void); -static void xtrfile(char *, long); -static void xtrlnkfile(char *, long); -static void xtrlnkskip(char *, long); -static void xtrmap(char *, long); -static void xtrmapskip(char *, long); -static void xtrskip(char *, long); +static void xtrfile(char *, size_t); +static void xtrlnkfile(char *, size_t); +static void xtrlnkskip(char *, size_t); +static void xtrmap(char *, size_t); +static void xtrmapskip(char *, size_t); +static void xtrskip(char *, size_t); /* * Set up an input source @@ -564,7 +564,7 @@ printdumpinfo(void) int extractfile(char *name) { - int flags; + u_int flags; uid_t uid; gid_t gid; mode_t mode; @@ -931,13 +931,13 @@ skipfile(void) * to the skip function. */ void -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), - void (*skip)(char *, long)) +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), + void (*skip)(char *, size_t)) { int i; - off_t size; + volatile off_t size; int curblk, attrsize; - void (*fillit)(char *, long); + void (*fillit)(char *, size_t); static char clearedbuf[MAXBSIZE]; char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; char junk[TP_BSIZE]; @@ -1066,7 +1066,7 @@ setupextattr(int extsize) * Extract the next block of extended attributes. */ static void -xtrattr(char *buf, long size) +xtrattr(char *buf, size_t size) { if (extloc + size > extbufsize) @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) * Write out the next block of a file. */ static void -xtrfile(char *buf, long size) +xtrfile(char *buf, size_t size) { if (Nflag) @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrskip(char *buf, long size) +xtrskip(char *buf, size_t size) { if (lseek(ofile, size, SEEK_CUR) == -1) { @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) * Collect the next block of a symbolic link. */ static void -xtrlnkfile(char *buf, long size) +xtrlnkfile(char *buf, size_t size) { pathlen += size; @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) */ /* ARGSUSED */ static void -xtrlnkskip(char *buf, long size) +xtrlnkskip(char *buf, size_t size) { fprintf(stderr, "unallocated block in symbolic link %s\n", @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) * Collect the next block of a bit map. */ static void -xtrmap(char *buf, long size) +xtrmap(char *buf, size_t size) { memmove(map, buf, size); @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) */ /* ARGSUSED */ static void -xtrmapskip(char *buf, long size) +xtrmapskip(char *buf, size_t size) { panic("hole in map\n"); @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) */ /* ARGSUSED */ void -xtrnull(char *buf, long size) +xtrnull(char *buf, size_t size) { return; From owner-svn-src-stable-10@freebsd.org Mon May 16 17:23:58 2016 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 D2160B3C6EA; Mon, 16 May 2016 17:23:58 +0000 (UTC) (envelope-from asomers@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 977BD1E75; Mon, 16 May 2016 17:23:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GHNvdG066391; Mon, 16 May 2016 17:23:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GHNvZ4066390; Mon, 16 May 2016 17:23:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605161723.u4GHNvZ4066390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 May 2016 17:23: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: r299958 - 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.22 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, 16 May 2016 17:23:58 -0000 Author: asomers Date: Mon May 16 17:23:57 2016 New Revision: 299958 URL: https://svnweb.freebsd.org/changeset/base/299958 Log: MFC r298072 Don't corrupt ZFS label's physpath attribute when booting while a disk is missing Prior to this change, vdev_geom_open_by_path would call vdev_geom_attach prior to verifying the device's GUIDs. vdev_geom_attach calls vdev_geom_attrchange to set the physpath in the vdev object. The result is that if the disk could not be found, then the labels for other disks in the same TLD would overwrite the missing disk's physpath with the physpath of whichever disk currently has the same devname as the missing one used to have. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 16 17:18:26 2016 (r299957) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon May 16 17:23:57 2016 (r299958) @@ -241,9 +241,6 @@ vdev_geom_attach(struct g_provider *pp, cp->private = vd; vd->vdev_tsd = cp; - /* Fetch initial physical path information for this device. */ - vdev_geom_attrchanged(cp, "GEOM::physpath"); - cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } @@ -796,6 +793,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi } } + /* Fetch initial physical path information for this device. */ + if (cp != NULL) + vdev_geom_attrchanged(cp, "GEOM::physpath"); + g_topology_unlock(); PICKUP_GIANT(); if (cp == NULL) { From owner-svn-src-stable-10@freebsd.org Mon May 16 18:11:55 2016 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 3FC31B3D3EB; Mon, 16 May 2016 18:11:55 +0000 (UTC) (envelope-from asomers@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 E86F411F3; Mon, 16 May 2016 18:11:54 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GIBsni081630; Mon, 16 May 2016 18:11:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GIBrib081627; Mon, 16 May 2016 18:11:53 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605161811.u4GIBrib081627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 May 2016 18:11:53 +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: r299961 - stable/10/sys/cam/scsi 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.22 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, 16 May 2016 18:11:55 -0000 Author: asomers Date: Mon May 16 18:11:53 2016 New Revision: 299961 URL: https://svnweb.freebsd.org/changeset/base/299961 Log: MFC 298212 Add the ability to read a SAS device's Target Port NAA designator sys/cam/scsi/scsi_all.h sys/cam/scsi/scsi_all.c Add the scsi_devid_is_port_naa helper function Modified: stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.c Mon May 16 18:11:53 2016 (r299961) @@ -5626,6 +5626,19 @@ scsi_devid_is_lun_name(uint8_t *bufp) return 1; } +int +scsi_devid_is_port_naa(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_PORT) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + return 1; +} + struct scsi_vpd_id_descriptor * scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len, scsi_devid_checkfn_t ck_fn) Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Mon May 16 17:41:25 2016 (r299960) +++ stable/10/sys/cam/scsi/scsi_all.h Mon May 16 18:11:53 2016 (r299961) @@ -3659,6 +3659,7 @@ int scsi_devid_is_lun_eui64(uint8_t *bu int scsi_devid_is_lun_naa(uint8_t *bufp); int scsi_devid_is_lun_name(uint8_t *bufp); int scsi_devid_is_lun_t10(uint8_t *bufp); +int scsi_devid_is_port_naa(uint8_t *bufp); struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, scsi_devid_checkfn_t ck_fn); From owner-svn-src-stable-10@freebsd.org Mon May 16 18:47:55 2016 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 C4B6BB3DFA3; Mon, 16 May 2016 18:47:55 +0000 (UTC) (envelope-from slm@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 6199F1162; Mon, 16 May 2016 18:47:55 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GIlsA0093632; Mon, 16 May 2016 18:47:54 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GIlrZ9093625; Mon, 16 May 2016 18:47:53 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605161847.u4GIlrZ9093625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 16 May 2016 18:47:53 +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: r299962 - in stable/10/sys/dev/mpr: . mpi 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.22 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, 16 May 2016 18:47:55 -0000 Author: slm Date: Mon May 16 18:47:53 2016 New Revision: 299962 URL: https://svnweb.freebsd.org/changeset/base/299962 Log: MFC r299263, r299265, r299266, r299267, r299268, r299269, r299270, r299271, r299272, r299274, r299275 - (r299263) Update MPI headers to version 42. - (r299265) Several style changes and add copyrights for 2016. - (r299266) Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's. - (r299267) No log bit in IOCStatus and endian-safe changes. Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. - (r299268) Change logging level for a debug string to use MPR_LOG instead of MPR_INFO. - (r299269) Fix possible use of invalid pointer. It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. - (r299270) No need to set the MPRSAS_SHUTDOWN flag because it's never used. - (r299271) Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029 - (r299272) done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). - (r299274) Disks can go missing until a reboot is done in some cases. This is due to the DevHandle not being released, which causes the Firmware to not allow that disk to be re-added. - (r299275) Bump version of mpr driver to 13.00.00.00-fbsd Modified: stable/10/sys/dev/mpr/mpi/mpi2.h stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h stable/10/sys/dev/mpr/mpi/mpi2_hbd.h stable/10/sys/dev/mpr/mpi/mpi2_history.txt stable/10/sys/dev/mpr/mpi/mpi2_init.h stable/10/sys/dev/mpr/mpi/mpi2_ioc.h stable/10/sys/dev/mpr/mpi/mpi2_ra.h stable/10/sys/dev/mpr/mpi/mpi2_raid.h stable/10/sys/dev/mpr/mpi/mpi2_sas.h stable/10/sys/dev/mpr/mpi/mpi2_targ.h stable/10/sys/dev/mpr/mpi/mpi2_tool.h stable/10/sys/dev/mpr/mpi/mpi2_type.h stable/10/sys/dev/mpr/mpr.c stable/10/sys/dev/mpr/mpr_config.c stable/10/sys/dev/mpr/mpr_ioctl.h stable/10/sys/dev/mpr/mpr_mapping.c stable/10/sys/dev/mpr/mpr_mapping.h stable/10/sys/dev/mpr/mpr_pci.c stable/10/sys/dev/mpr/mpr_sas.c stable/10/sys/dev/mpr/mpr_sas.h stable/10/sys/dev/mpr/mpr_sas_lsi.c stable/10/sys/dev/mpr/mpr_table.c stable/10/sys/dev/mpr/mpr_user.c stable/10/sys/dev/mpr/mprvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,8 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2.h @@ -43,7 +44,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.33 + * mpi2.h Version: 02.00.42 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -125,6 +126,22 @@ * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-01-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- */ @@ -160,8 +177,15 @@ #define MPI2_VERSION_02_05 (0x0205) +/* minor version for MPI v2.6 compatible products */ +#define MPI26_VERSION_MINOR (0x06) +#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \ + MPI26_VERSION_MINOR) +#define MPI2_VERSION_02_06 (0x0206) + + /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x21) +#define MPI2_HEADER_VERSION_UNIT (0x2A) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -217,7 +241,8 @@ typedef volatile struct _MPI2_SYSTEM_INT U32 HCBSize; /* 0x74 */ U32 HCBAddressLow; /* 0x78 */ U32 HCBAddressHigh; /* 0x7C */ - U32 Reserved6[16]; /* 0x80 */ + U32 Reserved6[12]; /* 0x80 */ + U32 Scratchpad[4]; /* 0xB0 */ U32 RequestDescriptorPostLow; /* 0xC0 */ U32 RequestDescriptorPostHigh; /* 0xC4 */ U32 Reserved7[14]; /* 0xC8 */ @@ -261,10 +286,17 @@ typedef volatile struct _MPI2_SYSTEM_INT */ #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008) +#define MPI2_DIAG_SBR_RELOAD (0x00002000) + #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK (0x00001800) #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT (0x00000000) #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW (0x00000800) +/* Defines for V7A/V7R HostDiagnostic Register */ +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH64 (0x00000000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW64 (0x00000800) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH32 (0x00001000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW32 (0x00001800) #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400) #define MPI2_DIAG_FORCE_HCB_ON_RESET (0x00000200) #define MPI2_DIAG_HCB_MODE (0x00000100) @@ -335,7 +367,15 @@ typedef volatile struct _MPI2_SYSTEM_INT #define MPI2_HCB_ADDRESS_HIGH_OFFSET (0x0000007C) /* - * Offsets for the Request Queue + * Offsets for the Scratchpad registers + */ +#define MPI26_SCRATCHPAD0_OFFSET (0x000000B0) +#define MPI26_SCRATCHPAD1_OFFSET (0x000000B4) +#define MPI26_SCRATCHPAD2_OFFSET (0x000000B8) +#define MPI26_SCRATCHPAD3_OFFSET (0x000000BC) + +/* + * Offsets for the Request Descriptor Post Queue */ #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x000000C0) #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET (0x000000C4) @@ -367,7 +407,8 @@ typedef struct _MPI2_DEFAULT_REQUEST_DES Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t; /* defines for the RequestFlags field */ -#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x0E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x1E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_RSHIFT (1) /* use carefully; values below are pre-shifted left */ #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) @@ -455,6 +496,10 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_U Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; + +/* for the RequestFlags field, use the same defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR */ + + /* Reply Descriptors */ /* Default Reply Descriptor */ @@ -603,7 +648,8 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TOOLBOX (0x17) /* Toolbox */ #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) /* SCSI Enclosure Processor */ #define MPI2_FUNCTION_SMP_PASSTHROUGH (0x1A) /* SMP Passthrough */ -#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ +#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ /* for MPI v2.5 and earlier */ +#define MPI2_FUNCTION_IO_UNIT_CONTROL (0x1B) /* IO Unit Control */ /* for MPI v2.6 and later */ #define MPI2_FUNCTION_SATA_PASSTHROUGH (0x1C) /* SATA Passthrough */ #define MPI2_FUNCTION_DIAG_BUFFER_POST (0x1D) /* Diagnostic Buffer Post */ #define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ @@ -646,6 +692,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_IOCSTATUS_INVALID_FIELD (0x0007) #define MPI2_IOCSTATUS_INVALID_STATE (0x0008) #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009) +#define MPI2_IOCSTATUS_INSUFFICIENT_POWER (0x000A) /* MPI v2.6 and later */ /**************************************************************************** * Config IOCStatus values @@ -1123,7 +1170,7 @@ typedef union _MPI2_IEEE_SGE_CHAIN_UNION } MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION, Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t; -/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 products only */ +/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 and later */ typedef struct _MPI25_IEEE_SGE_CHAIN64 { U64 Address; @@ -1181,16 +1228,23 @@ typedef union _MPI25_SGE_IO_UNION #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT (0x00) #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT (0x80) +/* Next Segment Format */ + +#define MPI26_IEEE_SGE_FLAGS_NSF_MASK (0x1C) +#define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE (0x00) + /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5 and later, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* use in IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR (0x03) /* use in MPI v2.0 IEEE Chain Element only */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR) /* typo in name */ +#define MPI26_IEEE_SGE_FLAGS_IOCCTL_ADDR (0x02) /* for MPI v2.6 only */ + /**************************************************************************** * IEEE SGE operation Macros ****************************************************************************/ @@ -1246,8 +1300,9 @@ typedef union _MPI2_SGE_IO_UNION #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK (0x0C) #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE (0x00) #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE (0x04) -#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) -#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) +#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.5 and earlier */ +#define MPI26_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.6 */ +#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) /* only for MPI v2.5 and earlier */ /* values for SGL Type subfield */ #define MPI2_SGLFLAGS_SGL_TYPE_MASK (0x03) #define MPI2_SGLFLAGS_SGL_TYPE_MPI (0x00) Modified: stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.27 + * mpi2_cnfg.h Version: 02.00.35 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -210,6 +211,21 @@ * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- */ @@ -387,7 +403,6 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_ETHERNET_PGAD_IF_NUMBER_MASK (0x000000FF) - /**************************************************************************** * Configuration messages ****************************************************************************/ @@ -491,8 +506,17 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI25_MFGPAGE_DEVID_SAS3108_5 (0x0094) #define MPI25_MFGPAGE_DEVID_SAS3108_6 (0x0095) - - +/* MPI v2.6 SAS Products */ +#define MPI26_MFGPAGE_DEVID_SAS3216 (0x00C9) +#define MPI26_MFGPAGE_DEVID_SAS3224 (0x00C4) +#define MPI26_MFGPAGE_DEVID_SAS3316_1 (0x00C5) +#define MPI26_MFGPAGE_DEVID_SAS3316_2 (0x00C6) +#define MPI26_MFGPAGE_DEVID_SAS3316_3 (0x00C7) +#define MPI26_MFGPAGE_DEVID_SAS3316_4 (0x00C8) +#define MPI26_MFGPAGE_DEVID_SAS3324_1 (0x00C0) +#define MPI26_MFGPAGE_DEVID_SAS3324_2 (0x00C1) +#define MPI26_MFGPAGE_DEVID_SAS3324_3 (0x00C2) +#define MPI26_MFGPAGE_DEVID_SAS3324_4 (0x00C3) /* Manufacturing Page 0 */ @@ -962,14 +986,16 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U16 BoardTemperature; /* 0x14 */ U8 BoardTemperatureUnits; /* 0x16 */ U8 Reserved3; /* 0x17 */ - U32 Reserved4; /* 0x18 */ - U32 Reserved5; /* 0x1C */ - U32 Reserved6; /* 0x20 */ - U32 Reserved7; /* 0x24 */ + U32 BoardPowerRequirement; /* 0x18 */ /* reserved prior to MPI v2.6 */ + U32 PCISlotPowerAllocation; /* 0x1C */ /* reserved prior to MPI v2.6 */ + U8 Flags; /* 0x20 */ /* reserved prior to MPI v2.6 */ + U8 Reserved6; /* 0x21 */ + U16 Reserved7; /* 0x22 */ + U32 Reserved8; /* 0x24 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x04) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x05) /* defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */ #define MPI25_IOUNITPAGE7_PM_INIT_MASK (0xC0) @@ -1050,6 +1076,8 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) #define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) +/* defines for IO Unit Page 7 Flags field */ +#define MPI2_IOUNITPAGE7_FLAG_CABLE_POWER_EXC (0x01) /* IO Unit Page 8 */ @@ -1168,6 +1196,61 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE10_PAGEVERSION (0x01) +/* IO Unit Page 11 (for MPI v2.6 and later) */ + +typedef struct _MPI26_IOUNIT11_SPINUP_GROUP +{ + U8 MaxTargetSpinup; /* 0x00 */ + U8 SpinupDelay; /* 0x01 */ + U8 SpinupFlags; /* 0x02 */ + U8 Reserved1; /* 0x03 */ +} MPI26_IOUNIT11_SPINUP_GROUP, MPI2_POINTER PTR_MPI26_IOUNIT11_SPINUP_GROUP, + Mpi26IOUnit11SpinupGroup_t, MPI2_POINTER pMpi26IOUnit11SpinupGroup_t; + +/* defines for IO Unit Page 11 SpinupFlags */ +#define MPI26_IOUNITPAGE11_SPINUP_DISABLE_FLAG (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * four and check the value returned for NumPhys at runtime. + */ +#ifndef MPI26_IOUNITPAGE11_PHY_MAX +#define MPI26_IOUNITPAGE11_PHY_MAX (4) +#endif + +typedef struct _MPI26_CONFIG_PAGE_IO_UNIT_11 +{ + MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x04 */ + MPI26_IOUNIT11_SPINUP_GROUP SpinupGroupParameters[4]; /* 0x08 */ + U32 Reserved2; /* 0x18 */ + U32 Reserved3; /* 0x1C */ + U32 Reserved4; /* 0x20 */ + U8 BootDeviceWaitTime; /* 0x24 */ + U8 Reserved5; /* 0x25 */ + U16 Reserved6; /* 0x26 */ + U8 NumPhys; /* 0x28 */ + U8 PEInitialSpinupDelay; /* 0x29 */ + U8 PEReplyDelay; /* 0x2A */ + U8 Flags; /* 0x2B */ + U8 PHY[MPI26_IOUNITPAGE11_PHY_MAX];/* 0x2C */ +} MPI26_CONFIG_PAGE_IO_UNIT_11, + MPI2_POINTER PTR_MPI26_CONFIG_PAGE_IO_UNIT_11, + Mpi26IOUnitPage11_t, MPI2_POINTER pMpi26IOUnitPage11_t; + +#define MPI26_IOUNITPAGE11_PAGEVERSION (0x00) + +/* defines for Flags field */ +#define MPI26_IOUNITPAGE11_FLAGS_AUTO_PORTENABLE (0x01) + +/* defines for PHY field */ +#define MPI26_IOUNITPAGE11_PHY_SPINUP_GROUP_MASK (0x03) + + + + + /**************************************************************************** * IOC Config Pages @@ -1331,7 +1414,9 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 BiosOptions; /* 0x04 */ U32 IOCSettings; /* 0x08 */ - U32 Reserved1; /* 0x0C */ + U8 SSUTimeout; /* 0x0C */ + U8 Reserved1; /* 0x0D */ + U16 Reserved2; /* 0x0E */ U32 DeviceSettings; /* 0x10 */ U16 NumberOfDevices; /* 0x14 */ U16 UEFIVersion; /* 0x16 */ @@ -1342,18 +1427,36 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 } MPI2_CONFIG_PAGE_BIOS_1, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_1, Mpi2BiosPage1_t, MPI2_POINTER pMpi2BiosPage1_t; -#define MPI2_BIOSPAGE1_PAGEVERSION (0x05) +#define MPI2_BIOSPAGE1_PAGEVERSION (0x07) /* values for BIOS Page 1 BiosOptions field */ -#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) -#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_BOOT_LIST_ADD_ALT_BOOT_DEVICE (0x00008000) +#define MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG (0x00004000) -#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) -#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) -#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_MASK (0x00003800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PBDHL (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ENCSLOSURE (0x00000800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_LWWID (0x00001000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PSENS (0x00001800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ESPHY (0x00002000) + +#define MPI2_BIOSPAGE1_OPTIONS_X86_DISABLE_BIOS (0x00000400) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_REGISTRATION_UEFI_BSD (0x00000300) +#define MPI2_BIOSPAGE1_OPTIONS_USE_BIT0_REGISTRATION_UEFI_BSD (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_FULL_REGISTRATION_UEFI_BSD (0x00000100) +#define MPI2_BIOSPAGE1_OPTIONS_ADAPTER_REGISTRATION_UEFI_BSD (0x00000200) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_REGISTRATION_UEFI_BSD (0x00000300) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) +#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) +#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) +#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) /* values for BIOS Page 1 IOCSettings field */ #define MPI2_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) @@ -1477,6 +1580,8 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_2 /* BIOS Page 3 */ +#define MPI2_BIOSPAGE3_NUM_ADAPTER (4) + typedef struct _MPI2_ADAPTER_INFO { U8 PciBusNumber; /* 0x00 */ @@ -1488,17 +1593,26 @@ typedef struct _MPI2_ADAPTER_INFO #define MPI2_ADAPTER_INFO_FLAGS_EMBEDDED (0x0001) #define MPI2_ADAPTER_INFO_FLAGS_INIT_STATUS (0x0002) +typedef struct _MPI2_ADAPTER_ORDER_AUX +{ + U64 WWID; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ +} MPI2_ADAPTER_ORDER_AUX, MPI2_POINTER PTR_MPI2_ADAPTER_ORDER_AUX, + Mpi2AdapterOrderAux_t, MPI2_POINTER pMpi2AdapterOrderAux_t; + typedef struct _MPI2_CONFIG_PAGE_BIOS_3 { MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 GlobalFlags; /* 0x04 */ U32 BiosVersion; /* 0x08 */ - MPI2_ADAPTER_INFO AdapterOrder[4]; /* 0x0C */ + MPI2_ADAPTER_INFO AdapterOrder[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x0C */ U32 Reserved1; /* 0x1C */ + MPI2_ADAPTER_ORDER_AUX AdapterOrderAux[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x20 */ /* MPI v2.5 and newer */ } MPI2_CONFIG_PAGE_BIOS_3, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_3, Mpi2BiosPage3_t, MPI2_POINTER pMpi2BiosPage3_t; -#define MPI2_BIOSPAGE3_PAGEVERSION (0x00) +#define MPI2_BIOSPAGE3_PAGEVERSION (0x01) /* values for BIOS Page 3 GlobalFlags */ #define MPI2_BIOSPAGE3_FLAGS_PAUSE_ON_ERROR (0x00000002) @@ -1990,6 +2104,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT0_PORTFLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 0 PhyFlags */ +#define MPI2_SASIOUNIT0_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT0_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT0_PHYFLAGS_ZONING_ENABLED (0x10) #define MPI2_SASIOUNIT0_PHYFLAGS_PHY_DISABLED (0x08) @@ -2082,6 +2198,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) /* MPI v2.0 only. Obsolete in MPI v2.5 and later. */ /* values for SAS IO Unit Page 1 AdditionalControlFlags */ +#define MPI2_SASIOUNIT1_ACONTROL_DA_PERSIST_CONNECT (0x0100) #define MPI2_SASIOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL (0x0080) #define MPI2_SASIOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040) #define MPI2_SASIOUNIT1_ACONTROL_INVALID_TOPOLOGY_CORRECTION (0x0020) @@ -2099,6 +2216,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 1 PhyFlags */ +#define MPI2_SASIOUNIT1_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT1_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT1_PHYFLAGS_ZONING_ENABLE (0x10) #define MPI2_SASIOUNIT1_PHYFLAGS_PHY_DISABLE (0x08) @@ -2117,7 +2236,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN /* see mpi2_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ -/* SAS IO Unit Page 4 */ +/* SAS IO Unit Page 4 (for MPI v2.5 and earlier) */ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_GROUP { @@ -2148,7 +2267,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN U32 Reserved2; /* 0x1C */ U32 Reserved3; /* 0x20 */ U8 BootDeviceWaitTime; /* 0x24 */ - U8 Reserved4; /* 0x25 */ + U8 SATADeviceWaitTime; /* 0x25 */ U16 Reserved5; /* 0x26 */ U8 NumPhys; /* 0x28 */ U8 PEInitialSpinupDelay; /* 0x29 */ @@ -2595,6 +2714,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_DEV #define MPI2_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED (0x0020) #define MPI2_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED (0x0010) #define MPI2_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH (0x0008) +#define MPI2_SAS_DEVICE0_FLAGS_PERSIST_CAPABLE (0x0004) #define MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID (0x0002) #define MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x0001) @@ -2766,6 +2886,19 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE (0xD1) #define MPI2_SASPHY3_EVENT_CODE_RX_AIP (0xD2) +/* Following codes are product specific and in MPI v2.6 and later */ +#define MPI2_SASPHY3_EVENT_CODE_LCARB_WAIT_TIME (0xD3) +#define MPI2_SASPHY3_EVENT_CODE_RCVD_CONN_RESP_WAIT_TIME (0xD4) +#define MPI2_SASPHY3_EVENT_CODE_LCCONN_TIME (0xD5) +#define MPI2_SASPHY3_EVENT_CODE_SSP_TX_START_TRANSMIT (0xD6) +#define MPI2_SASPHY3_EVENT_CODE_SATA_TX_START (0xD7) +#define MPI2_SASPHY3_EVENT_CODE_SMP_TX_START_TRANSMT (0xD8) +#define MPI2_SASPHY3_EVENT_CODE_TX_SMP_BREAK_CONN (0xD9) +#define MPI2_SASPHY3_EVENT_CODE_SSP_RX_START_RECEIVE (0xDA) +#define MPI2_SASPHY3_EVENT_CODE_SATA_RX_START_RECEIVE (0xDB) +#define MPI2_SASPHY3_EVENT_CODE_SMP_RX_START_RECEIVE (0xDC) + + /* values for the CounterType field */ #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING (0x00) #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING (0x01) Modified: stable/10/sys/dev/mpr/mpi/mpi2_hbd.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2009-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.02 + * mpi2_hbd.h Version: 02.00.03 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -57,6 +58,7 @@ * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- */ Modified: stable/10/sys/dev/mpr/mpi/mpi2_history.txt ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_history.txt Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_history.txt Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,27 +37,28 @@ ============================== Copyright (c) 2000-2015 LSI Corporation. - Copyright (c) 2013-2015 Avago Technologies + Copyright (c) 2013-2016 Avago Technologies + All rights reserved. --------------------------------------- - Header Set Release Version: 02.00.33 - Header Set Release Date: 12-05-13 + Header Set Release Version: 02.00.42 + Header Set Release Date: 01-04-16 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.33 02.00.32 - mpi2_cnfg.h 02.00.27 02.00.26 - mpi2_init.h 02.00.15 02.00.15 - mpi2_ioc.h 02.00.24 02.00.23 - mpi2_raid.h 02.00.10 02.00.10 - mpi2_sas.h 02.00.08 02.00.08 - mpi2_targ.h 02.00.06 02.00.06 - mpi2_tool.h 02.00.11 02.00.11 - mpi2_type.h 02.00.00 02.00.00 - mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.02 02.00.02 - mpi2_history.txt 02.00.33 02.00.32 + mpi2.h 02.00.42 02.00.41 + mpi2_cnfg.h 02.00.35 02.00.34 + mpi2_init.h 02.00.20 02.00.19 + mpi2_ioc.h 02.00.27 02.00.27 + mpi2_raid.h 02.00.11 02.00.11 + mpi2_sas.h 02.00.10 02.00.10 + mpi2_targ.h 02.00.09 02.00.09 + mpi2_tool.h 02.00.13 02.00.13 + mpi2_type.h 02.00.01 02.00.01 + mpi2_ra.h 02.00.01 02.00.01 + mpi2_hbd.h 02.00.03 02.00.03 + mpi2_history.txt 02.00.41 02.00.40 * Date Version Description @@ -134,6 +135,22 @@ mpi2.h * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-04-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -294,6 +311,21 @@ mpi2_cnfg.h * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field.. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- mpi2_init.h @@ -323,6 +355,16 @@ mpi2_init.h * Priority to match SAM-4. * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY. * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. + * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, + * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -441,6 +483,16 @@ mpi2_ioc.h * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines. * -------------------------------------------------------------------------- mpi2_raid.h @@ -479,6 +531,9 @@ mpi2_sas.h * Passthrough Request message. * 08-19-13 02.00.08 Made MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL obsolete * for anything newer than MPI v2.0. + * 11-18-14 02.00.09 Updated copyright information. + * 03-16-15 02.00.10 Updated for MPI v2.6. + * Added MPI2_SATA_PT_REQ_PT_FLAGS_FPDMA. * -------------------------------------------------------------------------- mpi2_targ.h @@ -496,6 +551,11 @@ mpi2_targ.h * request message structure. * Added AbortType MPI2_TARGET_MODE_ABORT_DEVHANDLE and * MPI2_TARGET_MODE_ABORT_ALL_COMMANDS. + * 06-13-14 02.00.07 Added MinMSIxIndex and MaxMSIxIndex fields to + * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. + * 11-18-14 02.00.08 Updated copyright information. + * 03-16-15 02.00.09 Updated for MPI v2.6. + * Added MPI26_TARGET_ASSIST_IOFLAGS_ESCAPE_PASSTHROUGH. * -------------------------------------------------------------------------- mpi2_tool.h @@ -519,14 +579,18 @@ mpi2_tool.h * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that * it uses MPI Chain SGE as well as MPI Simple SGE. * 08-19-13 02.00.11 Added MPI2_TOOLBOX_TEXT_DISPLAY_TOOL and related info. + * 01-08-14 02.00.12 Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC. + * 11-18-14 02.00.13 Updated copyright information. * -------------------------------------------------------------------------- mpi2_type.h * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_ra.h * 05-06-09 02.00.00 Initial version. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_hbd.h @@ -534,24 +598,53 @@ mpi2_hbd.h * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.33 02.00.32 02.00.31 02.00.30 ----------- -------- -------- -------- -------- -mpi2.h 02.00.33 02.00.32 02.00.31 02.00.30 -mpi2_cnfg.h 02.00.27 02.00.26 02.00.25 02.00.25 -mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 -mpi2_ioc.h 02.00.24 02.00.23 02.00.22 02.00.22 -mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.09 -mpi2_sas.h 02.00.08 02.00.08 02.00.07 02.00.07 -mpi2_targ.h 02.00.06 02.00.06 02.00.06 02.00.06 -mpi2_tool.h 02.00.11 02.00.11 02.00.10 02.00.10 -mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 +Filename 02.00.42 +---------- -------- +mpi2.h 02.00.42 +mpi2_cnfg.h 02.00.35 +mpi2_init.h 02.00.20 +mpi2_ioc.h 02.00.27 +mpi2_raid.h 02.00.11 +mpi2_sas.h 02.00.10 +mpi2_targ.h 02.00.09 +mpi2_tool.h 02.00.13 +mpi2_type.h 02.00.01 +mpi2_ra.h 02.00.01 +mpi2_hbd.h 02.00.03 + +Filename 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +mpi2_cnfg.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_init.h 02.00.19 02.00.18 02.00.17 02.00.17 02.00.17 02.00.16 +mpi2_ioc.h 02.00.27 02.00.27 02.00.26 02.00.26 02.00.26 02.00.25 +mpi2_raid.h 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 +mpi2_sas.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_targ.h 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 02.00.08 +mpi2_tool.h 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 +mpi2_type.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_ra.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_hbd.h 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 + +Filename 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_cnfg.h 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.25 +mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 +mpi2_ioc.h 02.00.24 02.00.24 02.00.24 02.00.23 02.00.22 02.00.22 +mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_sas.h 02.00.08 02.00.08 02.00.08 02.00.08 02.00.07 02.00.07 +mpi2_targ.h 02.00.07 02.00.06 02.00.06 02.00.06 02.00.06 02.00.06 +mpi2_tool.h 02.00.12 02.00.12 02.00.11 02.00.11 02.00.10 02.00.10 +mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 Filename 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.24 ---------- -------- -------- -------- -------- -------- -------- Modified: stable/10/sys/dev/mpr/mpi/mpi2_init.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_init.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_init.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_init.h * Title: MPI SCSI initiator mode messages and structures * Creation Date: June 23, 2006 * - * mpi2_init.h Version: 02.00.15 + * mpi2_init.h Version: 02.00.20 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -81,6 +82,14 @@ * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- */ @@ -164,8 +173,9 @@ typedef struct _MPI2_SCSI_IO_REQUEST #define MPI2_SCSIIO_MSGFLAGS_MASK_SENSE_ADDR (0x0C) #define MPI2_SCSIIO_MSGFLAGS_SYSTEM_SENSE_ADDR (0x00) #define MPI2_SCSIIO_MSGFLAGS_IOCDDR_SENSE_ADDR (0x04) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) +#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) /* for MPI v2.5 and earlier only */ +#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) /* for MPI v2.5 and earlier only */ +#define MPI26_SCSIIO_MSGFLAGS_IOCCTL_SENSE_ADDR (0x08) /* for MPI v2.6 only */ /* SCSI IO SGLFlags bits */ @@ -268,7 +278,7 @@ typedef union _MPI25_SCSI_IO_CDB_UNION } MPI25_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI25_SCSI_IO_CDB_UNION, Mpi25ScsiIoCdb_t, MPI2_POINTER pMpi25ScsiIoCdb_t; -/* MPI v2.5 SCSI IO Request Message */ +/* MPI v2.5/2.6 SCSI IO Request Message */ typedef struct _MPI25_SCSI_IO_REQUEST { U16 DevHandle; /* 0x00 */ @@ -347,8 +357,10 @@ typedef struct _MPI25_SCSI_IO_REQUEST #define MPI25_SCSIIO_IOFLAGS_NORMAL_PATH (0x0000) #define MPI25_SCSIIO_IOFLAGS_FAST_PATH (0x4000) +#define MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH (0x2000) /* MPI v2.6 and later */ #define MPI25_SCSIIO_IOFLAGS_LARGE_CDB (0x1000) #define MPI25_SCSIIO_IOFLAGS_BIDIRECTIONAL (0x0800) +#define MPI26_SCSIIO_IOFLAGS_PORT_REQUEST (0x0400) /* MPI v2.6 and later; IOC use only */ #define MPI25_SCSIIO_IOFLAGS_CDBLENGTH_MASK (0x01FF) /* MPI v2.5 defines for the EEDPFlags bits */ @@ -394,11 +406,19 @@ typedef struct _MPI2_SCSI_IO_REPLY U16 TaskTag; /* 0x20 */ U16 SCSIStatusQualifier; /* 0x22 */ U32 BidirectionalTransferCount; /* 0x24 */ - U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5 only; Reserved in MPI 2.0 */ - U32 Reserved6; /* 0x2C */ + U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedAppTag; /* 0x2C */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedGuard; /* 0x2E */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U32 EEDPObservedRefTag; /* 0x30 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ } MPI2_SCSI_IO_REPLY, MPI2_POINTER PTR_MPI2_SCSI_IO_REPLY, Mpi2SCSIIOReply_t, MPI2_POINTER pMpi2SCSIIOReply_t; +/* SCSI IO Reply MsgFlags bits */ +#define MPI26_SCSIIO_REPLY_MSGFLAGS_REFTAG_OBSERVED_VALID (0x01) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_GUARD_OBSERVED_VALID (0x02) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_APPTAG_OBSERVED_VALID (0x04) + + /* SCSI IO Reply SCSIStatus values (SAM-4 status codes) */ #define MPI2_SCSI_STATUS_GOOD (0x00) @@ -474,12 +494,10 @@ typedef struct _MPI2_SCSI_TASK_MANAGE_RE #define MPI2_SCSITASKMGMT_MSGFLAGS_MASK_TARGET_RESET (0x18) #define MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET (0x00) +#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) #define MPI2_SCSITASKMGMT_MSGFLAGS_NEXUS_RESET_SRST (0x08) #define MPI2_SCSITASKMGMT_MSGFLAGS_SAS_HARD_LINK_RESET (0x10) -#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) - - /* SCSI Task Management Reply Message */ typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY @@ -561,6 +579,7 @@ typedef struct _MPI2_SEP_REQUEST #define MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01) /* SlotStatus defines */ +#define MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) #define MPI2_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) @@ -598,6 +617,7 @@ typedef struct _MPI2_SEP_REPLY Mpi2SepReply_t, MPI2_POINTER pMpi2SepReply_t; /* SlotStatus defines */ +#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) #define MPI2_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) Modified: stable/10/sys/dev/mpr/mpi/mpi2_ioc.h ============================================================================== --- stable/10/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 16 18:11:53 2016 (r299961) +++ stable/10/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 16 18:47:53 2016 (r299962) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_ioc.h * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: October 11, 2006 * - * mpi2_ioc.h Version: 02.00.24 + * mpi2_ioc.h Version: 02.00.27 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -168,6 +169,17 @@ * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines + * * -------------------------------------------------------------------------- */ @@ -200,8 +212,8 @@ typedef struct _MPI2_IOC_INIT_REQUEST U16 MsgVersion; /* 0x0C */ U16 HeaderVersion; /* 0x0E */ U32 Reserved5; /* 0x10 */ - U16 Reserved6; /* 0x14 */ - U8 Reserved7; /* 0x16 */ + U16 ConfigurationFlags; /* 0x14 */ + U8 HostPageSize; /* 0x16 */ U8 HostMSIxVectors; /* 0x17 */ U16 Reserved8; /* 0x18 */ U16 SystemRequestFrameSize; /* 0x1A */ @@ -329,7 +341,12 @@ typedef struct _MPI2_IOC_FACTS_REPLY U16 MaxDevHandle; /* 0x38 */ U16 MaxPersistentEntries; /* 0x3A */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon May 16 19:10:37 2016 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 33146B3D986; Mon, 16 May 2016 19:10:37 +0000 (UTC) (envelope-from jkim@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 DFD32151F; Mon, 16 May 2016 19:10:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJAa5n000707; Mon, 16 May 2016 19:10:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJAZtX000704; Mon, 16 May 2016 19:10:35 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605161910.u4GJAZtX000704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 19: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: r299964 - in stable/10/crypto/openssl/crypto: aes/asm sha/asm 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.22 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, 16 May 2016 19:10:37 -0000 Author: jkim Date: Mon May 16 19:10:35 2016 New Revision: 299964 URL: https://svnweb.freebsd.org/changeset/base/299964 Log: Detect Clang to support AVX instructions on x86 platforms. Note head (OpenSSL 1.0.2 branch) has similar changes. Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl ============================================================================== --- stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Mon May 16 19:10:35 2016 (r299964) @@ -68,6 +68,7 @@ $avx=1 if (!$avx && $win64 && ($flavour $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl ============================================================================== --- stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:10:35 2016 (r299964) @@ -116,6 +116,9 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ && $1>=2.03); # first version supporting AVX +$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && + $2>=3.0); # first version supporting AVX + &external_label("OPENSSL_ia32cap_P") if ($xmm); Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl ============================================================================== --- stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Mon May 16 19:07:58 2016 (r299963) +++ stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Mon May 16 19:10:35 2016 (r299964) @@ -81,6 +81,8 @@ $avx=1 if (!$avx && $win64 && ($flavour $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && + $2>=3.0); open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; From owner-svn-src-stable-10@freebsd.org Mon May 16 19:30:28 2016 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 83402B3E0AB; Mon, 16 May 2016 19:30:28 +0000 (UTC) (envelope-from jkim@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 4C8D8167C; Mon, 16 May 2016 19:30:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJUR9M007113; Mon, 16 May 2016 19:30:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJURNY007107; Mon, 16 May 2016 19:30:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605161930.u4GJURNY007107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 19:30:27 +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: r299966 - in stable/10: secure/lib/libcrypto secure/lib/libcrypto/amd64 secure/lib/libcrypto/i386 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.22 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, 16 May 2016 19:30:28 -0000 Author: jkim Date: Mon May 16 19:30:27 2016 New Revision: 299966 URL: https://svnweb.freebsd.org/changeset/base/299966 Log: - Make libcrypto.so position independent on i386. - Enable linker error when libcrypto.so contains a relocation against text. - Add "Do not modify" comment to generated source files. - Set CC environment variable for Perl scripts to enable AVX instructions. - Update __FreeBSD_version to indicate libcrypto.so is position independent. Note this is a direct commit because head has OpenSSL 1.0.2 branch but based on r299389, r299462, r299464, r299479, and r299480. Added: stable/10/secure/lib/libcrypto/i386/aes-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/aes-586.s stable/10/secure/lib/libcrypto/i386/aesni-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/aesni-x86.s stable/10/secure/lib/libcrypto/i386/bf-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bf-586.s stable/10/secure/lib/libcrypto/i386/bf-686.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bf-686.s stable/10/secure/lib/libcrypto/i386/bn-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/bn-586.s stable/10/secure/lib/libcrypto/i386/cast-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/cast-586.s stable/10/secure/lib/libcrypto/i386/cmll-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/cmll-x86.s stable/10/secure/lib/libcrypto/i386/co-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/co-586.s stable/10/secure/lib/libcrypto/i386/crypt586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/crypt586.s stable/10/secure/lib/libcrypto/i386/des-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/des-586.s stable/10/secure/lib/libcrypto/i386/ghash-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/ghash-x86.s stable/10/secure/lib/libcrypto/i386/md5-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/md5-586.s stable/10/secure/lib/libcrypto/i386/rc4-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rc4-586.s stable/10/secure/lib/libcrypto/i386/rc5-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rc5-586.s stable/10/secure/lib/libcrypto/i386/rmd-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/rmd-586.s stable/10/secure/lib/libcrypto/i386/sha1-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha1-586.s stable/10/secure/lib/libcrypto/i386/sha256-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha256-586.s stable/10/secure/lib/libcrypto/i386/sha512-586.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/sha512-586.s stable/10/secure/lib/libcrypto/i386/vpaes-x86.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/vpaes-x86.s stable/10/secure/lib/libcrypto/i386/wp-mmx.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/wp-mmx.s stable/10/secure/lib/libcrypto/i386/x86-gf2m.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86-gf2m.s stable/10/secure/lib/libcrypto/i386/x86-mont.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86-mont.s stable/10/secure/lib/libcrypto/i386/x86cpuid.S - copied, changed from r299965, stable/10/secure/lib/libcrypto/i386/x86cpuid.s Deleted: stable/10/secure/lib/libcrypto/i386/aes-586.s stable/10/secure/lib/libcrypto/i386/aesni-x86.s stable/10/secure/lib/libcrypto/i386/bf-586.s stable/10/secure/lib/libcrypto/i386/bf-686.s stable/10/secure/lib/libcrypto/i386/bn-586.s stable/10/secure/lib/libcrypto/i386/cast-586.s stable/10/secure/lib/libcrypto/i386/cmll-x86.s stable/10/secure/lib/libcrypto/i386/co-586.s stable/10/secure/lib/libcrypto/i386/crypt586.s stable/10/secure/lib/libcrypto/i386/des-586.s stable/10/secure/lib/libcrypto/i386/ghash-x86.s stable/10/secure/lib/libcrypto/i386/md5-586.s stable/10/secure/lib/libcrypto/i386/rc4-586.s stable/10/secure/lib/libcrypto/i386/rc5-586.s stable/10/secure/lib/libcrypto/i386/rmd-586.s stable/10/secure/lib/libcrypto/i386/sha1-586.s stable/10/secure/lib/libcrypto/i386/sha256-586.s stable/10/secure/lib/libcrypto/i386/sha512-586.s stable/10/secure/lib/libcrypto/i386/vpaes-x86.s stable/10/secure/lib/libcrypto/i386/wp-mmx.s stable/10/secure/lib/libcrypto/i386/x86-gf2m.s stable/10/secure/lib/libcrypto/i386/x86-mont.s stable/10/secure/lib/libcrypto/i386/x86cpuid.s Modified: stable/10/secure/lib/libcrypto/Makefile stable/10/secure/lib/libcrypto/Makefile.asm stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S stable/10/secure/lib/libcrypto/amd64/aesni-x86_64.S stable/10/secure/lib/libcrypto/amd64/bsaes-x86_64.S stable/10/secure/lib/libcrypto/amd64/cmll-x86_64.S stable/10/secure/lib/libcrypto/amd64/ghash-x86_64.S stable/10/secure/lib/libcrypto/amd64/md5-x86_64.S stable/10/secure/lib/libcrypto/amd64/modexp512-x86_64.S stable/10/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S stable/10/secure/lib/libcrypto/amd64/rc4-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha1-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha256-x86_64.S stable/10/secure/lib/libcrypto/amd64/sha512-x86_64.S stable/10/secure/lib/libcrypto/amd64/vpaes-x86_64.S stable/10/secure/lib/libcrypto/amd64/wp-x86_64.S stable/10/secure/lib/libcrypto/amd64/x86_64-gf2m.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont.S stable/10/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/10/secure/lib/libcrypto/amd64/x86_64cpuid.S stable/10/sys/sys/param.h Modified: stable/10/secure/lib/libcrypto/Makefile ============================================================================== --- stable/10/secure/lib/libcrypto/Makefile Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/Makefile Mon May 16 19:30:27 2016 (r299966) @@ -7,7 +7,6 @@ SUBDIR= engines LIB= crypto SHLIB_MAJOR= 7 -ALLOW_SHARED_TEXTREL= NO_LINT= @@ -26,7 +25,7 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex .if ${MACHINE_CPUARCH} == "amd64" SRCS+= x86_64cpuid.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= x86cpuid.s +SRCS+= x86cpuid.S .else SRCS+= mem_clr.c .endif @@ -38,7 +37,7 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes SRCS+= aes-x86_64.S aesni-sha1-x86_64.S aesni-x86_64.S bsaes-x86_64.S \ vpaes-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= aes-586.s aesni-x86.s vpaes-x86.s +SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c .endif @@ -63,9 +62,9 @@ INCS+= asn1.h asn1_mac.h asn1t.h SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c .if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE_CPU:Mi686} -SRCS+= bf-686.s +SRCS+= bf-686.S .else -SRCS+= bf-586.s +SRCS+= bf-586.S .endif .else SRCS+= bf_enc.c @@ -87,7 +86,7 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn SRCS+= modexp512-x86_64.S x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S \ x86_64-mont5.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= bn-586.s co-586.s x86-gf2m.s x86-mont.s +SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c .endif @@ -102,7 +101,7 @@ SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= cmll_misc.c cmll-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= cmll-x86.s +SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c .endif @@ -136,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= crypt586.s des-586.s +SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c .endif @@ -219,7 +218,7 @@ SRCS+= md5_dgst.c md5_one.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= md5-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= md5-586.s +SRCS+= md5-586.S .endif INCS+= md5.h @@ -232,7 +231,7 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128 .if ${MACHINE_CPUARCH} == "amd64" SRCS+= ghash-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= ghash-x86.s +SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -278,7 +277,7 @@ SRCS+= rc4_utl.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= rc4-md5-x86_64.S rc4-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= rc4-586.s +SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c .endif @@ -287,7 +286,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rc5-586.s +SRCS+= rc5-586.S .else SRCS+= rc5_enc.c .endif @@ -296,7 +295,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rmd-586.s +SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -316,7 +315,7 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh .if ${MACHINE_CPUARCH} == "amd64" SRCS+= sha1-x86_64.S sha256-x86_64.S sha512-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= sha1-586.s sha256-586.s sha512-586.s +SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -347,7 +346,7 @@ SRCS+= wp_dgst.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= wp-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= wp-mmx.s wp_block.c +SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c .endif @@ -379,9 +378,6 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/asn1 CFLAGS+= -I${LCRYPTO_SRC}/crypto/evp CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes -.if !empty(SRCS:M*.s) -AFLAGS+= --noexecstack -.endif .if !empty(SRCS:M*.S) ACFLAGS+= -Wa,--noexecstack .endif Modified: stable/10/secure/lib/libcrypto/Makefile.asm ============================================================================== --- stable/10/secure/lib/libcrypto/Makefile.asm Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/Makefile.asm Mon May 16 19:30:27 2016 (r299966) @@ -1,8 +1,8 @@ # $FreeBSD$ -# Use this to help generate the asm *.[Ss] files after an import. It is not +# Use this to help generate the asm *.S files after an import. It is not # perfect by any means, but does what is needed. -# Do a 'make -f Makefile.asm all' and it will generate *.s. Move them -# to the i386 subdir, and correct any exposed paths and $ FreeBSD $ tags. +# Do a 'make -f Makefile.asm all' and it will generate *.S. Move them +# to the arch subdir, and correct any exposed paths and $ FreeBSD $ tags. .include "Makefile.inc" @@ -39,31 +39,39 @@ SRCS+= ghash-x86_64.pl SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl # sha -SRCS+= sha1-x86_64.pl sha512-x86_64.pl +SRCS+= sha1-x86_64.pl # whrlpool SRCS+= wp-x86_64.pl -ASM= ${SRCS:S/.pl/.S/} -ASM+= sha256-x86_64.S x86_64cpuid.S +# cpuid +SRCS+= x86_64cpuid.pl -all: ${ASM} +SHA_ASM= sha256-x86_64 sha512-x86_64 +SHA_SRC= sha512-x86_64.pl +SHA_TMP= ${SHA_ASM:S/$/.s/} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.cmt/} ${SRCS:M*.pl:S/.pl$/.S/} -CLEANFILES+= sha256-x86_64.cmt sha256-x86_64.S x86_64cpuid.cmt x86_64cpuid.S -.SUFFIXES: .pl .cmt +ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/} -.pl.cmt: - ( cd `dirname ${.IMPSRC}`/.. ; perl ${.IMPSRC} ${.OBJDIR}/${.TARGET} ) +all: ${ASM} -.cmt.S: - ( echo ' # $$'FreeBSD'$$'; cat ${.IMPSRC} ) > ${.TARGET} +CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} +.SUFFIXES: .pl -sha256-x86_64.cmt: sha512-x86_64.pl - ( cd `dirname ${.ALLSRC}`/.. ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +.pl.S: + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET} -x86_64cpuid.cmt: x86_64cpuid.pl - ( cd `dirname ${.ALLSRC}` ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +${SHA_TMP}: ${SHA_SRC} + env CC=cc perl ${.ALLSRC} elf ${.TARGET} + +.for s in ${SHA_ASM} +${s}.S: ${s}.s + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + cat ${s}.s ) > ${.TARGET} +.endfor .elif ${MACHINE_CPUARCH} == "i386" @@ -126,16 +134,22 @@ SRCS+= wp-mmx.pl # cpuid SRCS+= x86cpuid.pl -ASM= ${SRCS:S/.pl/.s/} +ASM= ${SRCS:R:S/$/.S/} all: ${ASM} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.s/} +CLEANFILES= ${ASM} .SUFFIXES: .pl -.pl.s: - ( echo ' # $$'FreeBSD'$$' ;\ - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ) > ${.TARGET} +.pl.S: + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + echo '#ifdef PIC' ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ + echo '#else' ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ + echo '#endif') |\ + sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET} .endif .include Modified: stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S ============================================================================== --- stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/amd64/aes-x86_64.S Mon May 16 19:30:27 2016 (r299966) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aes-x86_64.pl. .text .type _x86_64_AES_encrypt,@function .align 16 Modified: stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S ============================================================================== --- stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon May 16 19:10:59 2016 (r299965) +++ stable/10/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon May 16 19:30:27 2016 (r299966) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. .text @@ -9,6 +10,11 @@ aesni_cbc_sha1_enc: movl OPENSSL_ia32cap_P+0(%rip),%r10d movl OPENSSL_ia32cap_P+4(%rip),%r11d + andl $268435456,%r11d + andl $1073741824,%r10d + orl %r11d,%r10d + cmpl $1342177280,%r10d + je aesni_cbc_sha1_enc_avx jmp aesni_cbc_sha1_enc_ssse3 .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc,.-aesni_cbc_sha1_enc @@ -1385,6 +1391,1343 @@ aesni_cbc_sha1_enc_ssse3: .Lepilogue_ssse3: .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc_ssse3,.-aesni_cbc_sha1_enc_ssse3 +.type aesni_cbc_sha1_enc_avx,@function +.align 16 +aesni_cbc_sha1_enc_avx: + movq 8(%rsp),%r10 + + + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + leaq -104(%rsp),%rsp + + + vzeroall + movq %rdi,%r12 + movq %rsi,%r13 + movq %rdx,%r14 + movq %rcx,%r15 + vmovdqu (%r8),%xmm11 + movq %r8,88(%rsp) + shlq $6,%r14 + subq %r12,%r13 + movl 240(%r15),%r8d + addq $112,%r15 + addq %r10,%r14 + + leaq K_XX_XX(%rip),%r11 + movl 0(%r9),%eax + movl 4(%r9),%ebx + movl 8(%r9),%ecx + movl 12(%r9),%edx + movl %ebx,%esi + movl 16(%r9),%ebp + + vmovdqa 64(%r11),%xmm6 + vmovdqa 0(%r11),%xmm9 + vmovdqu 0(%r10),%xmm0 + vmovdqu 16(%r10),%xmm1 + vmovdqu 32(%r10),%xmm2 + vmovdqu 48(%r10),%xmm3 + vpshufb %xmm6,%xmm0,%xmm0 + addq $64,%r10 + vpshufb %xmm6,%xmm1,%xmm1 + vpshufb %xmm6,%xmm2,%xmm2 + vpshufb %xmm6,%xmm3,%xmm3 + vpaddd %xmm9,%xmm0,%xmm4 + vpaddd %xmm9,%xmm1,%xmm5 + vpaddd %xmm9,%xmm2,%xmm6 + vmovdqa %xmm4,0(%rsp) + vmovdqa %xmm5,16(%rsp) + vmovdqa %xmm6,32(%rsp) + vmovups -112(%r15),%xmm13 + vmovups 16-112(%r15),%xmm14 + jmp .Loop_avx +.align 16 +.Loop_avx: + addl 0(%rsp),%ebp + vmovups 0(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + xorl %edx,%ecx + vpalignr $8,%xmm0,%xmm1,%xmm4 + movl %eax,%edi + shldl $5,%eax,%eax + vpaddd %xmm3,%xmm9,%xmm9 + andl %ecx,%esi + xorl %edx,%ecx + vpsrldq $4,%xmm3,%xmm8 + xorl %edx,%esi + addl %eax,%ebp + vpxor %xmm0,%xmm4,%xmm4 + shrdl $2,%ebx,%ebx + addl %esi,%ebp + vpxor %xmm2,%xmm8,%xmm8 + addl 4(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpxor %xmm8,%xmm4,%xmm4 + andl %ebx,%edi + xorl %ecx,%ebx + vmovdqa %xmm9,48(%rsp) + xorl %ecx,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + addl %ebp,%edx + vpsrld $31,%xmm4,%xmm8 + shrdl $7,%eax,%eax + addl %edi,%edx + addl 8(%rsp),%ecx + xorl %ebx,%eax + vpslldq $12,%xmm4,%xmm10 + vpaddd %xmm4,%xmm4,%xmm4 + movl %edx,%edi + shldl $5,%edx,%edx + andl %eax,%esi + xorl %ebx,%eax + vpsrld $30,%xmm10,%xmm9 + vpor %xmm8,%xmm4,%xmm4 + xorl %ebx,%esi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpslld $2,%xmm10,%xmm10 + vpxor %xmm9,%xmm4,%xmm4 + addl 12(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + shldl $5,%ecx,%ecx + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + vpxor %xmm10,%xmm4,%xmm4 + andl %ebp,%edi + xorl %eax,%ebp + vmovdqa 0(%r11),%xmm10 + xorl %eax,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + addl 16(%rsp),%eax + xorl %ebp,%edx + vpalignr $8,%xmm1,%xmm2,%xmm5 + movl %ebx,%edi + shldl $5,%ebx,%ebx + vpaddd %xmm4,%xmm10,%xmm10 + andl %edx,%esi + xorl %ebp,%edx + vpsrldq $4,%xmm4,%xmm9 + xorl %ebp,%esi + addl %ebx,%eax + vpxor %xmm1,%xmm5,%xmm5 + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpxor %xmm3,%xmm9,%xmm9 + addl 20(%rsp),%ebp + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + shldl $5,%eax,%eax + vpxor %xmm9,%xmm5,%xmm5 + andl %ecx,%edi + xorl %edx,%ecx + vmovdqa %xmm10,0(%rsp) + xorl %edx,%edi + addl %eax,%ebp + vpsrld $31,%xmm5,%xmm9 + shrdl $7,%ebx,%ebx + addl %edi,%ebp + addl 24(%rsp),%edx + xorl %ecx,%ebx + vpslldq $12,%xmm5,%xmm8 + vpaddd %xmm5,%xmm5,%xmm5 + movl %ebp,%edi + shldl $5,%ebp,%ebp + andl %ebx,%esi + xorl %ecx,%ebx + vpsrld $30,%xmm8,%xmm10 + vpor %xmm9,%xmm5,%xmm5 + xorl %ecx,%esi + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -16(%r15),%xmm15 + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %esi,%edx + vpslld $2,%xmm8,%xmm8 + vpxor %xmm10,%xmm5,%xmm5 + addl 28(%rsp),%ecx + xorl %ebx,%eax + movl %edx,%esi + shldl $5,%edx,%edx + vpxor %xmm8,%xmm5,%xmm5 + andl %eax,%edi + xorl %ebx,%eax + vmovdqa 16(%r11),%xmm8 + xorl %ebx,%edi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + addl 32(%rsp),%ebx + xorl %eax,%ebp + vpalignr $8,%xmm2,%xmm3,%xmm6 + movl %ecx,%edi + shldl $5,%ecx,%ecx + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 0(%r15),%xmm14 + vpaddd %xmm5,%xmm8,%xmm8 + andl %ebp,%esi + xorl %eax,%ebp + vpsrldq $4,%xmm5,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + vpxor %xmm2,%xmm6,%xmm6 + shrdl $7,%edx,%edx + addl %esi,%ebx + vpxor %xmm4,%xmm10,%xmm10 + addl 36(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + shldl $5,%ebx,%ebx + vpxor %xmm10,%xmm6,%xmm6 + andl %edx,%edi + xorl %ebp,%edx + vmovdqa %xmm8,16(%rsp) + xorl %ebp,%edi + addl %ebx,%eax + vpsrld $31,%xmm6,%xmm10 + shrdl $7,%ecx,%ecx + addl %edi,%eax + addl 40(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 16(%r15),%xmm15 + xorl %edx,%ecx + vpslldq $12,%xmm6,%xmm9 + vpaddd %xmm6,%xmm6,%xmm6 + movl %eax,%edi + shldl $5,%eax,%eax + andl %ecx,%esi + xorl %edx,%ecx + vpsrld $30,%xmm9,%xmm8 + vpor %xmm10,%xmm6,%xmm6 + xorl %edx,%esi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpslld $2,%xmm9,%xmm9 + vpxor %xmm8,%xmm6,%xmm6 + addl 44(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpxor %xmm9,%xmm6,%xmm6 + andl %ebx,%edi + xorl %ecx,%ebx + vmovdqa 16(%r11),%xmm9 + xorl %ecx,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 32(%r15),%xmm14 + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + addl 48(%rsp),%ecx + xorl %ebx,%eax + vpalignr $8,%xmm3,%xmm4,%xmm7 + movl %edx,%edi + shldl $5,%edx,%edx + vpaddd %xmm6,%xmm9,%xmm9 + andl %eax,%esi + xorl %ebx,%eax + vpsrldq $4,%xmm6,%xmm8 + xorl %ebx,%esi + addl %edx,%ecx + vpxor %xmm3,%xmm7,%xmm7 + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpxor %xmm5,%xmm8,%xmm8 + addl 52(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%esi + shldl $5,%ecx,%ecx + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 48(%r15),%xmm15 + vpxor %xmm8,%xmm7,%xmm7 + andl %ebp,%edi + xorl %eax,%ebp + vmovdqa %xmm9,32(%rsp) + xorl %eax,%edi + addl %ecx,%ebx + vpsrld $31,%xmm7,%xmm8 + shrdl $7,%edx,%edx + addl %edi,%ebx + addl 56(%rsp),%eax + xorl %ebp,%edx + vpslldq $12,%xmm7,%xmm10 + vpaddd %xmm7,%xmm7,%xmm7 + movl %ebx,%edi + shldl $5,%ebx,%ebx + andl %edx,%esi + xorl %ebp,%edx + vpsrld $30,%xmm10,%xmm9 + vpor %xmm8,%xmm7,%xmm7 + xorl %ebp,%esi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpslld $2,%xmm10,%xmm10 + vpxor %xmm9,%xmm7,%xmm7 + addl 60(%rsp),%ebp + cmpl $11,%r8d + jb .Lvaesenclast1 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 64(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 80(%r15),%xmm15 + je .Lvaesenclast1 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 96(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 112(%r15),%xmm15 +.Lvaesenclast1: + vaesenclast %xmm15,%xmm11,%xmm11 + vmovups 16-112(%r15),%xmm14 + xorl %edx,%ecx + movl %eax,%esi + shldl $5,%eax,%eax + vpxor %xmm10,%xmm7,%xmm7 + andl %ecx,%edi + xorl %edx,%ecx + vmovdqa 16(%r11),%xmm10 + xorl %edx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpalignr $8,%xmm6,%xmm7,%xmm9 + vpxor %xmm4,%xmm0,%xmm0 + addl 0(%rsp),%edx + xorl %ecx,%ebx + movl %ebp,%edi + shldl $5,%ebp,%ebp + vpxor %xmm1,%xmm0,%xmm0 + andl %ebx,%esi + xorl %ecx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm7,%xmm10,%xmm10 + xorl %ecx,%esi + vmovups 16(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vmovups %xmm11,0(%r13,%r12,1) + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + addl %ebp,%edx + vpxor %xmm9,%xmm0,%xmm0 + shrdl $7,%eax,%eax + addl %esi,%edx + addl 4(%rsp),%ecx + xorl %ebx,%eax + vpsrld $30,%xmm0,%xmm9 + vmovdqa %xmm10,48(%rsp) + movl %edx,%esi + shldl $5,%edx,%edx + andl %eax,%edi + xorl %ebx,%eax + vpslld $2,%xmm0,%xmm0 + xorl %ebx,%edi + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + addl 8(%rsp),%ebx + xorl %eax,%ebp + movl %ecx,%edi + shldl $5,%ecx,%ecx + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + vpor %xmm9,%xmm0,%xmm0 + andl %ebp,%esi + xorl %eax,%ebp + vmovdqa %xmm0,%xmm10 + xorl %eax,%esi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %esi,%ebx + addl 12(%rsp),%eax + xorl %ebp,%edx + movl %ebx,%esi + shldl $5,%ebx,%ebx + andl %edx,%edi + xorl %ebp,%edx + xorl %ebp,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpalignr $8,%xmm7,%xmm0,%xmm10 + vpxor %xmm5,%xmm1,%xmm1 + addl 16(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + shldl $5,%eax,%eax + vpxor %xmm2,%xmm1,%xmm1 + xorl %ecx,%esi + addl %eax,%ebp + vmovdqa %xmm8,%xmm9 + vpaddd %xmm0,%xmm8,%xmm8 + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpxor %xmm10,%xmm1,%xmm1 + addl 20(%rsp),%edx + xorl %ecx,%edi + movl %ebp,%esi + shldl $5,%ebp,%ebp + vpsrld $30,%xmm1,%xmm10 + vmovdqa %xmm8,0(%rsp) + xorl %ebx,%edi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + vpslld $2,%xmm1,%xmm1 + addl 24(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + shldl $5,%edx,%edx + xorl %eax,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpor %xmm10,%xmm1,%xmm1 + addl 28(%rsp),%ebx + xorl %eax,%edi + vmovdqa %xmm1,%xmm8 + movl %ecx,%esi + shldl $5,%ecx,%ecx + xorl %ebp,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + vpalignr $8,%xmm0,%xmm1,%xmm8 + vpxor %xmm6,%xmm2,%xmm2 + addl 32(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + shldl $5,%ebx,%ebx + vpxor %xmm3,%xmm2,%xmm2 + xorl %edx,%esi + addl %ebx,%eax + vmovdqa 32(%r11),%xmm10 + vpaddd %xmm1,%xmm9,%xmm9 + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpxor %xmm8,%xmm2,%xmm2 + addl 36(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -16(%r15),%xmm15 + xorl %edx,%edi + movl %eax,%esi + shldl $5,%eax,%eax + vpsrld $30,%xmm2,%xmm8 + vmovdqa %xmm9,16(%rsp) + xorl %ecx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpslld $2,%xmm2,%xmm2 + addl 40(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + shldl $5,%ebp,%ebp + xorl %ebx,%esi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %esi,%edx + vpor %xmm8,%xmm2,%xmm2 + addl 44(%rsp),%ecx + xorl %ebx,%edi + vmovdqa %xmm2,%xmm9 + movl %edx,%esi + shldl $5,%edx,%edx + xorl %eax,%edi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 0(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + vpalignr $8,%xmm1,%xmm2,%xmm9 + vpxor %xmm7,%xmm3,%xmm3 + addl 48(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + shldl $5,%ecx,%ecx + vpxor %xmm4,%xmm3,%xmm3 + xorl %ebp,%esi + addl %ecx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm2,%xmm10,%xmm10 + shrdl $7,%edx,%edx + addl %esi,%ebx + vpxor %xmm9,%xmm3,%xmm3 + addl 52(%rsp),%eax + xorl %ebp,%edi + movl %ebx,%esi + shldl $5,%ebx,%ebx + vpsrld $30,%xmm3,%xmm9 + vmovdqa %xmm10,32(%rsp) + xorl %edx,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpslld $2,%xmm3,%xmm3 + addl 56(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 16(%r15),%xmm15 + xorl %edx,%esi + movl %eax,%edi + shldl $5,%eax,%eax + xorl %ecx,%esi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %esi,%ebp + vpor %xmm9,%xmm3,%xmm3 + addl 60(%rsp),%edx + xorl %ecx,%edi + vmovdqa %xmm3,%xmm10 + movl %ebp,%esi + shldl $5,%ebp,%ebp + xorl %ebx,%edi + addl %ebp,%edx + shrdl $7,%eax,%eax + addl %edi,%edx + vpalignr $8,%xmm2,%xmm3,%xmm10 + vpxor %xmm0,%xmm4,%xmm4 + addl 0(%rsp),%ecx + xorl %ebx,%esi + movl %edx,%edi + shldl $5,%edx,%edx + vpxor %xmm5,%xmm4,%xmm4 + xorl %eax,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 32(%r15),%xmm14 + addl %edx,%ecx + vmovdqa %xmm8,%xmm9 + vpaddd %xmm3,%xmm8,%xmm8 + shrdl $7,%ebp,%ebp + addl %esi,%ecx + vpxor %xmm10,%xmm4,%xmm4 + addl 4(%rsp),%ebx + xorl %eax,%edi + movl %ecx,%esi + shldl $5,%ecx,%ecx + vpsrld $30,%xmm4,%xmm10 + vmovdqa %xmm8,48(%rsp) + xorl %ebp,%edi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %edi,%ebx + vpslld $2,%xmm4,%xmm4 + addl 8(%rsp),%eax + xorl %ebp,%esi + movl %ebx,%edi + shldl $5,%ebx,%ebx + xorl %edx,%esi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %esi,%eax + vpor %xmm10,%xmm4,%xmm4 + addl 12(%rsp),%ebp + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 48(%r15),%xmm15 + xorl %edx,%edi + vmovdqa %xmm4,%xmm8 + movl %eax,%esi + shldl $5,%eax,%eax + xorl %ecx,%edi + addl %eax,%ebp + shrdl $7,%ebx,%ebx + addl %edi,%ebp + vpalignr $8,%xmm3,%xmm4,%xmm8 + vpxor %xmm1,%xmm5,%xmm5 + addl 16(%rsp),%edx + xorl %ecx,%esi + movl %ebp,%edi + shldl $5,%ebp,%ebp + vpxor %xmm6,%xmm5,%xmm5 + xorl %ebx,%esi + addl %ebp,%edx + vmovdqa %xmm9,%xmm10 + vpaddd %xmm4,%xmm9,%xmm9 + shrdl $7,%eax,%eax + addl %esi,%edx + vpxor %xmm8,%xmm5,%xmm5 + addl 20(%rsp),%ecx + xorl %ebx,%edi + movl %edx,%esi + shldl $5,%edx,%edx + vpsrld $30,%xmm5,%xmm8 + vmovdqa %xmm9,0(%rsp) + xorl %eax,%edi + cmpl $11,%r8d + jb .Lvaesenclast2 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 64(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 80(%r15),%xmm15 + je .Lvaesenclast2 + vaesenc %xmm15,%xmm11,%xmm11 + vmovups 96(%r15),%xmm14 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups 112(%r15),%xmm15 +.Lvaesenclast2: + vaesenclast %xmm15,%xmm11,%xmm11 + vmovups 16-112(%r15),%xmm14 + addl %edx,%ecx + shrdl $7,%ebp,%ebp + addl %edi,%ecx + vpslld $2,%xmm5,%xmm5 + addl 24(%rsp),%ebx + xorl %eax,%esi + movl %ecx,%edi + shldl $5,%ecx,%ecx + xorl %ebp,%esi + addl %ecx,%ebx + shrdl $7,%edx,%edx + addl %esi,%ebx + vpor %xmm8,%xmm5,%xmm5 + addl 28(%rsp),%eax + xorl %ebp,%edi + vmovdqa %xmm5,%xmm9 + movl %ebx,%esi + shldl $5,%ebx,%ebx + xorl %edx,%edi + addl %ebx,%eax + shrdl $7,%ecx,%ecx + addl %edi,%eax + vpalignr $8,%xmm4,%xmm5,%xmm9 + vpxor %xmm2,%xmm6,%xmm6 + movl %ecx,%edi + vmovups 32(%r12),%xmm12 + vxorps %xmm13,%xmm12,%xmm12 + vmovups %xmm11,16(%r13,%r12,1) + vxorps %xmm12,%xmm11,%xmm11 + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -80(%r15),%xmm15 + xorl %edx,%ecx + addl 32(%rsp),%ebp + andl %edx,%edi + vpxor %xmm7,%xmm6,%xmm6 + andl %ecx,%esi + shrdl $7,%ebx,%ebx + vmovdqa %xmm10,%xmm8 + vpaddd %xmm5,%xmm10,%xmm10 + addl %edi,%ebp + movl %eax,%edi + vpxor %xmm9,%xmm6,%xmm6 + shldl $5,%eax,%eax + addl %esi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + vpsrld $30,%xmm6,%xmm9 + vmovdqa %xmm10,16(%rsp) + movl %ebx,%esi + xorl %ecx,%ebx + addl 36(%rsp),%edx + andl %ecx,%esi + vpslld $2,%xmm6,%xmm6 + andl %ebx,%edi + shrdl $7,%eax,%eax + addl %esi,%edx + movl %ebp,%esi + shldl $5,%ebp,%ebp + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -64(%r15),%xmm14 + addl %edi,%edx + xorl %ecx,%ebx + addl %ebp,%edx + vpor %xmm9,%xmm6,%xmm6 + movl %eax,%edi + xorl %ebx,%eax + vmovdqa %xmm6,%xmm10 + addl 40(%rsp),%ecx + andl %ebx,%edi + andl %eax,%esi + shrdl $7,%ebp,%ebp + addl %edi,%ecx + movl %edx,%edi + shldl $5,%edx,%edx + addl %esi,%ecx + xorl %ebx,%eax + addl %edx,%ecx + movl %ebp,%esi + xorl %eax,%ebp + addl 44(%rsp),%ebx + andl %eax,%esi + andl %ebp,%edi + vaesenc %xmm14,%xmm11,%xmm11 + vmovups -48(%r15),%xmm15 + shrdl $7,%edx,%edx + addl %esi,%ebx + movl %ecx,%esi + shldl $5,%ecx,%ecx + addl %edi,%ebx + xorl %eax,%ebp + addl %ecx,%ebx + vpalignr $8,%xmm5,%xmm6,%xmm10 + vpxor %xmm3,%xmm7,%xmm7 + movl %edx,%edi + xorl %ebp,%edx + addl 48(%rsp),%eax + andl %ebp,%edi + vpxor %xmm0,%xmm7,%xmm7 + andl %edx,%esi + shrdl $7,%ecx,%ecx + vmovdqa 48(%r11),%xmm9 + vpaddd %xmm6,%xmm8,%xmm8 + addl %edi,%eax + movl %ebx,%edi + vpxor %xmm10,%xmm7,%xmm7 + shldl $5,%ebx,%ebx + addl %esi,%eax + xorl %ebp,%edx + addl %ebx,%eax + vpsrld $30,%xmm7,%xmm10 + vmovdqa %xmm8,32(%rsp) + movl %ecx,%esi + vaesenc %xmm15,%xmm11,%xmm11 + vmovups -32(%r15),%xmm14 + xorl %edx,%ecx + addl 52(%rsp),%ebp + andl %edx,%esi + vpslld $2,%xmm7,%xmm7 + andl %ecx,%edi + shrdl $7,%ebx,%ebx + addl %esi,%ebp + movl %eax,%esi + shldl $5,%eax,%eax + addl %edi,%ebp + xorl %edx,%ecx + addl %eax,%ebp + vpor %xmm10,%xmm7,%xmm7 + movl %ebx,%edi + xorl %ecx,%ebx + vmovdqa %xmm7,%xmm8 + addl 56(%rsp),%edx + andl %ecx,%edi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon May 16 19:32:39 2016 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 B646DB3E253; Mon, 16 May 2016 19:32:39 +0000 (UTC) (envelope-from slm@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 92AD01BA6; Mon, 16 May 2016 19:32:39 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GJWcOS009818; Mon, 16 May 2016 19:32:38 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GJWcTO009817; Mon, 16 May 2016 19:32:38 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605161932.u4GJWcTO009817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 16 May 2016 19:32: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: r299967 - stable/10/share/man/man4 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.22 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, 16 May 2016 19:32:39 -0000 Author: slm Date: Mon May 16 19:32:38 2016 New Revision: 299967 URL: https://svnweb.freebsd.org/changeset/base/299967 Log: MFC r299276 Updates to mpr driver man page. - Add 3216 and 3224 support. - Add SSU, chain_alloc_fail, and spinup_wait_time information. - Clear up some sentences. - Correct some typos. Modified: stable/10/share/man/man4/mpr.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mpr.4 ============================================================================== --- stable/10/share/man/man4/mpr.4 Mon May 16 19:30:27 2016 (r299966) +++ stable/10/share/man/man4/mpr.4 Mon May 16 19:32:38 2016 (r299967) @@ -1,6 +1,8 @@ .\" .\" Copyright (c) 2010 Spectra Logic Corporation .\" Copyright (c) 2014 LSI Corp +.\" Copyright (c) 2016 Avago Technologies +.\" Copyright (c) 2016 Broadcom Ltd. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,55 +33,62 @@ .\" mpr driver man page. .\" .\" Author: Ken Merry -.\" Author: Stephen McConnell +.\" Author: Stephen McConnell .\" .\" $Id$ .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd April 29, 2016 .Dt MPR 4 .Os .Sh NAME .Nm mpr .Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver" .Sh SYNOPSIS -To compile this driver into the kernel, place the following lines in your -kernel configuration file: +To compile this driver into the kernel, place these lines in the kernel +configuration file: .Bd -ragged -offset indent .Cd "device pci" .Cd "device scbus" .Cd "device mpr" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +The driver can be loaded as a module at boot time by placing this line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" .Ed .Sh DESCRIPTION The -.Nm -driver provides support for LSI Fusion-MPT 3 IT/IR +.Nm +driver provides support for Broadcom Ltd./Avago Tech (LSI) +Fusion-MPT 3 IT/IR .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +These controllers are supported by the .Nm driver: .Pp .Bl -bullet -compact .It -LSI SAS 3004 (4 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS) .It -LSI SAS 3008 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS) .It -LSI SAS 3108 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS) .El .Sh CONFIGURATION +.Pp +In all tunable descriptions below, X represents the adapter number. +.Pp To disable MSI interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msi=1 @@ -87,17 +96,15 @@ hw.mpr.disable_msi=1 .Pp To disable MSI interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msi=1 .Ed .Pp -where X is the adapter number. -.Pp To disable MSI-X interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msix=1 @@ -105,73 +112,134 @@ hw.mpr.disable_msix=1 .Pp To disable MSI-X interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msix=1 .Ed .Pp To set the maximum number of DMA chains allocated for all adapters, set -the following variable in +this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.max_chains=NNNN .Ed .Pp To set the maximum number of DMA chains allocated for a specific adapter, -set the following variable in +set this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.max_chains=NNNN .Ed .Pp -This variable may also be viewed via -.Xr sysctl 8 -to see the maximum set for a given adapter. +The default max_chains value is 2048. .Pp -The current number of free chain frames may be seen via the +The current number of free chain frames is stored in the dev.mpr.X.chain_free .Xr sysctl 8 variable. .Pp -The lowest number of free chain frames may be seen via the +The lowest number of free chain frames seen since boot is stored in the dev.mpr.X.chain_free_lowwater .Xr sysctl 8 variable. .Pp +The number of times that chain frame allocations have failed since boot is +stored in the +dev.mpr.X.chain_alloc_fail +.Xr sysctl 8 +variable. +This can be used to determine whether the max_chains tunable should be +increased to help performance. +.Pp The current number of active I/O commands is shown in the dev.mpr.X.io_cmds_active .Xr sysctl 8 variable. .Pp -The maximum number of active I/O commands seen since boot is shown in the +The highest number of active I/O commands seen since boot is stored in the dev.mpr.X.io_cmds_highwater .Xr sysctl 8 variable. .Pp Devices can be excluded from .Nm -control for all adapters by setting the following variable in +control for all adapters by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. -If more than one device is to be -excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. .Pp Devices can be excluded from .Nm -control for a specific adapter by setting the following variable in +control for a specific adapter by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. -If more -than one device is to be excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. +.Pp +The adapter can issue the +.Sy StartStopUnit +SCSI command to SATA direct-access devices during shutdown. +This allows the device to quiesce powering down. +To control this feature for all adapters, set the +.Bd -literal -offset indent +hw.mpr.enable_ssu +.Ed +.Pp +tunable in +.Xr loader.conf 5 +to one of these values: +.Bl -tag -width 6n -offset indent +.It 0 +Do not send SSU to either HDDs or SSDs. +.It 1 +Send SSU to SSDs, but not to HDDs. +This is the default value. +.It 2 +Send SSU to HDDs, but not to SSDs. +.It 3 +Send SSU to both HDDs and SSDs. +.El +.Pp +To control the feature for a specific adapter, set this tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.enable_ssu +.Ed +.Pp +The same set of values are valid when setting this tunable for all adapters. +.Pp +SATA disks that take several seconds to spin up and fail the SATA Identify +command might not be discovered by the driver. +This problem can sometimes be overcome by increasing the value of the spinup +wait time in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +hw.mpr.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN represents the number of seconds to wait for SATA devices to spin up when +the device fails the initial SATA Identify command. +.Pp +Spinup wait times can be set for specific adapters in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +dev.mpr.X.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN is the number of seconds to wait for SATA devices to spin up when they fail +the initial SATA Identify command. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -180,21 +248,21 @@ driver, set the hw.mpr.X.debug_level .Ed .Pp -variable, where X is the adapter number, either in +tunable, either in .Xr loader.conf 5 -or via +or by using .Xr sysctl 8 . -The following bits have the described effects: +These bits have the described effects: .Bd -literal -offset indent -0x0001 Enable informational prints. -0x0002 Enable prints for driver faults. +0x0001 Enable informational prints (set by default). +0x0002 Enable prints for driver faults (set by default). 0x0004 Enable prints for controller events. 0x0008 Enable prints for controller logging. 0x0010 Enable prints for tracing recovery operations. 0x0020 Enable prints for parameter errors and programming bugs. 0x0040 Enable prints for system initialization operations. 0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands. +0x0100 Enable prints for user-generated commands (IOCTL). 0x0200 Enable prints for device mapping. 0x0400 Enable prints for tracing through driver functions. .Ed @@ -220,10 +288,11 @@ The .Nm driver was originally written by .An -nosplit -.An Scott Long Aq scottl@FreeBSD.org . -It has been improved and tested by LSI Corporation. +.An Scott Long Aq Mt scottl@FreeBSD.org . +It has been improved and tested by LSI Corporation, +Avago Technologies (formally LSI), and Broadcom Ltd. (formally Avago). .Pp This man page was written by -.An Ken Merry Aq ken@FreeBSD.org +.An Ken Merry Aq Mt ken@FreeBSD.org with additional input from -.An Stephen McConnell Aq stephen.mcconnell@lsi.com . +.An Stephen McConnell Aq Mt slm@FreeBSD.org . From owner-svn-src-stable-10@freebsd.org Mon May 16 22:42:10 2016 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 DEAC9B3D94E; Mon, 16 May 2016 22:42:10 +0000 (UTC) (envelope-from jkim@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 9A4621A18; Mon, 16 May 2016 22:42:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4GMg9I9071932; Mon, 16 May 2016 22:42:09 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4GMg9AO071928; Mon, 16 May 2016 22:42:09 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605162242.u4GMg9AO071928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 16 May 2016 22:42:09 +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: r299983 - in stable/10: crypto/openssl/crypto crypto/openssl/crypto/perlasm secure/lib/libcrypto/i386 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.22 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, 16 May 2016 22:42:11 -0000 Author: jkim Date: Mon May 16 22:42:09 2016 New Revision: 299983 URL: https://svnweb.freebsd.org/changeset/base/299983 Log: Hide OPENSSL_cpuid_setup and OPENSSL_ia32cap_P symbols from libcrypto.so. Note this is a direct commit because it is merged from OpenSSL upstream and head (OpenSSL 1.0.2 branch) already has the same change: https://github.com/openssl/openssl/commit/6206682 Modified: stable/10/crypto/openssl/crypto/perlasm/x86asm.pl stable/10/crypto/openssl/crypto/perlasm/x86gas.pl stable/10/crypto/openssl/crypto/x86cpuid.pl stable/10/secure/lib/libcrypto/i386/x86cpuid.S Modified: stable/10/crypto/openssl/crypto/perlasm/x86asm.pl ============================================================================== --- stable/10/crypto/openssl/crypto/perlasm/x86asm.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/perlasm/x86asm.pl Mon May 16 22:42:09 2016 (r299983) @@ -257,4 +257,6 @@ EOF &file($filename); } +sub ::hidden {} + 1; Modified: stable/10/crypto/openssl/crypto/perlasm/x86gas.pl ============================================================================== --- stable/10/crypto/openssl/crypto/perlasm/x86gas.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/perlasm/x86gas.pl Mon May 16 22:42:09 2016 (r299983) @@ -250,4 +250,6 @@ ___ sub ::dataseg { push(@out,".data\n"); } +*::hidden = sub { push(@out,".hidden\t$nmdecor$_[0]\n"); } if ($::elf); + 1; Modified: stable/10/crypto/openssl/crypto/x86cpuid.pl ============================================================================== --- stable/10/crypto/openssl/crypto/x86cpuid.pl Mon May 16 22:39:17 2016 (r299982) +++ stable/10/crypto/openssl/crypto/x86cpuid.pl Mon May 16 22:42:09 2016 (r299983) @@ -355,4 +355,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA3 &initseg("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_cpuid_setup"); +&hidden("OPENSSL_ia32cap_P"); + &asm_finish(); Modified: stable/10/secure/lib/libcrypto/i386/x86cpuid.S ============================================================================== --- stable/10/secure/lib/libcrypto/i386/x86cpuid.S Mon May 16 22:39:17 2016 (r299982) +++ stable/10/secure/lib/libcrypto/i386/x86cpuid.S Mon May 16 22:42:09 2016 (r299983) @@ -344,6 +344,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup @@ -679,6 +681,8 @@ OPENSSL_ia32_rdrand: cmovel %ecx,%eax ret .size OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin +.hidden OPENSSL_cpuid_setup +.hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 .section .init call OPENSSL_cpuid_setup From owner-svn-src-stable-10@freebsd.org Tue May 17 04:53:23 2016 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 17081B3E237; Tue, 17 May 2016 04:53:23 +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 E2F461F9D; Tue, 17 May 2016 04:53:22 +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 u4H4rMp3088069; Tue, 17 May 2016 04:53:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H4rME4088068; Tue, 17 May 2016 04:53:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605170453.u4H4rME4088068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 17 May 2016 04:53:22 +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: r300004 - stable/10/sys/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.22 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, 17 May 2016 04:53:23 -0000 Author: sephe Date: Tue May 17 04:53:21 2016 New Revision: 300004 URL: https://svnweb.freebsd.org/changeset/base/300004 Log: MFC r298769, r299315 r298769 ============= tcp/syncache: Set flowid and hash type properly for SYN|ACK So the underlying drivers can use it to select the sending queue properly for SYN|ACK instead of rolling their own hash. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6120 r299315 ============= tcp/syncache: Add comment for syncache_respond Suggested by: hiren, hps Reviewed by: sbruno Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6148 Modified: stable/10/sys/netinet/tcp_syncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Tue May 17 04:40:00 2016 (r300003) +++ stable/10/sys/netinet/tcp_syncache.c Tue May 17 04:53:21 2016 (r300004) @@ -124,7 +124,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *); +static int syncache_respond(struct syncache *, const struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); @@ -480,7 +480,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - (void) syncache_respond(sc); + (void) syncache_respond(sc, NULL); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1307,7 +1307,7 @@ syncache_add(struct in_conninfo *inc, st s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, m) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1476,7 +1476,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, m) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1506,8 +1506,12 @@ tfo_done: return (rv); } +/* + * Send SYN|ACK to the peer. Either in response to the peer's SYN, + * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. + */ static int -syncache_respond(struct syncache *sc) +syncache_respond(struct syncache *sc, const struct mbuf *m0) { struct ip *ip = NULL; struct mbuf *m; @@ -1664,6 +1668,15 @@ syncache_respond(struct syncache *sc) M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + /* + * If we have peer's SYN and it has a flowid, then let's assign it to + * our SYN|ACK. ip6_output() and ip_output() will not assign flowid + * to SYN|ACK due to lack of inp here. + */ + if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + } #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; From owner-svn-src-stable-10@freebsd.org Tue May 17 07:55:50 2016 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 D3B49B3EB02; Tue, 17 May 2016 07:55: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 A57E01464; Tue, 17 May 2016 07:55: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 u4H7tnep043506; Tue, 17 May 2016 07:55:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H7tn7K043505; Tue, 17 May 2016 07:55:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605170755.u4H7tn7K043505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 May 2016 07:55: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: r300023 - stable/10/sys/amd64/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.22 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, 17 May 2016 07:55:50 -0000 Author: kib Date: Tue May 17 07:55:49 2016 New Revision: 300023 URL: https://svnweb.freebsd.org/changeset/base/300023 Log: MFC r299350: Add locking annotations to amd64 struct md_page members. Modified: stable/10/sys/amd64/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/pmap.h ============================================================================== --- stable/10/sys/amd64/include/pmap.h Tue May 17 07:54:53 2016 (r300022) +++ stable/10/sys/amd64/include/pmap.h Tue May 17 07:55:49 2016 (r300023) @@ -280,9 +280,13 @@ extern pt_entry_t pg_nx; struct pv_entry; struct pv_chunk; +/* + * Locks + * (p) PV list lock + */ struct md_page { - TAILQ_HEAD(,pv_entry) pv_list; - int pv_gen; + TAILQ_HEAD(, pv_entry) pv_list; /* (p) */ + int pv_gen; /* (p) */ int pat_mode; }; From owner-svn-src-stable-10@freebsd.org Tue May 17 08:20:11 2016 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 7ABF0B3E812; Tue, 17 May 2016 08:20:11 +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 55C2E1B78; Tue, 17 May 2016 08:20:11 +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 u4H8KA4Q050069; Tue, 17 May 2016 08:20:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8KAQ8050064; Tue, 17 May 2016 08:20:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170820.u4H8KAQ8050064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:20:10 +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: r300028 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/sys/fs 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.22 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, 17 May 2016 08:20:11 -0000 Author: avg Date: Tue May 17 08:20:10 2016 New Revision: 300028 URL: https://svnweb.freebsd.org/changeset/base/300028 Log: MFC r298472: MFV r298471: 6052 decouple lzc_create() from the implementation details Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue May 17 08:20:10 2016 (r300028) @@ -3220,7 +3220,7 @@ zfs_create(libzfs_handle_t *hdl, const c uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; - dmu_objset_type_t ost; + enum lzc_dataset_type ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -3247,9 +3247,9 @@ zfs_create(libzfs_handle_t *hdl, const c } if (type == ZFS_TYPE_VOLUME) - ost = DMU_OST_ZVOL; + ost = LZC_DATSET_TYPE_ZVOL; else - ost = DMU_OST_ZFS; + ost = LZC_DATSET_TYPE_ZFS; /* open zpool handle for prop validation */ char pool_path[MAXNAMELEN]; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue May 17 08:20:10 2016 (r300028) @@ -218,11 +218,11 @@ out: } int -lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props) +lzc_create(const char *fsname, enum lzc_dataset_type type, nvlist_t *props) { int error; nvlist_t *args = fnvlist_alloc(); - fnvlist_add_int32(args, "type", type); + fnvlist_add_int32(args, "type", (dmu_objset_type_t)type); if (props != NULL) fnvlist_add_nvlist(args, "props", props); error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 08:19:20 2016 (r300027) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue May 17 08:20:10 2016 (r300028) @@ -30,7 +30,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -39,8 +38,16 @@ extern "C" { int libzfs_core_init(void); void libzfs_core_fini(void); +/* + * NB: this type should be kept binary compatible with dmu_objset_type_t. + */ +enum lzc_dataset_type { + LZC_DATSET_TYPE_ZFS = 2, + LZC_DATSET_TYPE_ZVOL +}; + int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **); -int lzc_create(const char *, dmu_objset_type_t, nvlist_t *); +int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *); int lzc_clone(const char *, const char *, nvlist_t *); int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **); int lzc_bookmark(nvlist_t *, nvlist_t **); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 08:19:20 2016 (r300027) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 17 08:20:10 2016 (r300028) @@ -57,6 +57,10 @@ typedef enum { ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; +/* + * NB: lzc_dataset_type should be updated whenever a new objset type is added, + * if it represents a real type of a dataset that can be created from userland. + */ typedef enum dmu_objset_type { DMU_OST_NONE, DMU_OST_META, From owner-svn-src-stable-10@freebsd.org Tue May 17 08:24:08 2016 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 035BFB3EA29; Tue, 17 May 2016 08:24:08 +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 C7AC71047; Tue, 17 May 2016 08:24:07 +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 u4H8O6O1052850; Tue, 17 May 2016 08:24:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8O6WX052849; Tue, 17 May 2016 08:24:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170824.u4H8O6WX052849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:24: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: r300029 - stable/10/sys/cddl/dev/dtrace/x86 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.22 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, 17 May 2016 08:24:08 -0000 Author: avg Date: Tue May 17 08:24:06 2016 New Revision: 300029 URL: https://svnweb.freebsd.org/changeset/base/300029 Log: MFC r298473,298787: add invpcid, fix sahf/lahf in dtrace disassembler Modified: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:20:10 2016 (r300028) +++ stable/10/sys/cddl/dev/dtrace/x86/dis_tables.c Tue May 17 08:24:06 2016 (r300029) @@ -1182,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),TNSy("invpcid", RM_66r),INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, @@ -1931,7 +1931,7 @@ const instable_t dis_distable[16][16] = /* [9,0] */ TNS("nop",NORM), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,4] */ TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), TS("xchg",RA), /* [9,8] */ TNS("cXtX",CBW), TNS("cXtX",CWD), TNSx("lcall",SO), TNS("fwait",NORM), -/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNSx("sahf",NORM), TNSx("lahf",NORM), +/* [9,C] */ TSZy("pushf",IMPLMEM,4),TSZy("popf",IMPLMEM,4), TNS("sahf",NORM), TNS("lahf",NORM), }, { /* [A,0] */ TNS("movb",OA), TS("mov",OA), TNS("movb",AO), TS("mov",AO), /* [A,4] */ TNSZ("movsb",SD,1), TS("movs",SD), TNSZ("cmpsb",SD,1), TS("cmps",SD), From owner-svn-src-stable-10@freebsd.org Tue May 17 08:31:48 2016 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 21BBFB3ED42; Tue, 17 May 2016 08:31: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 E6CDE1BE9; Tue, 17 May 2016 08:31: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 u4H8VlHX055478; Tue, 17 May 2016 08:31:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8VlHi055477; Tue, 17 May 2016 08:31:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170831.u4H8VlHi055477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:31: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: r300034 - 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.22 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, 17 May 2016 08:31:48 -0000 Author: avg Date: Tue May 17 08:31:46 2016 New Revision: 300034 URL: https://svnweb.freebsd.org/changeset/base/300034 Log: MFC r298106: zfs_rezget: z_vnode can not be NULL if zp is valid Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:30:22 2016 (r300033) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue May 17 08:31:46 2016 (r300034) @@ -1341,7 +1341,7 @@ zfs_rezget(znode_t *zp) * recycled when the last vnode reference is dropped. */ vp = ZTOV(zp); - if (vp != NULL && vp->v_type != IFTOVT((mode_t)zp->z_mode)) { + if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); return (EIO); @@ -1349,11 +1349,9 @@ zfs_rezget(znode_t *zp) zp->z_unlinked = (zp->z_links == 0); zp->z_blksz = doi.doi_data_block_size; - if (vp != NULL) { - vn_pages_remove(vp, 0, 0); - if (zp->z_size != size) - vnode_pager_setsize(vp, zp->z_size); - } + vn_pages_remove(vp, 0, 0); + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); From owner-svn-src-stable-10@freebsd.org Tue May 17 08:33:41 2016 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 DD433B3EFD4; Tue, 17 May 2016 08:33:41 +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 AE7BD1015; Tue, 17 May 2016 08:33:41 +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 u4H8Xe3t056295; Tue, 17 May 2016 08:33:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8XeAd056294; Tue, 17 May 2016 08:33:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170833.u4H8XeAd056294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:33:40 +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: r300036 - stable/10/sys/amd64/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.22 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, 17 May 2016 08:33:42 -0000 Author: avg Date: Tue May 17 08:33:40 2016 New Revision: 300036 URL: https://svnweb.freebsd.org/changeset/base/300036 Log: MFC r298736: ensure that initial local apic id is sane on AMD 10h systems Modified: stable/10/sys/amd64/amd64/initcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:31:54 2016 (r300035) +++ stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:33:40 2016 (r300036) @@ -111,6 +111,19 @@ init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } + + /* + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG. + * So, do it here or otherwise some tools could be confused by + * Initial Local APIC ID reported with CPUID Function 1 in EBX. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(MSR_NB_CFG1); + msr |= (uint64_t)1 << 54; + wrmsr(MSR_NB_CFG1, msr); + } + } } /* From owner-svn-src-stable-10@freebsd.org Tue May 17 08:36:55 2016 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 D4DC8B3D209; Tue, 17 May 2016 08:36:55 +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 A106B1369; Tue, 17 May 2016 08:36:55 +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 u4H8askp056511; Tue, 17 May 2016 08:36:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8asAf056510; Tue, 17 May 2016 08:36:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170836.u4H8asAf056510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:36:54 +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: r300038 - stable/10/sys/amd64/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.22 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, 17 May 2016 08:36:55 -0000 Author: avg Date: Tue May 17 08:36:54 2016 New Revision: 300038 URL: https://svnweb.freebsd.org/changeset/base/300038 Log: MFC r298737: fix up r300036 Modified: stable/10/sys/amd64/amd64/initcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:36:12 2016 (r300037) +++ stable/10/sys/amd64/amd64/initcpu.c Tue May 17 08:36:54 2016 (r300038) @@ -89,6 +89,7 @@ SYSCTL_UINT(_hw, OID_AUTO, via_feature_x static void init_amd(void) { + uint64_t msr; /* * Work around Erratum 721 for Family 10h and 12h processors. From owner-svn-src-stable-10@freebsd.org Tue May 17 08:43:51 2016 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 A4FFBB3D4C0; Tue, 17 May 2016 08:43:51 +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 70F9319FF; Tue, 17 May 2016 08:43:51 +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 u4H8hoh6059412; Tue, 17 May 2016 08:43:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H8hosF059410; Tue, 17 May 2016 08:43:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201605170843.u4H8hosF059410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 May 2016 08:43:50 +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: r300039 - 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.22 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, 17 May 2016 08:43:51 -0000 Author: avg Date: Tue May 17 08:43:50 2016 New Revision: 300039 URL: https://svnweb.freebsd.org/changeset/base/300039 Log: MFC r297848: l2arc: make sure that all writes honor ashift of a cache device Note: no MFC stable/9 because it has become quite out of date with head, so the merge would be quite labourious and, thus, risky. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.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 May 17 08:36:54 2016 (r300038) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue May 17 08:43:50 2016 (r300039) @@ -565,6 +565,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_compress_successes; kstat_named_t arcstat_l2_compress_zeros; kstat_named_t arcstat_l2_compress_failures; + 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; @@ -666,6 +667,7 @@ static arc_stats_t arc_stats = { { "l2_compress_successes", KSTAT_DATA_UINT64 }, { "l2_compress_zeros", KSTAT_DATA_UINT64 }, { "l2_compress_failures", 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 }, @@ -839,7 +841,7 @@ typedef struct l1arc_buf_hdr { refcount_t b_refcnt; arc_callback_t *b_acb; - /* temporary buffer holder for in-flight compressed data */ + /* temporary buffer holder for in-flight compressed or padded data */ void *b_tmp_cdata; } l1arc_buf_hdr_t; @@ -1100,6 +1102,7 @@ typedef struct l2arc_read_callback { zbookmark_phys_t l2rcb_zb; /* original bookmark */ int l2rcb_flags; /* original flags */ enum zio_compress l2rcb_compress; /* applied compress */ + void *l2rcb_data; /* temporary buffer */ } l2arc_read_callback_t; typedef struct l2arc_write_callback { @@ -1130,7 +1133,7 @@ static uint32_t arc_bufc_to_flags(arc_bu static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *); static void l2arc_read_done(zio_t *); -static boolean_t l2arc_compress_buf(arc_buf_hdr_t *); +static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t); static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); static void l2arc_release_cdata_buf(arc_buf_hdr_t *); @@ -2217,6 +2220,8 @@ arc_buf_data_free(arc_buf_t *buf, void ( static void arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) { + size_t align, asize, len; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(MUTEX_HELD(&hdr->b_l2hdr.b_dev->l2ad_mtx)); @@ -2238,16 +2243,15 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr } /* - * The header does not have compression enabled. This can be due - * to the buffer not being compressible, or because we're - * freeing the buffer before the second phase of - * l2arc_write_buffer() has started (which does the compression - * step). In either case, b_tmp_cdata does not point to a - * separately compressed buffer, so there's nothing to free (it - * points to the same buffer as the arc_buf_t's b_data field). - */ - if (hdr->b_l2hdr.b_compress == ZIO_COMPRESS_OFF) { - hdr->b_l1hdr.b_tmp_cdata = NULL; + * The bufer has been chosen for writing to L2ARC, but it's + * not being written just yet. In other words, + * b_tmp_cdata points to exactly the same buffer as b_data, + * l2arc_transform_buf hasn't been called. + */ + if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) { + ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, + hdr->b_l1hdr.b_buf->b_data); + ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF); return; } @@ -2260,12 +2264,18 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr return; } - ASSERT(L2ARC_IS_VALID_COMPRESS(hdr->b_l2hdr.b_compress)); - - arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size, zio_data_buf_free); + /* + * Nothing to do if the temporary buffer was not required. + */ + if (hdr->b_l1hdr.b_tmp_cdata == NULL) + return; ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + arc_buf_free_on_write(hdr->b_l1hdr.b_tmp_cdata, asize, + zio_data_buf_free); hdr->b_l1hdr.b_tmp_cdata = NULL; } @@ -4528,6 +4538,7 @@ top: !HDR_L2_WRITING(hdr) && !HDR_L2_EVICTED(hdr) && !(l2arc_noprefetch && HDR_PREFETCH(hdr))) { l2arc_read_callback_t *cb; + void* b_data; DTRACE_PROBE1(l2arc__hit, arc_buf_hdr_t *, hdr); ARCSTAT_BUMP(arcstat_l2_hits); @@ -4540,6 +4551,14 @@ top: cb->l2rcb_zb = *zb; cb->l2rcb_flags = zio_flags; cb->l2rcb_compress = b_compress; + if (b_asize > hdr->b_size) { + ASSERT3U(b_compress, ==, + ZIO_COMPRESS_OFF); + b_data = zio_data_buf_alloc(b_asize); + cb->l2rcb_data = b_data; + } else { + b_data = buf->b_data; + } ASSERT(addr >= VDEV_LABEL_START_SIZE && addr + size < vd->vdev_psize - @@ -4552,6 +4571,7 @@ top: * was squashed to zero size by compression. */ if (b_compress == ZIO_COMPRESS_EMPTY) { + ASSERT3U(b_asize, ==, 0); rzio = zio_null(pio, spa, vd, l2arc_read_done, cb, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -4560,7 +4580,7 @@ top: ZIO_FLAG_DONT_RETRY); } else { rzio = zio_read_phys(pio, vd, addr, - b_asize, buf->b_data, + b_asize, b_data, ZIO_CHECKSUM_OFF, l2arc_read_done, cb, priority, zio_flags | ZIO_FLAG_DONT_CACHE | @@ -6045,6 +6065,32 @@ l2arc_read_done(zio_t *zio) ASSERT3P(hash_lock, ==, HDR_LOCK(hdr)); /* + * If the data was read into a temporary buffer, + * move it and free the buffer. + */ + if (cb->l2rcb_data != NULL) { + ASSERT3U(hdr->b_size, <, zio->io_size); + ASSERT3U(cb->l2rcb_compress, ==, ZIO_COMPRESS_OFF); + if (zio->io_error == 0) + bcopy(cb->l2rcb_data, buf->b_data, hdr->b_size); + + /* + * The following must be done regardless of whether + * there was an error: + * - free the temporary buffer + * - point zio to the real ARC buffer + * - set zio size accordingly + * These are required because zio is either re-used for + * an I/O of the block in the case of the error + * or the zio is passed to arc_read_done() and it + * needs real data. + */ + zio_data_buf_free(cb->l2rcb_data, zio->io_size); + zio->io_size = zio->io_orig_size = hdr->b_size; + zio->io_data = zio->io_orig_data = buf->b_data; + } + + /* * If the buffer was compressed, decompress it first. */ if (cb->l2rcb_compress != ZIO_COMPRESS_OFF) @@ -6328,6 +6374,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de kmutex_t *hash_lock; uint64_t buf_sz; uint64_t buf_a_sz; + size_t align; if (arc_warm == B_FALSE) hdr_prev = multilist_sublist_next(mls, hdr); @@ -6365,7 +6412,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * disk block size. */ buf_sz = hdr->b_size; - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); + align = (size_t)1 << dev->l2ad_vdev->vdev_ashift; + buf_a_sz = P2ROUNDUP(buf_sz, align); if ((write_asize + buf_a_sz) > target_sz) { full = B_TRUE; @@ -6469,26 +6517,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_de mutex_enter(&dev->l2ad_mtx); /* - * Note that elsewhere in this file arcstat_l2_asize - * and the used space on l2ad_vdev are updated using b_asize, - * which is not necessarily rounded up to the device block size. - * Too keep accounting consistent we do the same here as well: - * stats_size accumulates the sum of b_asize of the written buffers, - * while write_asize accumulates the sum of b_asize rounded up - * to the device block size. - * The latter sum is used only to validate the corectness of the code. - */ - uint64_t stats_size = 0; - write_asize = 0; - - /* * Now start writing the buffers. We're starting at the write head * and work backwards, retracing the course of the buffer selector * loop above. */ + write_asize = 0; for (hdr = list_prev(&dev->l2ad_buflist, head); hdr; hdr = list_prev(&dev->l2ad_buflist, hdr)) { uint64_t buf_sz; + boolean_t compress; /* * We rely on the L1 portion of the header below, so @@ -6507,22 +6544,26 @@ l2arc_write_buffers(spa_t *spa, l2arc_de */ hdr->b_l2hdr.b_daddr = dev->l2ad_hand; - if ((HDR_L2COMPRESS(hdr)) && - hdr->b_l2hdr.b_asize >= buf_compress_minsz) { - if (l2arc_compress_buf(hdr)) { - /* - * If compression succeeded, enable headroom - * boost on the next scan cycle. - */ - *headroom_boost = B_TRUE; - } + /* + * Save a pointer to the original buffer data we had previously + * stashed away. + */ + buf_data = hdr->b_l1hdr.b_tmp_cdata; + + compress = HDR_L2COMPRESS(hdr) && + hdr->b_l2hdr.b_asize >= buf_compress_minsz; + if (l2arc_transform_buf(hdr, compress)) { + /* + * If compression succeeded, enable headroom + * boost on the next scan cycle. + */ + *headroom_boost = B_TRUE; } /* - * Pick up the buffer data we had previously stashed away - * (and now potentially also compressed). + * Get the new buffer size that accounts for compression + * and padding. */ - buf_data = hdr->b_l1hdr.b_tmp_cdata; buf_sz = hdr->b_l2hdr.b_asize; /* @@ -6534,8 +6575,12 @@ l2arc_write_buffers(spa_t *spa, l2arc_de /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { - uint64_t buf_a_sz; - + /* + * If the data was padded or compressed, then it + * it is in a new buffer. + */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) + buf_data = hdr->b_l1hdr.b_tmp_cdata; wzio = zio_write_phys(pio, dev->l2ad_vdev, dev->l2ad_hand, buf_sz, buf_data, ZIO_CHECKSUM_OFF, NULL, NULL, ZIO_PRIORITY_ASYNC_WRITE, @@ -6545,14 +6590,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de zio_t *, wzio); (void) zio_nowait(wzio); - stats_size += buf_sz; - - /* - * Keep the clock hand suitably device-aligned. - */ - buf_a_sz = vdev_psize_to_asize(dev->l2ad_vdev, buf_sz); - write_asize += buf_a_sz; - dev->l2ad_hand += buf_a_sz; + write_asize += buf_sz; + dev->l2ad_hand += buf_sz; } } @@ -6562,8 +6601,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de ARCSTAT_BUMP(arcstat_l2_writes_sent); ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); - ARCSTAT_INCR(arcstat_l2_asize, stats_size); - vdev_space_update(dev->l2ad_vdev, stats_size, 0, 0); + ARCSTAT_INCR(arcstat_l2_asize, write_asize); + vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); /* * Bump device hand to the device start if it is approaching the end. @@ -6582,12 +6621,18 @@ l2arc_write_buffers(spa_t *spa, l2arc_de } /* - * Compresses an L2ARC buffer. + * Transforms, possibly compresses and pads, an L2ARC buffer. * The data to be compressed must be prefilled in l1hdr.b_tmp_cdata and its * size in l2hdr->b_asize. This routine tries to compress the data and * depending on the compression result there are three possible outcomes: - * *) The buffer was incompressible. The original l2hdr contents were left - * untouched and are ready for writing to an L2 device. + * *) The buffer was incompressible. The buffer size was already ashift aligned. + * The original hdr contents were left untouched except for b_tmp_cdata, + * which is reset to NULL. The caller must keep a pointer to the original + * data. + * *) The buffer was incompressible. The buffer size was not ashift aligned. + * b_tmp_cdata was replaced with a temporary data buffer which holds a padded + * (aligned) copy of the data. Once writing is done, invoke + * l2arc_release_cdata_buf on this hdr to free the temporary buffer. * *) The buffer was all-zeros, so there is no need to write it to an L2 * device. To indicate this situation b_tmp_cdata is NULL'ed, b_asize is * set to zero and b_compress is set to ZIO_COMPRESS_EMPTY. @@ -6601,10 +6646,11 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * buffer was incompressible). */ static boolean_t -l2arc_compress_buf(arc_buf_hdr_t *hdr) +l2arc_transform_buf(arc_buf_hdr_t *hdr, boolean_t compress) { void *cdata; - size_t csize, len, rounded; + size_t align, asize, csize, len, rounded; + ASSERT(HDR_HAS_L2HDR(hdr)); l2arc_buf_hdr_t *l2hdr = &hdr->b_l2hdr; @@ -6613,14 +6659,19 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); len = l2hdr->b_asize; - cdata = zio_data_buf_alloc(len); + align = (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + cdata = zio_data_buf_alloc(asize); ASSERT3P(cdata, !=, NULL); - csize = zio_compress_data(ZIO_COMPRESS_LZ4, hdr->b_l1hdr.b_tmp_cdata, - cdata, l2hdr->b_asize); + if (compress) + csize = zio_compress_data(ZIO_COMPRESS_LZ4, + hdr->b_l1hdr.b_tmp_cdata, cdata, len); + else + csize = len; if (csize == 0) { /* zero block, indicate that there's nothing to write */ - zio_data_buf_free(cdata, len); + zio_data_buf_free(cdata, asize); l2hdr->b_compress = ZIO_COMPRESS_EMPTY; l2hdr->b_asize = 0; hdr->b_l1hdr.b_tmp_cdata = NULL; @@ -6628,8 +6679,8 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } - rounded = P2ROUNDUP(csize, - (size_t)1 << l2hdr->b_dev->l2ad_vdev->vdev_ashift); + rounded = P2ROUNDUP(csize, align); + ASSERT3U(rounded, <=, asize); if (rounded < len) { /* * Compression succeeded, we'll keep the cdata around for @@ -6646,11 +6697,32 @@ l2arc_compress_buf(arc_buf_hdr_t *hdr) return (B_TRUE); } else { /* - * Compression failed, release the compressed buffer. - * l2hdr will be left unmodified. + * Compression did not save space. */ - zio_data_buf_free(cdata, len); - ARCSTAT_BUMP(arcstat_l2_compress_failures); + if (P2PHASE(len, align) != 0) { + /* + * Use compression buffer for a copy of data padded to + * the proper size. Compression algorithm remains set + * to ZIO_COMPRESS_OFF. + */ + ASSERT3U(len, <, asize); + bcopy(hdr->b_l1hdr.b_tmp_cdata, cdata, len); + bzero((char *)cdata + len, asize - len); + l2hdr->b_asize = asize; + hdr->b_l1hdr.b_tmp_cdata = cdata; + ARCSTAT_BUMP(arcstat_l2_padding_needed); + } else { + ASSERT3U(len, ==, asize); + /* + * The original buffer is good as is, + * release the compressed buffer. + * l2hdr will be left unmodified except for b_tmp_cdata. + */ + zio_data_buf_free(cdata, asize); + hdr->b_l1hdr.b_tmp_cdata = NULL; + } + if (compress) + ARCSTAT_BUMP(arcstat_l2_compress_failures); return (B_FALSE); } } @@ -6719,44 +6791,30 @@ l2arc_decompress_zio(zio_t *zio, arc_buf /* * Releases the temporary b_tmp_cdata buffer in an l2arc header structure. - * This buffer serves as a temporary holder of compressed data while + * This buffer serves as a temporary holder of compressed or padded data while * the buffer entry is being written to an l2arc device. Once that is * done, we can dispose of it. */ static void l2arc_release_cdata_buf(arc_buf_hdr_t *hdr) { - ASSERT(HDR_HAS_L2HDR(hdr)); + size_t align, asize, len; enum zio_compress comp = hdr->b_l2hdr.b_compress; + ASSERT(HDR_HAS_L2HDR(hdr)); ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT(comp == ZIO_COMPRESS_OFF || L2ARC_IS_VALID_COMPRESS(comp)); - if (comp == ZIO_COMPRESS_OFF) { - /* - * In this case, b_tmp_cdata points to the same buffer - * as the arc_buf_t's b_data field. We don't want to - * free it, since the arc_buf_t will handle that. - */ + if (hdr->b_l1hdr.b_tmp_cdata != NULL) { + ASSERT(comp != ZIO_COMPRESS_EMPTY); + len = hdr->b_size; + align = (size_t)1 << hdr->b_l2hdr.b_dev->l2ad_vdev->vdev_ashift; + asize = P2ROUNDUP(len, align); + zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, asize); hdr->b_l1hdr.b_tmp_cdata = NULL; - } else if (comp == ZIO_COMPRESS_EMPTY) { - /* - * In this case, b_tmp_cdata was compressed to an empty - * buffer, thus there's nothing to free and b_tmp_cdata - * should have been set to NULL in l2arc_write_buffers(). - */ - ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL); } else { - /* - * If the data was compressed, then we've allocated a - * temporary buffer for it, so now we need to release it. - */ - ASSERT(hdr->b_l1hdr.b_tmp_cdata != NULL); - zio_data_buf_free(hdr->b_l1hdr.b_tmp_cdata, - hdr->b_size); - hdr->b_l1hdr.b_tmp_cdata = NULL; + ASSERT(comp == ZIO_COMPRESS_OFF || comp == ZIO_COMPRESS_EMPTY); } - } /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue May 17 08:36:54 2016 (r300038) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue May 17 08:43:50 2016 (r300039) @@ -2810,11 +2810,13 @@ zio_vdev_io_start(zio_t *zio) ASSERT0(P2PHASE(zio->io_size, align)); } else { /* - * For physical writes, we allow 512b aligned writes and assume - * the device will perform a read-modify-write as necessary. + * For the physical io we allow alignment + * to a logical block size. */ - ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); - ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + uint64_t log_align = + 1ULL << vd->vdev_top->vdev_logical_ashift; + ASSERT0(P2PHASE(zio->io_offset, log_align)); + ASSERT0(P2PHASE(zio->io_size, log_align)); } VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); From owner-svn-src-stable-10@freebsd.org Tue May 17 14:52:06 2016 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 E66CDB3E66E; Tue, 17 May 2016 14:52:06 +0000 (UTC) (envelope-from garga@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 B6798641EB; Tue, 17 May 2016 14:52:06 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HEq540072027; Tue, 17 May 2016 14:52:05 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HEq5ES072026; Tue, 17 May 2016 14:52:05 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201605171452.u4HEq5ES072026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 17 May 2016 14:52:05 +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: r300057 - stable/10/sbin/reboot 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.22 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, 17 May 2016 14:52:07 -0000 Author: garga (ports committer) Date: Tue May 17 14:52:05 2016 New Revision: 300057 URL: https://svnweb.freebsd.org/changeset/base/300057 Log: MFC r299196: Add missing parameters -N and -l to reroot and halt usage() Approved by: bapt Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D6173 Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Tue May 17 14:10:45 2016 (r300056) +++ stable/10/sbin/reboot/reboot.c Tue May 17 14:52:05 2016 (r300057) @@ -248,8 +248,8 @@ usage(void) { (void)fprintf(stderr, dohalt ? - "usage: halt [-lnpq] [-k kernel]\n" : - "usage: reboot [-dlnpq] [-k kernel]\n"); + "usage: halt [-lNnpq] [-k kernel]\n" : + "usage: reboot [-dlNnpqr] [-k kernel]\n"); exit(1); } From owner-svn-src-stable-10@freebsd.org Tue May 17 15:18:06 2016 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 98D2AB3F164; Tue, 17 May 2016 15:18:06 +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 35C74652F5; Tue, 17 May 2016 15:18:06 +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 u4HFI5ZG078353; Tue, 17 May 2016 15:18:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HFI2xK078320; Tue, 17 May 2016 15:18:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605171518.u4HFI2xK078320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 17 May 2016 15:18:02 +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: r300060 - in stable/10/sys: dev/aic7xxx dev/aic7xxx/aicasm dev/ciss dev/drm2/radeon dev/drm2/ttm dev/hptiop dev/hwpmc dev/isci/scil dev/pccbb dev/wbwd dev/wtap dev/wtap/plugins 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.22 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, 17 May 2016 15:18:06 -0000 Author: pfg Date: Tue May 17 15:18:01 2016 New Revision: 300060 URL: https://svnweb.freebsd.org/changeset/base/300060 Log: MFC r298931, r298981, r299375: Minor spelling fixes in: sys/dev, sys/sys Many of these have user-visible strings. Modified: stable/10/sys/dev/aic7xxx/aic79xx.c stable/10/sys/dev/aic7xxx/aic79xx.h stable/10/sys/dev/aic7xxx/aic79xx.reg stable/10/sys/dev/aic7xxx/aic79xx.seq stable/10/sys/dev/aic7xxx/aic79xx_inline.h stable/10/sys/dev/aic7xxx/aic79xx_pci.c stable/10/sys/dev/aic7xxx/aic7xxx.c stable/10/sys/dev/aic7xxx/aic7xxx.h stable/10/sys/dev/aic7xxx/aic7xxx.reg stable/10/sys/dev/aic7xxx/aic7xxx.seq stable/10/sys/dev/aic7xxx/aic7xxx_inline.h stable/10/sys/dev/aic7xxx/aic7xxx_pci.c stable/10/sys/dev/aic7xxx/aicasm/aicasm.c stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y stable/10/sys/dev/ciss/ciss.c stable/10/sys/dev/drm2/radeon/radeon_fb.c stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c stable/10/sys/dev/hptiop/hptiop.c stable/10/sys/dev/hwpmc/hwpmc_mod.c stable/10/sys/dev/isci/scil/scic_phy.h stable/10/sys/dev/isci/scil/scic_sds_phy.c stable/10/sys/dev/pccbb/pccbb_pci.c stable/10/sys/dev/wbwd/wbwd.c stable/10/sys/dev/wtap/if_wtap.c stable/10/sys/dev/wtap/if_wtap_module.c stable/10/sys/dev/wtap/plugins/visibility.c stable/10/sys/sys/ata.h stable/10/sys/sys/buf.h stable/10/sys/sys/buf_ring.h stable/10/sys/sys/iconv.h stable/10/sys/sys/imgact_binmisc.h stable/10/sys/sys/imgact_elf.h stable/10/sys/sys/ipc.h stable/10/sys/sys/ipmi.h stable/10/sys/sys/linker.h stable/10/sys/sys/memrange.h stable/10/sys/sys/pmc.h stable/10/sys/sys/priority.h stable/10/sys/sys/priv.h stable/10/sys/sys/proc.h stable/10/sys/sys/procctl.h stable/10/sys/sys/shm.h stable/10/sys/sys/sockio.h stable/10/sys/sys/soundcard.h stable/10/sys/sys/sx.h stable/10/sys/sys/sysctl.h stable/10/sys/sys/user.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.c Tue May 17 15:18:01 2016 (r300060) @@ -1209,7 +1209,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -1623,7 +1623,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -2699,7 +2699,7 @@ ahd_clear_critical_section(struct ahd_so ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP); ahd_outb(ahd, SIMODE1, simode1); /* - * SCSIINT seems to glitch occassionally when + * SCSIINT seems to glitch occasionally when * the interrupt masks are restored. Clear SCSIINT * one more time so that only persistent errors * are seen as a real interrupt. @@ -3029,7 +3029,7 @@ ahd_validate_width(struct ahd_softc *ahd /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3380,7 +3380,7 @@ ahd_update_neg_table(struct ahd_softc *a /* * During packetized transfers, the target will - * give us the oportunity to send command packets + * give us the opportunity to send command packets * without us asserting attention. */ if ((tinfo->ppr_options & MSG_EXT_PPR_IU_REQ) == 0) @@ -4845,7 +4845,7 @@ ahd_handle_msg_reject(struct ahd_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb), @@ -5498,7 +5498,7 @@ ahd_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -5751,7 +5751,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) } /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -8794,7 +8794,7 @@ ahd_check_patch(struct ahd_softc *ahd, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -9673,7 +9673,7 @@ ahd_write_seeprom(struct ahd_softc *ahd, return (error); /* - * Write the data. If we don't get throught the loop at + * Write the data. If we don't get through the loop at * least once, the arguments were invalid. */ retval = EINVAL; Modified: stable/10/sys/dev/aic7xxx/aic79xx.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.h Tue May 17 15:18:01 2016 (r300060) @@ -478,7 +478,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, or + * sequencer determines that there is a residual in the transfer, or * there is non-zero status, it will set the SG_STATUS_VALID flag in * sgptr and dma the scb back into host memory. To sumarize: * @@ -486,7 +486,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -529,7 +529,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: stable/10/sys/dev/aic7xxx/aic79xx.reg ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.reg Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.reg Tue May 17 15:18:01 2016 (r300060) @@ -283,7 +283,7 @@ register HS_MAILBOX { } /* - * Sequencer Interupt Status + * Sequencer Interrupt Status */ register SEQINTSTAT { address 0x00C @@ -643,7 +643,7 @@ register DCHRXMSG0 { } /* - * CMC Recieve Message 0 + * CMC Receive Message 0 */ register CMCRXMSG0 { address 0x090 @@ -654,7 +654,7 @@ register CMCRXMSG0 { } /* - * Overlay Recieve Message 0 + * Overlay Receive Message 0 */ register OVLYRXMSG0 { address 0x090 @@ -690,7 +690,7 @@ register DCHRXMSG1 { } /* - * CMC Recieve Message 1 + * CMC Receive Message 1 */ register CMCRXMSG1 { address 0x091 @@ -700,7 +700,7 @@ register CMCRXMSG1 { } /* - * Overlay Recieve Message 1 + * Overlay Receive Message 1 */ register OVLYRXMSG1 { address 0x091 @@ -735,7 +735,7 @@ register DCHRXMSG2 { } /* - * CMC Recieve Message 2 + * CMC Receive Message 2 */ register CMCRXMSG2 { address 0x092 @@ -745,7 +745,7 @@ register CMCRXMSG2 { } /* - * Overlay Recieve Message 2 + * Overlay Receive Message 2 */ register OVLYRXMSG2 { address 0x092 @@ -774,7 +774,7 @@ register DCHRXMSG3 { } /* - * CMC Recieve Message 3 + * CMC Receive Message 3 */ register CMCRXMSG3 { address 0x093 @@ -784,7 +784,7 @@ register CMCRXMSG3 { } /* - * Overlay Recieve Message 3 + * Overlay Receive Message 3 */ register OVLYRXMSG3 { address 0x093 @@ -1192,7 +1192,7 @@ register TARGPCISTAT { /* * LQ Packet In - * The last LQ Packet recieved + * The last LQ Packet received */ register LQIN { address 0x020 @@ -2424,7 +2424,7 @@ register IOPDNCTL { } /* - * Shaddow Host Address. + * Shadow Host Address. */ register SHADDR { address 0x060 @@ -3726,7 +3726,7 @@ scratch_ram { /* * The maximum amount of time to wait, when interrupt coalescing - * is enabled, before issueing a CMDCMPLT interrupt for a completed + * is enabled, before issuing a CMDCMPLT interrupt for a completed * command. */ INT_COALESCING_TIMER { Modified: stable/10/sys/dev/aic7xxx/aic79xx.seq ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx.seq Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx.seq Tue May 17 15:18:01 2016 (r300060) @@ -217,7 +217,7 @@ BEGIN_CRITICAL; scbdma_tohost_done: test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; /* - * An SCB has been succesfully uploaded to the host. + * An SCB has been successfully uploaded to the host. * If the SCB was uploaded for some reason other than * bad SCSI status (currently only for underruns), we * queue the SCB for normal completion. Otherwise, we @@ -960,7 +960,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, @@ -1507,7 +1507,7 @@ service_fifo: * If the other FIFO needs loading, then it * must not have claimed the S/G cache yet * (SG_CACHE_AVAIL would have been cleared in - * the orginal FIFO mode and we test this above). + * the original FIFO mode and we test this above). * Return to the idle loop so we can process the * FIFO not currently on the bus first. */ @@ -1551,7 +1551,7 @@ idle_sg_avail: test DFSTATUS, PRELOAD_AVAIL jz return; /* * On the A, preloading a segment before HDMAENACK - * comes true can clobber the shaddow address of the + * comes true can clobber the shadow address of the * first segment in the S/G FIFO. Wait until it is * safe to proceed. */ @@ -2004,10 +2004,10 @@ pkt_handle_xfer: * Defer handling of this NONPACKREQ until we * can be sure it pertains to this FIFO. SAVEPTRS * will not be asserted if the NONPACKREQ is for us, - * so we must simulate it if shaddow is valid. If - * shaddow is not valid, keep running this FIFO until we + * so we must simulate it if shadow is valid. If + * shadow is not valid, keep running this FIFO until we * have satisfied the transfer by loading segments and - * waiting for either shaddow valid or last_seg_done. + * waiting for either shadow valid or last_seg_done. */ test MDFFSTAT, SHVALID jnz pkt_saveptrs; pkt_service_fifo: @@ -2171,7 +2171,7 @@ pkt_status_check_nonpackreq: /* * The unexpected nonpkt phase handler assumes that any * data channel use will have a FIFO reference count. It - * turns out that the status handler doesn't need a refernce + * turns out that the status handler doesn't need a references * count since the status received flag, and thus completion * processing, cannot be set until the handler is finished. * We increment the count here to make the nonpkt handler Modified: stable/10/sys/dev/aic7xxx/aic79xx_inline.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx_inline.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx_inline.h Tue May 17 15:18:01 2016 (r300060) @@ -417,7 +417,7 @@ ahd_targetcmd_offset(struct ahd_softc *a - (uint8_t *)ahd->qoutfifo); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb); static __inline void ahd_update_residual(struct ahd_softc *ahd, @@ -534,7 +534,7 @@ static __inline void ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) { /* - * Write low byte first to accomodate registers + * Write low byte first to accommodate registers * such as PRGMCNT where the order maters. */ ahd_outb(ahd, port, value & 0xFF); Modified: stable/10/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic79xx_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic79xx_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -491,7 +491,7 @@ ahd_pci_test_register_access(struct ahd_ * Next create a situation where write combining * or read prefetching could be initiated by the * CPU or host bridge. Our device does not support - * either, so look for data corruption and/or flaged + * either, so look for data corruption and/or flagged * PCI errors. First pause without causing another * chip reset. */ @@ -1013,7 +1013,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_FAINT_LED_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); @@ -1034,7 +1034,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_BUSFREEREV_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB); Modified: stable/10/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.c Tue May 17 15:18:01 2016 (r300060) @@ -116,7 +116,7 @@ static const u_int num_phases = NUM_ELEM /* * Valid SCSIRATE values. (p. 3-17) - * Provides a mapping of tranfer periods in ns to the proper value to + * Provides a mapping of transfer periods in ns to the proper value to * stick in the scsixfer reg. */ static struct ahc_syncrate ahc_syncrates[] = @@ -682,7 +682,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -925,7 +925,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, scbptr, ahc_inb(ahc, ARG_1), ahc->scb_data->hscbs[scbptr].tag); ahc_dump_card_state(ahc); - panic("for saftey"); + panic("for safety"); break; } case OUT_OF_RANGE: @@ -1171,7 +1171,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -1381,7 +1381,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc if (lastphase != P_BUSFREE) { /* * Renegotiate with this device at the - * next oportunity just in case this busfree + * next opportunity just in case this busfree * is due to a negotiation mismatch with the * device. */ @@ -1857,7 +1857,7 @@ ahc_validate_width(struct ahc_softc *ahc /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3627,7 +3627,7 @@ ahc_handle_msg_reject(struct ahc_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb), @@ -4138,7 +4138,7 @@ ahc_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -4460,7 +4460,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) ahc->next_queued_scb = ahc_get_scb(ahc); /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -6549,7 +6549,7 @@ ahc_check_patch(struct ahc_softc *ahc, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -7253,7 +7253,7 @@ bus_reset: ahc_outb(ahc, SCBPTR, saved_scbptr); aic_scb_timer_reset(scb, 2 * 1000); } else { - /* Go "immediatly" to the bus reset */ + /* Go "immediately" to the bus reset */ /* This shouldn't happen */ ahc_set_recoveryscb(ahc, scb); ahc_print_path(ahc, scb); Modified: stable/10/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.h Tue May 17 15:18:01 2016 (r300060) @@ -448,7 +448,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, it + * sequencer determines that there is a residual in the transfer, it * will set the SG_RESID_VALID flag in sgptr and dma the scb back into * host memory. To sumarize: * @@ -456,7 +456,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -510,7 +510,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: stable/10/sys/dev/aic7xxx/aic7xxx.reg ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.reg Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.reg Tue May 17 15:18:01 2016 (r300060) @@ -329,7 +329,7 @@ register SSTAT2 { address 0x00d access_mode RO field OVERRUN 0x80 - field SHVALID 0x40 /* Shaddow Layer non-zero */ + field SHVALID 0x40 /* Shadow Layer non-zero */ field EXP_ACTIVE 0x10 /* SCSI Expander Active */ field CRCVALERR 0x08 /* CRC doesn't match (U3 only) */ field CRCENDERR 0x04 /* No terminal CRC packet (U3 only) */ Modified: stable/10/sys/dev/aic7xxx/aic7xxx.seq ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx.seq Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx.seq Tue May 17 15:18:01 2016 (r300060) @@ -60,7 +60,7 @@ PREFIX = "ahc_" * use byte 27 of the SCB as a psuedo-next pointer and to thread a list * of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes, * SCB_LIST_NULL is 0xff which is out of range. An entry is also added to - * this list everytime a request sense occurs or after completing a non-tagged + * this list every time a request sense occurs or after completing a non-tagged * command for which a second SCB has been queued. The sequencer will * automatically consume the entries. */ @@ -1489,7 +1489,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, Modified: stable/10/sys/dev/aic7xxx/aic7xxx_inline.h ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 17 15:18:01 2016 (r300060) @@ -229,7 +229,7 @@ ahc_name(struct ahc_softc *ahc) return (ahc->name); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahc_update_residual(struct ahc_softc *ahc, struct scb *scb); Modified: stable/10/sys/dev/aic7xxx/aic7xxx_pci.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -865,7 +865,7 @@ ahc_pci_config(struct ahc_softc *ahc, st ahc->bus_suspend = ahc_pci_suspend; ahc->bus_resume = ahc_pci_resume; - /* Remeber how the card was setup in case there is no SEEPROM */ + /* Remember how the card was setup in case there is no SEEPROM */ if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) { ahc_pause(ahc); if ((ahc->features & AHC_ULTRA2) != 0) @@ -936,7 +936,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * We cannot perform ULTRA speeds without the presense + * We cannot perform ULTRA speeds without the presence * of the external precision resistor. */ if ((ahc->features & AHC_ULTRA) != 0) { @@ -1054,7 +1054,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * Test for the presense of external sram in an + * Test for the presence of external sram in an * "unshared" configuration. */ static int Modified: stable/10/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- stable/10/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 17 15:18:01 2016 (r300060) @@ -668,7 +668,7 @@ check_patch(patch_t **start_patch, unsig cur_patch = STAILQ_NEXT(cur_patch, links); } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch = STAILQ_NEXT(cur_patch, links); Modified: stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 17 15:18:01 2016 (r300060) @@ -1286,8 +1286,8 @@ code: ; /* - * This grammer differs from the one in the aic7xxx - * reference manual since the grammer listed there is + * This grammar differs from the one in the aic7xxx + * reference manual since the grammar listed there is * ambiguous and causes a shift/reduce conflict. * It also seems more logical as the "immediate" * argument is listed as the second arg like the @@ -1753,7 +1753,7 @@ format_3_instr(int opcode, symbol_ref_t instr = seq_alloc(); f3_instr = &instr->format.format3; if (address->symbol == NULL) { - /* 'dot' referrence. Use the current instruction pointer */ + /* 'dot' reference. Use the current instruction pointer */ addr = instruction_ptr + address->offset; } else if (address->symbol->type == UNINITIALIZED) { /* forward reference */ Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/ciss/ciss.c Tue May 17 15:18:01 2016 (r300060) @@ -464,7 +464,7 @@ ciss_attach(device_t dev) ciss_initq_notify(sc); /* - * Initalize device sysctls. + * Initialize device sysctls. */ ciss_init_sysctl(sc); @@ -619,7 +619,7 @@ ciss_init_pci(struct ciss_softc *sc) /* * XXX Big hammer, masks/unmasks all possible interrupts. This should * work on all hardware variants. Need to add code to handle the - * "controller crashed" interupt bit that this unmasks. + * "controller crashed" interrupt bit that this unmasks. */ sqmask = ~0; } @@ -4499,7 +4499,7 @@ ciss_name_ldrive_org(int org) case CISS_LDRIVE_RAIDADG: return("RAID ADG"); } - return("unkown"); + return("unknown"); } /************************************************************************ Modified: stable/10/sys/dev/drm2/radeon/radeon_fb.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_fb.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/drm2/radeon/radeon_fb.c Tue May 17 15:18:01 2016 (r300060) @@ -228,7 +228,7 @@ static int radeonfb_create(struct radeon ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); if (ret) { - DRM_ERROR("failed to initalise framebuffer %d\n", ret); + DRM_ERROR("failed to initialise framebuffer %d\n", ret); goto out_unref; } Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Tue May 17 15:18:01 2016 (r300060) @@ -299,7 +299,7 @@ ttm_bo_vm_ctor(void *handle, vm_ooffset_ * acquired either in ttm_bo_mmap() or ttm_bo_vm_open(). It's * then released in ttm_bo_vm_close(). * - * Here, this function is called during mmap() intialization. + * Here, this function is called during mmap() initialization. * Thus, the reference acquired in ttm_bo_mmap_single() is * sufficient. */ Modified: stable/10/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/10/sys/dev/hptiop/hptiop.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/hptiop/hptiop.c Tue May 17 15:18:01 2016 (r300060) @@ -2405,7 +2405,7 @@ static void hptiop_post_req_itl(struct h iop_req32 = BUS_SPACE_RD4_ITL(inbound_queue); if (iop_req32 == IOPMU_QUEUE_EMPTY) { - device_printf(hba->pcidev, "invaild req offset\n"); + device_printf(hba->pcidev, "invalid req offset\n"); ccb->ccb_h.status = CAM_BUSY; bus_dmamap_unload(hba->io_dmat, srb->dma_map); hptiop_free_srb(hba, srb); Modified: stable/10/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/10/sys/dev/hwpmc/hwpmc_mod.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/hwpmc/hwpmc_mod.c Tue May 17 15:18:01 2016 (r300060) @@ -1128,7 +1128,7 @@ pmc_detach_one_process(struct proc *p, s pmclog_process_pmcdetach(pm, p->p_pid); /* - * If there are no PMCs targetting this process, we remove its + * If there are no PMCs targeting this process, we remove its * descriptor from the target hash table and unset the P_HWPMC * flag in the struct proc. */ @@ -1237,7 +1237,7 @@ pmc_process_csw_in(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d] wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d] weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1382,7 +1382,7 @@ pmc_process_csw_out(struct thread *td) p->p_pid, p->p_comm, pp); KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), - ("[pmc,%d wierd CPU id %d", __LINE__, cpu)); + ("[pmc,%d weird CPU id %d", __LINE__, cpu)); pc = pmc_pcpu[cpu]; @@ -1912,7 +1912,7 @@ pmc_hook_handler(struct thread *td, int /* * Log the exec event to all monitoring owners. Skip - * owners who have already recieved the event because + * owners who have already received the event because * they had system sampling PMCs active. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -1938,7 +1938,7 @@ pmc_hook_handler(struct thread *td, int /* * If the newly exec()'ed process has a different credential * than before, allow it to be the target of a PMC only if - * the PMC's owner has sufficient priviledge. + * the PMC's owner has sufficient privilege. */ for (ri = 0; ri < md->pmd_npmc; ri++) @@ -4424,7 +4424,7 @@ pmc_process_exit(void *arg __unused, str * process, we would have context switched IN at some prior * point. However, with PREEMPTION, kernel mode context * switches may happen any time, so we want to disable a - * context switch OUT till we get any PMCs targetting this + * context switch OUT till we get any PMCs targeting this * process off the hardware. * * We also need to atomically remove this process' @@ -4527,7 +4527,7 @@ pmc_process_exit(void *arg __unused, str /* * Unlink this process from the PMCs that are - * targetting it. This will send a signal to + * targeting it. This will send a signal to * all PMC owner's whose PMCs are orphaned. * * Log PMC value at exit time if requested. Modified: stable/10/sys/dev/isci/scil/scic_phy.h ============================================================================== --- stable/10/sys/dev/isci/scil/scic_phy.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/isci/scil/scic_phy.h Tue May 17 15:18:01 2016 (r300060) @@ -308,7 +308,7 @@ SCI_STATUS scic_sas_phy_get_properties( /** * @brief This method will enable the user to retrieve information - * specific to a SATA phy, such as: the recieved signature + * specific to a SATA phy, such as: the received signature * FIS, if a port selector is present, etc. * * @param[in] phy this parameter specifies the phy for which to Modified: stable/10/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- stable/10/sys/dev/isci/scil/scic_sds_phy.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/isci/scil/scic_sds_phy.c Tue May 17 15:18:01 2016 (r300060) @@ -749,7 +749,7 @@ SCI_STATUS scic_sds_phy_initialize( this_phy, link_layer_registers )); - // Perfrom the initialization of the TL hardware + // Perform the initialization of the TL hardware scic_sds_phy_transport_layer_initialization(this_phy, transport_layer_registers); // Perofrm the initialization of the PE hardware @@ -1029,7 +1029,7 @@ SCI_STATUS scic_sds_phy_reset( } /** - * @brief This method will process the event code recieved. + * @brief This method will process the event code received. * * @param[in] this_phy * @param[in] event_code @@ -1052,7 +1052,7 @@ SCI_STATUS scic_sds_phy_event_handler( } /** - * @brief This method will process the frame index recieved. + * @brief This method will process the frame index received. * * @param[in] this_phy * @param[in] frame_index @@ -1754,7 +1754,7 @@ SCI_STATUS scic_sds_phy_default_frame_ha SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY, - "SCIC Phy 0x%08x recieved unexpected frame data %d while in state %d\n", + "SCIC Phy 0x%08x received unexpected frame data %d while in state %d\n", this_phy, frame_index, sci_base_state_machine_get_state(&this_phy->parent.state_machine) )); @@ -1866,7 +1866,7 @@ SCI_STATUS scic_sds_phy_stopped_state_st * This method takes the SCIC_SDS_PHY from a stopped state and destroys it. * - This function takes no action. * - * @todo Shouldnt this function transition the SCI_BASE_PHY::state_machine to + * @todo Shouldn't this function transition the SCI_BASE_PHY::state_machine to * the SCI_BASE_PHY_STATE_FINAL? * * @param[in] phy This is the SCI_BASE_PHY object which is cast into a @@ -1964,7 +1964,7 @@ SCI_STATUS scic_sds_phy_ready_state_rese * - decoded event is a link failure * - transition the SCIC_SDS_PHY back to the SCI_BASE_PHY_STATE_STARTING * state. - * - any other event recived will report a warning message + * - any other event received will report a warning message * * @param[in] phy This is the SCIC_SDS_PHY object which has received the * event. @@ -2020,7 +2020,7 @@ SCI_STATUS scic_sds_phy_ready_state_even SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x ready state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x ready state machine received unexpected event_code %x\n", this_phy, event_code )); result = SCI_FAILURE_INVALID_STATE; @@ -2066,7 +2066,7 @@ SCI_STATUS scic_sds_phy_resetting_state_ SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "SCIC PHY 0x%x resetting state machine recieved unexpected event_code %x\n", + "SCIC PHY 0x%x resetting state machine received unexpected event_code %x\n", this_phy, event_code )); @@ -2691,7 +2691,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2772,7 +2772,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2834,7 +2834,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2879,7 +2879,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -2935,7 +2935,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3003,7 +3003,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3090,7 +3090,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3147,7 +3147,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_RECEIVED_EVENTS, - "PHY starting substate machine recieved unexpected event_code %x\n", + "PHY starting substate machine received unexpected event_code %x\n", event_code )); @@ -3246,7 +3246,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } @@ -3332,7 +3332,7 @@ SCI_STATUS scic_sds_phy_starting_substat SCIC_LOG_WARNING(( sci_base_object_get_logger(this_phy), SCIC_LOG_OBJECT_PHY | SCIC_LOG_OBJECT_UNSOLICITED_FRAMES, - "PHY starting substate machine recieved unexpected frame id %x\n", + "PHY starting substate machine received unexpected frame id %x\n", frame_index )); } Modified: stable/10/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- stable/10/sys/dev/pccbb/pccbb_pci.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/pccbb/pccbb_pci.c Tue May 17 15:18:01 2016 (r300060) @@ -366,7 +366,7 @@ cbb_pci_attach(device_t brdev) SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "memory", CTLFLAG_RD, &sc->subbus, 0, "Memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "premem", - CTLFLAG_RD, &sc->subbus, 0, "Prefetch memroy window open"); + CTLFLAG_RD, &sc->subbus, 0, "Prefetch memory window open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io1", CTLFLAG_RD, &sc->subbus, 0, "io range 1 open"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "io2", Modified: stable/10/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/10/sys/dev/wbwd/wbwd.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wbwd/wbwd.c Tue May 17 15:18:01 2016 (r300060) @@ -754,7 +754,7 @@ wb_attach(device_t dev) sc = device_get_softc(dev); KASSERT(sc->ext_cfg_enter_f != NULL && sc->ext_cfg_exit_f != NULL, - ("%s: successfull probe result but not setup correctly", __func__)); + ("%s: successful probe result but not setup correctly", __func__)); /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8); Modified: stable/10/sys/dev/wtap/if_wtap.c ============================================================================== --- stable/10/sys/dev/wtap/if_wtap.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/if_wtap.c Tue May 17 15:18:01 2016 (r300060) @@ -131,7 +131,7 @@ wtap_node_ioctl(struct cdev *dev, u_long switch(cmd) { default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } return error; Modified: stable/10/sys/dev/wtap/if_wtap_module.c ============================================================================== --- stable/10/sys/dev/wtap/if_wtap_module.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/if_wtap_module.c Tue May 17 15:18:01 2016 (r300060) @@ -89,7 +89,7 @@ MALLOC_DEFINE(M_WTAP, "wtap", "wtap wireless simulator"); MALLOC_DEFINE(M_WTAP_PACKET, "wtap packet", "wtap wireless simulator packet"); MALLOC_DEFINE(M_WTAP_RXBUF, "wtap rxbuf", - "wtap wireless simulator recieve buffer"); + "wtap wireless simulator receive buffer"); MALLOC_DEFINE(M_WTAP_PLUGIN, "wtap plugin", "wtap wireless simulator plugin"); static struct wtap_hal *hal; @@ -123,7 +123,7 @@ wtap_ioctl(struct cdev *dev, u_long cmd, error = EINVAL; break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } Modified: stable/10/sys/dev/wtap/plugins/visibility.c ============================================================================== --- stable/10/sys/dev/wtap/plugins/visibility.c Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/dev/wtap/plugins/visibility.c Tue May 17 15:18:01 2016 (r300060) @@ -231,7 +231,7 @@ vis_ioctl(struct cdev *sdev, u_long cmd, #endif break; default: - DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + DWTAP_PRINTF("Unknown WTAP IOCTL\n"); error = EINVAL; } Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/ata.h Tue May 17 15:18:01 2016 (r300060) @@ -377,10 +377,10 @@ struct ata_params { #define ATA_NCQ_NON_DATA 0x63 /* NCQ non-data command */ #define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ #define ATA_SFPDMA_DSM 0x00 /* Data set management */ -#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxilary */ +#define ATA_SFPDMA_DSM_TRIM 0x01 /* Set trim bit in auxiliary */ #define ATA_SFPDMA_HYBRID_EVICT 0x01 /* Hybrid Evict */ #define ATA_SFPDMA_WLDMA 0x02 /* Write Log DMA EXT */ -#define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ +#define ATA_RECV_FPDMA_QUEUED 0x65 /* receive DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ Modified: stable/10/sys/sys/buf.h ============================================================================== --- stable/10/sys/sys/buf.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/buf.h Tue May 17 15:18:01 2016 (r300060) @@ -204,7 +204,7 @@ struct buf { #define B_UNMAPPED 0x00000800 /* KVA is not mapped. */ #define B_KVAALLOC 0x00001000 /* But allocated. */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ -#define B_BARRIER 0x00004000 /* Write this and all preceeding first. */ +#define B_BARRIER 0x00004000 /* Write this and all preceding first. */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ Modified: stable/10/sys/sys/buf_ring.h ============================================================================== --- stable/10/sys/sys/buf_ring.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/buf_ring.h Tue May 17 15:18:01 2016 (r300060) @@ -98,7 +98,7 @@ buf_ring_enqueue(struct buf_ring *br, vo /* * If there are other enqueues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_prod_tail != prod_head) @@ -135,7 +135,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) #endif /* * If there are other dequeues in progress - * that preceeded us, we need to wait for them + * that preceded us, we need to wait for them * to complete */ while (br->br_cons_tail != cons_head) Modified: stable/10/sys/sys/iconv.h ============================================================================== --- stable/10/sys/sys/iconv.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/iconv.h Tue May 17 15:18:01 2016 (r300060) @@ -65,7 +65,7 @@ struct iconv_cspair_info { }; /* - * Paramters for 'add' sysctl + * Parameters for 'add' sysctl */ #define ICONV_ADD_VER 1 Modified: stable/10/sys/sys/imgact_binmisc.h ============================================================================== --- stable/10/sys/sys/imgact_binmisc.h Tue May 17 15:17:23 2016 (r300059) +++ stable/10/sys/sys/imgact_binmisc.h Tue May 17 15:18:01 2016 (r300060) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Tue May 17 22:30:00 2016 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 52311B40733; Tue, 17 May 2016 22:30:00 +0000 (UTC) (envelope-from glebius@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 1F4F713DD; Tue, 17 May 2016 22:30:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMTx19012312; Tue, 17 May 2016 22:29:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMTxLc012311; Tue, 17 May 2016 22:29:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172229.u4HMTxLc012311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:29: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: r300091 - stable/10/sys/dev/kbd 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.22 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, 17 May 2016 22:30:00 -0000 Author: glebius Date: Tue May 17 22:29:59 2016 New Revision: 300091 URL: https://svnweb.freebsd.org/changeset/base/300091 Log: Use unsigned version of min() when handling arguments of SETFKEY ioctl. Submitted by: C Turt Security: SA-16:18 Security: CVE-2016-1886 Modified: stable/10/sys/dev/kbd/kbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/kbd/kbd.c ============================================================================== --- stable/10/sys/dev/kbd/kbd.c Tue May 17 22:28:53 2016 (r300090) +++ stable/10/sys/dev/kbd/kbd.c Tue May 17 22:29:59 2016 (r300091) @@ -996,7 +996,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo splx(s); return (error); } - kbd->kb_fkeytab[fkeyp->keynum].len = imin(fkeyp->flen, MAXFK); + kbd->kb_fkeytab[fkeyp->keynum].len = min(fkeyp->flen, MAXFK); bcopy(fkeyp->keydef, kbd->kb_fkeytab[fkeyp->keynum].str, kbd->kb_fkeytab[fkeyp->keynum].len); break; From owner-svn-src-stable-10@freebsd.org Tue May 17 22:30:44 2016 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 DE1F1B40788; Tue, 17 May 2016 22:30:44 +0000 (UTC) (envelope-from glebius@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 AF56816E0; Tue, 17 May 2016 22:30:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HMUhLJ012407; Tue, 17 May 2016 22:30:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HMUhPm012406; Tue, 17 May 2016 22:30:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172230.u4HMUhPm012406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 22:30: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: r300092 - 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.22 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, 17 May 2016 22:30:45 -0000 Author: glebius Date: Tue May 17 22:30:43 2016 New Revision: 300092 URL: https://svnweb.freebsd.org/changeset/base/300092 Log: Validate that user supplied control message length is not negative. Submitted by: C Turt Security: SA-16:19 Security: CVE-2016-1887 Modified: stable/10/sys/kern/uipc_syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Tue May 17 22:29:59 2016 (r300091) +++ stable/10/sys/kern/uipc_syscalls.c Tue May 17 22:30:43 2016 (r300092) @@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type) struct mbuf *m; int error; + if (buflen < 0) + return (EINVAL); + if (buflen > MLEN) { #ifdef COMPAT_OLDSOCK if (type == MT_SONAME && buflen <= 112) From owner-svn-src-stable-10@freebsd.org Wed May 18 00:33:10 2016 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 2C614B3D5EC; Wed, 18 May 2016 00:33:10 +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 E64C61448; Wed, 18 May 2016 00:33:09 +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 u4I0X9eQ051794; Wed, 18 May 2016 00:33:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4I0X9pO051793; Wed, 18 May 2016 00:33:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605180033.u4I0X9pO051793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 May 2016 00:33:09 +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: r300099 - stable/10/sbin/fsck_msdosfs 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.22 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, 18 May 2016 00:33:10 -0000 Author: pfg Date: Wed May 18 00:33:08 2016 New Revision: 300099 URL: https://svnweb.freebsd.org/changeset/base/300099 Log: MFC r299089: fsck_msdosfs: Adjust a check. The on-disk FAT array does not include anything before CLUST_FIRST, compensate in size check. Obtained from: NetBSD (CVS Rev. 1.20) Modified: stable/10/sbin/fsck_msdosfs/boot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/boot.c Wed May 18 00:22:52 2016 (r300098) +++ stable/10/sbin/fsck_msdosfs/boot.c Wed May 18 00:33:08 2016 (r300099) @@ -221,7 +221,7 @@ readboot(int dosfs, struct bootblock *bo break; } - if (boot->NumFatEntries < boot->NumClusters) { + if (boot->NumFatEntries < boot->NumClusters - CLUST_FIRST) { pfatal("FAT size too small, %u entries won't fit into %u sectors\n", boot->NumClusters, boot->FATsecs); return FSFATAL; From owner-svn-src-stable-10@freebsd.org Wed May 18 11:51:19 2016 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 21311B405A9; Wed, 18 May 2016 11:51:19 +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 CEF331C82; Wed, 18 May 2016 11:51:18 +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 u4IBpILo058508; Wed, 18 May 2016 11:51:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IBpHbh058506; Wed, 18 May 2016 11:51:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181151.u4IBpHbh058506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 11:51: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: r300139 - in stable/10/sys: kern 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.22 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, 18 May 2016 11:51:19 -0000 Author: kib Date: Wed May 18 11:51:17 2016 New Revision: 300139 URL: https://svnweb.freebsd.org/changeset/base/300139 Log: MFC r299408: Style: wrap long lines. Modified: stable/10/sys/kern/vfs_hash.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_hash.c ============================================================================== --- stable/10/sys/kern/vfs_hash.c Wed May 18 10:59:16 2016 (r300138) +++ stable/10/sys/kern/vfs_hash.c Wed May 18 11:51:17 2016 (r300139) @@ -69,7 +69,8 @@ vfs_hash_bucket(const struct mount *mp, } int -vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp; int error; @@ -111,7 +112,8 @@ vfs_hash_remove(struct vnode *vp) } int -vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp2; int error; Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Wed May 18 10:59:16 2016 (r300138) +++ stable/10/sys/sys/vnode.h Wed May 18 11:51:17 2016 (r300139) @@ -844,9 +844,11 @@ int fifo_printinfo(struct vnode *); typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); void vfs_hash_changesize(int newhashsize); -int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_get(const struct mount *mp, u_int hash, int flags, + struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp); -int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-stable-10@freebsd.org Wed May 18 11:58:18 2016 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 45857B408CE; Wed, 18 May 2016 11:58:18 +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 F1DA4106B; Wed, 18 May 2016 11:58:17 +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 u4IBwHZp058916; Wed, 18 May 2016 11:58:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IBwH3R058914; Wed, 18 May 2016 11:58:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181158.u4IBwH3R058914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 11:58: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: r300140 - in stable/10/sys: kern 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.22 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, 18 May 2016 11:58:18 -0000 Author: kib Date: Wed May 18 11:58:16 2016 New Revision: 300140 URL: https://svnweb.freebsd.org/changeset/base/300140 Log: MFC r299412: Add vfs_hash_ref(9) function, which finds a vnode by the hash value and returns it referenced. Modified: stable/10/sys/kern/vfs_hash.c stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_hash.c ============================================================================== --- stable/10/sys/kern/vfs_hash.c Wed May 18 11:51:17 2016 (r300139) +++ stable/10/sys/kern/vfs_hash.c Wed May 18 11:58:16 2016 (r300140) @@ -103,6 +103,36 @@ vfs_hash_get(const struct mount *mp, u_i } void +vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +{ + struct vnode *vp; + + while (1) { + mtx_lock(&vfs_hash_mtx); + LIST_FOREACH(vp, vfs_hash_bucket(mp, hash), v_hashlist) { + if (vp->v_hash != hash) + continue; + if (vp->v_mount != mp) + continue; + if (fn != NULL && fn(vp, arg)) + continue; + vhold(vp); + mtx_unlock(&vfs_hash_mtx); + vref(vp); + vdrop(vp); + *vpp = vp; + return; + } + if (vp == NULL) { + mtx_unlock(&vfs_hash_mtx); + *vpp = NULL; + return; + } + } +} + +void vfs_hash_remove(struct vnode *vp) { Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Wed May 18 11:51:17 2016 (r300139) +++ stable/10/sys/sys/vnode.h Wed May 18 11:58:16 2016 (r300140) @@ -849,6 +849,8 @@ int vfs_hash_get(const struct mount *mp, u_int vfs_hash_index(struct vnode *vp); int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +void vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-stable-10@freebsd.org Wed May 18 12:02:07 2016 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 2E47FB3F2D9; Wed, 18 May 2016 12:02:07 +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 0A16E19E7; Wed, 18 May 2016 12:02:06 +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 u4IC26sW061837; Wed, 18 May 2016 12:02:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IC269g061835; Wed, 18 May 2016 12:02:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605181202.u4IC269g061835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 May 2016 12:02: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: r300141 - 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.22 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, 18 May 2016 12:02:07 -0000 Author: kib Date: Wed May 18 12:02:05 2016 New Revision: 300141 URL: https://svnweb.freebsd.org/changeset/base/300141 Log: MFC r299413: Use vfs_hash_ref(9) to eliminate LK_EXCLOTHER kludge. Modified: stable/10/sys/fs/nfsclient/nfs_clport.c stable/10/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clport.c Wed May 18 11:58:16 2016 (r300140) +++ stable/10/sys/fs/nfsclient/nfs_clport.c Wed May 18 12:02:05 2016 (r300141) @@ -279,7 +279,7 @@ nfscl_nget(struct mount *mntp, struct vn } /* - * Anothe variant of nfs_nget(). This one is only used by reopen. It + * Another variant of nfs_nget(). This one is only used by reopen. It * takes almost the same args as nfs_nget(), but only succeeds if an entry * exists in the cache. (Since files should already be "open" with a * vnode ref cnt on the node when reopen calls this, it should always @@ -318,21 +318,24 @@ nfscl_ngetreopen(struct mount *mntp, u_i NFSVOPUNLOCK(nvp, 0); } else if (error == EBUSY) { /* - * The LK_EXCLOTHER lock type tells nfs_lock1() to not try - * and lock the vnode, but just get a v_usecount on it. - * LK_NOWAIT is set so that when vget() returns ENOENT, - * vfs_hash_get() fails instead of looping. - * If this succeeds, it is safe so long as a vflush() with + * It is safe so long as a vflush() with * FORCECLOSE has not been done. Since the Renew thread is * stopped and the MNTK_UNMOUNTF flag is set before doing * a vflush() with FORCECLOSE, we should be ok here. */ if ((mntp->mnt_kern_flag & MNTK_UNMOUNTF)) error = EINTR; - else - error = vfs_hash_get(mntp, hash, - (LK_EXCLOTHER | LK_NOWAIT), td, &nvp, - newnfs_vncmpf, nfhp); + else { + vfs_hash_ref(mntp, hash, td, &nvp, newnfs_vncmpf, nfhp); + if (nvp == NULL) { + error = ENOENT; + } else if ((nvp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + vrele(nvp); + } else { + error = 0; + } + } } FREE(nfhp, M_NFSFH); if (error) Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 18 11:58:16 2016 (r300140) +++ stable/10/sys/fs/nfsclient/nfs_clvnops.c Wed May 18 12:02:05 2016 (r300141) @@ -139,7 +139,6 @@ static vop_rmdir_t nfs_rmdir; static vop_symlink_t nfs_symlink; static vop_readdir_t nfs_readdir; static vop_strategy_t nfs_strategy; -static vop_lock1_t nfs_lock1; static int nfs_lookitup(struct vnode *, char *, int, struct ucred *, struct thread *, struct nfsnode **); static int nfs_sillyrename(struct vnode *, struct vnode *, @@ -168,7 +167,6 @@ struct vop_vector newnfs_vnodeops = { .vop_putpages = ncl_putpages, .vop_inactive = ncl_inactive, .vop_link = nfs_link, - .vop_lock1 = nfs_lock1, .vop_lookup = nfs_lookup, .vop_mkdir = nfs_mkdir, .vop_mknod = nfs_mknod, @@ -3350,37 +3348,6 @@ struct buf_ops buf_ops_newnfs = { .bop_bdflush = bufbdflush, }; -/* - * Cloned from vop_stdlock(), and then the ugly hack added. - */ -static int -nfs_lock1(struct vop_lock1_args *ap) -{ - struct vnode *vp = ap->a_vp; - int error = 0; - - /* - * Since vfs_hash_get() calls vget() and it will no longer work - * for FreeBSD8 with flags == 0, I can only think of this horrible - * hack to work around it. I call vfs_hash_get() with LK_EXCLOTHER - * and then handle it here. All I want for this case is a v_usecount - * on the vnode to use for recovery, while another thread might - * hold a lock on the vnode. I have the other threads blocked, so - * there isn't any race problem. - */ - if ((ap->a_flags & LK_TYPE_MASK) == LK_EXCLOTHER) { - if ((ap->a_flags & LK_INTERLOCK) == 0) - panic("ncllock1"); - if ((vp->v_iflag & VI_DOOMED)) - error = ENOENT; - VI_UNLOCK(vp); - return (error); - } - return (_lockmgr_args(vp->v_vnlock, ap->a_flags, VI_MTX(vp), - LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, ap->a_file, - ap->a_line)); -} - static int nfs_getacl(struct vop_getacl_args *ap) { From owner-svn-src-stable-10@freebsd.org Wed May 18 20:55:05 2016 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 87ECCB3F86D; Wed, 18 May 2016 20:55:05 +0000 (UTC) (envelope-from bdrewery@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 581261E72; Wed, 18 May 2016 20:55:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IKt46K026981; Wed, 18 May 2016 20:55:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IKt43Y026980; Wed, 18 May 2016 20:55:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605182055.u4IKt43Y026980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 18 May 2016 20:55:04 +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: r300166 - stable/10/lib/libpam/modules 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.22 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, 18 May 2016 20:55:05 -0000 Author: bdrewery Date: Wed May 18 20:55:04 2016 New Revision: 300166 URL: https://svnweb.freebsd.org/changeset/base/300166 Log: MFC r297947: Build libpam modules in parallel. Modified: stable/10/lib/libpam/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpam/modules/Makefile ============================================================================== --- stable/10/lib/libpam/modules/Makefile Wed May 18 20:49:09 2016 (r300165) +++ stable/10/lib/libpam/modules/Makefile Wed May 18 20:55:04 2016 (r300166) @@ -27,5 +27,6 @@ .include "modules.inc" SUBDIR= ${MODULES} +SUBDIR_PARALLEL= .include From owner-svn-src-stable-10@freebsd.org Thu May 19 16:04:21 2016 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 A1151B41F6F; Thu, 19 May 2016 16:04:21 +0000 (UTC) (envelope-from asomers@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 58A961D85; Thu, 19 May 2016 16:04:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JG4Kut016358; Thu, 19 May 2016 16:04:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JG4KpV016356; Thu, 19 May 2016 16:04:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605191604.u4JG4KpV016356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 19 May 2016 16:04:20 +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: r300214 - in stable/10: sbin/devd sys/geom 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.22 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, 19 May 2016 16:04:21 -0000 Author: asomers Date: Thu May 19 16:04:20 2016 New Revision: 300214 URL: https://svnweb.freebsd.org/changeset/base/300214 Log: MFC r298420, r298439, r298644 r298420 | asomers | 2016-04-21 10:43:15 -0600 (Thu, 21 Apr 2016) | 10 lines Notify userspace listeners when geom disk attributes have changed sys/geom/geom_disk.c: disk_attr_changed(): Generate a devctl event of type GEOM: for every call. r298439 | asomers | 2016-04-21 15:13:41 -0600 (Thu, 21 Apr 2016) | 10 lines DRY on buffer sizes. Update to r298420. sys/geom/geom_disk.c: In disk_attr_changed, don't repeat a buffer size. r298644 | asomers | 2016-04-26 08:48:58 -0600 (Tue, 26 Apr 2016) | 8 lines Add GEOM::physpath documentation to devd.conf(5) Modified: stable/10/sbin/devd/devd.conf.5 stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.conf.5 ============================================================================== --- stable/10/sbin/devd/devd.conf.5 Thu May 19 16:02:02 2016 (r300213) +++ stable/10/sbin/devd/devd.conf.5 Thu May 19 16:04:20 2016 (r300214) @@ -424,6 +424,8 @@ device node is created. A .Xr geom 4 device node is destroyed. +.It Li GEOM::physpath +The physical path of a device has changed. .It Li MEDIACHANGE Physical media has changed. .El Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu May 19 16:02:02 2016 (r300213) +++ stable/10/sys/geom/geom_disk.c Thu May 19 16:04:20 2016 (r300214) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -861,11 +862,15 @@ disk_attr_changed(struct disk *dp, const { struct g_geom *gp; struct g_provider *pp; + char devnamebuf[128]; gp = dp->d_geom; if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) (void)g_attr_changed(pp, attr, flag); + snprintf(devnamebuf, sizeof(devnamebuf), "devname=%s%d", dp->d_name, + dp->d_unit); + devctl_notify("GEOM", "disk", attr, devnamebuf); } void From owner-svn-src-stable-10@freebsd.org Thu May 19 21:41:36 2016 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 77C55B421C1; Thu, 19 May 2016 21:41:36 +0000 (UTC) (envelope-from bdrewery@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 2B0231E35; Thu, 19 May 2016 21:41:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JLfZ1j020506; Thu, 19 May 2016 21:41:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLfZEM020505; Thu, 19 May 2016 21:41:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192141.u4JLfZEM020505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:41: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: r300233 - stable/10/share/mk 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.22 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, 19 May 2016 21:41:36 -0000 Author: bdrewery Date: Thu May 19 21:41:35 2016 New Revision: 300233 URL: https://svnweb.freebsd.org/changeset/base/300233 Log: Allow MK_ overrides. This is a direct commit to stable. This was done in head in r264661 and is needed to force certain options off for ports. PR: D6271 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.own.mk Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu May 19 21:08:33 2016 (r300232) +++ stable/10/share/mk/bsd.own.mk Thu May 19 21:41:35 2016 (r300233) @@ -483,9 +483,6 @@ __DEFAULT_NO_OPTIONS+=HYPERV .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITHOUT_${var}) MK_${var}:= no .else @@ -501,9 +498,6 @@ MK_${var}:= yes .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if defined(WITH_${var}) MK_${var}:= yes .else @@ -621,9 +615,6 @@ MK_TESTS:= no .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else @@ -640,9 +631,6 @@ MK_${var}_SUPPORT:= yes .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. .endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) @@ -661,9 +649,6 @@ MK_${vv:H}:= ${MK_${vv:T}} .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif -.if defined(MK_${var}) -.error MK_${var} can't be set by a user. -.endif .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no From owner-svn-src-stable-10@freebsd.org Thu May 19 21:47:33 2016 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 4D08EB423D7; Thu, 19 May 2016 21:47:33 +0000 (UTC) (envelope-from bdrewery@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 1A305138D; Thu, 19 May 2016 21:47:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JLlW43021453; Thu, 19 May 2016 21:47:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JLlWWU021452; Thu, 19 May 2016 21:47:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192147.u4JLlWWU021452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 21:47:32 +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: r300235 - 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.22 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, 19 May 2016 21:47:33 -0000 Author: bdrewery Date: Thu May 19 21:47:32 2016 New Revision: 300235 URL: https://svnweb.freebsd.org/changeset/base/300235 Log: Bump version for r300233 Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Thu May 19 21:44:33 2016 (r300234) +++ stable/10/sys/sys/param.h Thu May 19 21:47:32 2016 (r300235) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Thu May 19 22:53:45 2016 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 71F3FB42681; Thu, 19 May 2016 22:53:45 +0000 (UTC) (envelope-from bdrewery@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 3EAC5122B; Thu, 19 May 2016 22:53:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JMripE042643; Thu, 19 May 2016 22:53:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JMriro042642; Thu, 19 May 2016 22:53:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605192253.u4JMriro042642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 19 May 2016 22:53: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: r300243 - stable/10/share/mk 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.22 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, 19 May 2016 22:53:45 -0000 Author: bdrewery Date: Thu May 19 22:53:44 2016 New Revision: 300243 URL: https://svnweb.freebsd.org/changeset/base/300243 Log: Follow-up r300233: Don't override MK_* from env as head does. PR: D6271 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.own.mk Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu May 19 22:43:21 2016 (r300242) +++ stable/10/share/mk/bsd.own.mk Thu May 19 22:53:44 2016 (r300243) @@ -480,6 +480,7 @@ __DEFAULT_NO_OPTIONS+=HYPERV # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -488,6 +489,7 @@ MK_${var}:= no .else MK_${var}:= yes .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_YES_OPTIONS @@ -495,6 +497,7 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) .if defined(WITH_${var}) && defined(WITHOUT_${var}) .error WITH_${var} and WITHOUT_${var} can't both be set. .endif @@ -503,6 +506,7 @@ MK_${var}:= yes .else MK_${var}:= no .endif +.endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS From owner-svn-src-stable-10@freebsd.org Fri May 20 01:19:31 2016 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 EE3E1B43122; Fri, 20 May 2016 01:19:31 +0000 (UTC) (envelope-from rmacklem@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 A120410E6; Fri, 20 May 2016 01:19:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K1JU26085716; Fri, 20 May 2016 01:19:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K1JUHJ085715; Fri, 20 May 2016 01:19:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605200119.u4K1JUHJ085715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 May 2016 01:19:30 +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: r300254 - stable/10/sys/fs/nfsserver 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.22 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, 20 May 2016 01:19:32 -0000 Author: rmacklem Date: Fri May 20 01:19:30 2016 New Revision: 300254 URL: https://svnweb.freebsd.org/changeset/base/300254 Log: MFC: r299201 Give mountd -S priority over outstanding RPC requests when suspending the nfsd. It was reported via email that under certain heavy RPC loads long delays before the exports would be updated was observed when using "mountd -S". This patch reverses the priority between the exclusive lock request to suspend the nfsd threads and the shared lock request for performing RPCs. As such, when mountd attempts to suspend the nfsd threads, it gets priority over outstanding RPC requests to do this. I suspect that the case reported was an artificial test load, but this patch did fix the problem for the reporter. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:17:38 2016 (r300253) +++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri May 20 01:19:30 2016 (r300254) @@ -234,10 +234,16 @@ nfssvc_program(struct svc_req *rqst, SVC * Get a refcnt (shared lock) on nfsd_suspend_lock. * NFSSVC_SUSPENDNFSD will take an exclusive lock on * nfsd_suspend_lock to suspend these threads. + * The call to nfsv4_lock() that preceeds nfsv4_getref() + * ensures that the acquisition of the exclusive lock + * takes priority over acquisition of the shared lock by + * waiting for any exclusive lock request to complete. * This must be done here, before the check of * nfsv4root exports by nfsvno_v4rootexport(). */ NFSLOCKV4ROOTMUTEX(); + nfsv4_lock(&nfsd_suspend_lock, 0, NULL, NFSV4ROOTLOCKMUTEXPTR, + NULL); nfsv4_getref(&nfsd_suspend_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); NFSUNLOCKV4ROOTMUTEX(); From owner-svn-src-stable-10@freebsd.org Fri May 20 06:02:45 2016 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 8FA4EB41640; Fri, 20 May 2016 06:02:45 +0000 (UTC) (envelope-from truckman@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 6006C1967; Fri, 20 May 2016 06:02:45 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K62iOI074668; Fri, 20 May 2016 06:02:44 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K62ibt074667; Fri, 20 May 2016 06:02:44 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200602.u4K62ibt074667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:02: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: r300265 - stable/10/usr.bin/mklocale 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.22 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, 20 May 2016 06:02:45 -0000 Author: truckman Date: Fri May 20 06:02:44 2016 New Revision: 300265 URL: https://svnweb.freebsd.org/changeset/base/300265 Log: MFC r299524 Use strlcpy() instead of strncpy() when copying the encoding value to ensure that the destination is NUL terminated. Length truncation of one more character should not be an issue since encoding values that long are not supported by libc. The destination string is treated as a NUL terminated string, but it is only passed to strcmp() for comparison to a set of shorter, fixed length strings, so this is not a serious problem. Reported by: Coverity CID: 974769 Modified: stable/10/usr.bin/mklocale/yacc.y Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mklocale/yacc.y ============================================================================== --- stable/10/usr.bin/mklocale/yacc.y Fri May 20 05:33:26 2016 (r300264) +++ stable/10/usr.bin/mklocale/yacc.y Fri May 20 06:02:44 2016 (r300265) @@ -123,7 +123,7 @@ entry : ENCODING STRING strcmp($2, "BIG5") && strcmp($2, "MSKanji")) warnx("ENCODING %s is not supported by libc", $2); - strncpy(new_locale.encoding, $2, + strlcpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); } | VARIABLE { new_locale.variable_len = strlen($1) + 1; From owner-svn-src-stable-10@freebsd.org Fri May 20 06:05:21 2016 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 A9556B416E3; Fri, 20 May 2016 06:05:21 +0000 (UTC) (envelope-from truckman@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 7A4BA1BE4; Fri, 20 May 2016 06:05:21 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K65KFU075066; Fri, 20 May 2016 06:05:20 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K65KVa075065; Fri, 20 May 2016 06:05:20 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200605.u4K65KVa075065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:05:20 +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: r300266 - stable/10/usr.bin/msgs 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.22 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, 20 May 2016 06:05:21 -0000 Author: truckman Date: Fri May 20 06:05:20 2016 New Revision: 300266 URL: https://svnweb.freebsd.org/changeset/base/300266 Log: MFC r299525 Use strlcpy() instead of strncpy() when copying date and subj to ensure that these are properly NUL terminated since they are passed to printf(). Reported by: Coverity CID: 974770 Modified: stable/10/usr.bin/msgs/msgs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/msgs/msgs.c ============================================================================== --- stable/10/usr.bin/msgs/msgs.c Fri May 20 06:02:44 2016 (r300265) +++ stable/10/usr.bin/msgs/msgs.c Fri May 20 06:05:20 2016 (r300266) @@ -855,7 +855,7 @@ gfrsub(FILE *infile) } *ptr = '\0'; if (*(in = nxtfld(in))) - strncpy(date, in, sizeof date); + strlcpy(date, in, sizeof date); else { date[0] = '\n'; date[1] = '\0'; @@ -886,7 +886,7 @@ gfrsub(FILE *infile) if (!seensubj && strncmp(inbuf, "Subj", 4)==0) { seensubj = YES; frompos = ftello(infile); - strncpy(subj, nxtfld(inbuf), sizeof subj); + strlcpy(subj, nxtfld(inbuf), sizeof subj); } } if (!blankline) @@ -899,7 +899,7 @@ gfrsub(FILE *infile) /* * for possible use with Mail */ - strncpy(subj, "(No Subject)\n", sizeof subj); + strlcpy(subj, "(No Subject)\n", sizeof subj); } static char * From owner-svn-src-stable-10@freebsd.org Fri May 20 06:19:01 2016 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 C4E5CB41A72; Fri, 20 May 2016 06:19:01 +0000 (UTC) (envelope-from truckman@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 9F346127F; Fri, 20 May 2016 06:19:01 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6J0HM078588; Fri, 20 May 2016 06:19:00 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6J0lW078587; Fri, 20 May 2016 06:19:00 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200619.u4K6J0lW078587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:19: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: r300268 - stable/10/usr.sbin/ypbind 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.22 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, 20 May 2016 06:19:01 -0000 Author: truckman Date: Fri May 20 06:19:00 2016 New Revision: 300268 URL: https://svnweb.freebsd.org/changeset/base/300268 Log: MFC r290903, r299573 r290903 is needed to prevent a conflict whem merging r299573 r290903 | araujo | 2015-11-15 19:18:40 -0800 (Sun, 15 Nov 2015) | 5 lines Don't need cast malloc. r299573 | truckman | 2016-05-12 14:35:40 -0700 (Thu, 12 May 2016) | 10 lines Use strlcpy() instead of strncpy() when copying to dom_domain to ensure that the latter is NUL terminated since it is passed as an argument to *printf(). Warn about NIS domains that are too long. Reported by: Coverity CID: 1009620, 1009621 Modified: stable/10/usr.sbin/ypbind/ypbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypbind/ypbind.c ============================================================================== --- stable/10/usr.sbin/ypbind/ypbind.c Fri May 20 06:06:21 2016 (r300267) +++ stable/10/usr.sbin/ypbind/ypbind.c Fri May 20 06:19:00 2016 (r300268) @@ -199,14 +199,19 @@ rejecting.", *argp); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (&res); } - ypdb = (struct _dom_binding *)malloc(sizeof *ypdb); + if (strlen(*argp) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", *argp); + res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; + return (&res); + } + ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (&res); } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); ypdb->dom_vers = YPVERS; ypdb->dom_alive = 0; ypdb->dom_default = 0; @@ -412,6 +417,9 @@ main(int argc, char *argv[]) errx(1, "unknown option: %s", argv[i]); } + if (strlen(domain_name) > YPMAXDOMAIN) + warnx("truncating domain name %s", domain_name); + /* blow away everything in BINDINGDIR (if it exists) */ if ((dird = opendir(BINDINGDIR)) != NULL) { @@ -448,11 +456,11 @@ main(int argc, char *argv[]) errx(1, "unable to register (YPBINDPROG, YPBINDVERS, tcp)"); /* build initial domain binding, make it "unsuccessful" */ - ypbindlist = (struct _dom_binding *)malloc(sizeof *ypbindlist); + ypbindlist = malloc(sizeof *ypbindlist); if (ypbindlist == NULL) errx(1, "malloc"); bzero(ypbindlist, sizeof *ypbindlist); - strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); + strlcpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); ypbindlist->dom_vers = YPVERS; ypbindlist->dom_alive = 0; ypbindlist->dom_lockfd = -1; @@ -883,13 +891,17 @@ rpc_received(char *dom, struct sockaddr_ if (ypdb == NULL) { if (force == 0) return; - ypdb = (struct _dom_binding *)malloc(sizeof *ypdb); + if (strlen(dom) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", dom); + return; + } + ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); return; } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); ypdb->dom_lockfd = -1; ypdb->dom_default = 0; ypdb->dom_pnext = ypbindlist; From owner-svn-src-stable-10@freebsd.org Fri May 20 06:24:17 2016 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 AB818B41C5A; Fri, 20 May 2016 06:24:17 +0000 (UTC) (envelope-from truckman@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 6C7191797; Fri, 20 May 2016 06:24:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6OGAa081582; Fri, 20 May 2016 06:24:16 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6OGQN081581; Fri, 20 May 2016 06:24:16 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200624.u4K6OGQN081581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:24: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: r300269 - stable/10/usr.bin/catman 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.22 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, 20 May 2016 06:24:17 -0000 Author: truckman Date: Fri May 20 06:24:16 2016 New Revision: 300269 URL: https://svnweb.freebsd.org/changeset/base/300269 Log: MFC r299577, r299578, r299589 r299577 | truckman | 2016-05-12 16:14:31 -0700 (Thu, 12 May 2016) | 15 lines Avoid Coverity NUL termination warning about strncpy() by using memcpy() instead. It's probably a bit more optimal in this case anyway. [1] The program logic leading up to the creation of the strncpy/memcpy destination buffer is a bit hairy. Add a call to assert() to make it clear what is happening here and detect any potential buffer overruns in the future. Check a couple syscall error returns. Ignore the EEXIST error from link() to preserve existing behavior. [2] [3] r299578 | truckman | 2016-05-12 16:37:58 -0700 (Thu, 12 May 2016) | 2 lines If fchdir() fails, call err() instead of warn(). r299589 | truckman | 2016-05-12 22:49:02 -0700 (Thu, 12 May 2016) | 4 lines Instead of ignoring the EEXIST from link(), unconditionally unlink the terget before calling link(). This should prevent links to an old copy of the file from being retained. Reported by: Coverity CID: 1009659 [1], 1009349 [2], 1009350 [3] Modified: stable/10/usr.bin/catman/catman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/catman/catman.c ============================================================================== --- stable/10/usr.bin/catman/catman.c Fri May 20 06:19:00 2016 (r300268) +++ stable/10/usr.bin/catman/catman.c Fri May 20 06:24:16 2016 (r300269) @@ -34,9 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -267,7 +269,8 @@ get_cat_section(char *section) char *cat_section; cat_section = strdup(section); - strncpy(cat_section, "cat", 3); + assert(strlen(section) > 3 && strncmp(section, "man", 3) == 0); + memcpy(cat_section, "cat", 3); return cat_section; } @@ -419,8 +422,11 @@ process_page(char *mandir, char *src, ch fprintf(stderr, "%slink %s -> %s\n", verbose ? "\t" : "", cat, link_name); } - if (!pretend) - link(link_name, cat); + if (!pretend) { + (void) unlink(cat); + if (link(link_name, cat) < 0) + warn("%s %s: link", link_name, cat); + } return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); @@ -608,7 +614,8 @@ select_sections(const struct dirent *ent static void process_mandir(char *dir_name, char *section) { - fchdir(starting_dir); + if (fchdir(starting_dir) < 0) + err(1, "fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); From owner-svn-src-stable-10@freebsd.org Fri May 20 06:28:00 2016 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 08BFBB41D7C; Fri, 20 May 2016 06:28:00 +0000 (UTC) (envelope-from truckman@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 CDB381A1F; Fri, 20 May 2016 06:27:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6Rx7C081783; Fri, 20 May 2016 06:27:59 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6Rxkh081782; Fri, 20 May 2016 06:27:59 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200627.u4K6Rxkh081782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06: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: r300270 - stable/10/usr.sbin/edquota 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.22 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, 20 May 2016 06:28:00 -0000 Author: truckman Date: Fri May 20 06:27:58 2016 New Revision: 300270 URL: https://svnweb.freebsd.org/changeset/base/300270 Log: MFC r299579 Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL terminated. Don't bother checking for truncation since the subsequent quota_read() should detect that and fail. Reported by: Coverity CID: 1009980 Modified: stable/10/usr.sbin/edquota/edquota.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/edquota/edquota.c ============================================================================== --- stable/10/usr.sbin/edquota/edquota.c Fri May 20 06:24:16 2016 (r300269) +++ stable/10/usr.sbin/edquota/edquota.c Fri May 20 06:27:58 2016 (r300270) @@ -390,7 +390,7 @@ getprivs(long id, int quotatype, char *f if ((qup = (struct quotause *)calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); qup->qf = qf; - strncpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); + strlcpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); if (quota_read(qf, &qup->dqblk, id) == -1) { warn("cannot read quotas on %s", fs->fs_file); freeprivs(qup); From owner-svn-src-stable-10@freebsd.org Fri May 20 06:33:03 2016 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 6367CB381DA; Fri, 20 May 2016 06:33:03 +0000 (UTC) (envelope-from truckman@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 304C810A5; Fri, 20 May 2016 06:33:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6X23t084711; Fri, 20 May 2016 06:33:02 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6X2bG084710; Fri, 20 May 2016 06:33:02 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200633.u4K6X2bG084710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:33:02 +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: r300271 - stable/10/usr.sbin/timed/timed 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.22 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, 20 May 2016 06:33:03 -0000 Author: truckman Date: Fri May 20 06:33:02 2016 New Revision: 300271 URL: https://svnweb.freebsd.org/changeset/base/300271 Log: MFC r299580 Use strlcpy() instead of strncpy() to ensure that ret->name is NUL terminated. The source and destination buffers are the same size and the source *should* be NUL terminated, but be paranoid. Reported by: Coverity CID: 1011274 Modified: stable/10/usr.sbin/timed/timed/master.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/timed/timed/master.c ============================================================================== --- stable/10/usr.sbin/timed/timed/master.c Fri May 20 06:27:58 2016 (r300270) +++ stable/10/usr.sbin/timed/timed/master.c Fri May 20 06:33:02 2016 (r300271) @@ -623,7 +623,7 @@ addmach(char *name, struct sockaddr_in * } ret->addr = *addr; ret->ntp = ntp; - (void)strncpy(ret->name, name, sizeof(ret->name)); + (void)strlcpy(ret->name, name, sizeof(ret->name)); ret->good = good_host_name(name); ret->l_fwd = &self; ret->l_bak = self.l_bak; From owner-svn-src-stable-10@freebsd.org Fri May 20 06:35:15 2016 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 4BA11B3829D; Fri, 20 May 2016 06:35:15 +0000 (UTC) (envelope-from truckman@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 1B688122D; Fri, 20 May 2016 06:35:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6ZEvx084844; Fri, 20 May 2016 06:35:14 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6ZEs3084843; Fri, 20 May 2016 06:35:14 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200635.u4K6ZEs3084843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:35: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: r300272 - stable/10/lib/libutil 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.22 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, 20 May 2016 06:35:15 -0000 Author: truckman Date: Fri May 20 06:35:14 2016 New Revision: 300272 URL: https://svnweb.freebsd.org/changeset/base/300272 Log: MFC r299581 Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189 Modified: stable/10/lib/libutil/quotafile.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/quotafile.c ============================================================================== --- stable/10/lib/libutil/quotafile.c Fri May 20 06:33:02 2016 (r300271) +++ stable/10/lib/libutil/quotafile.c Fri May 20 06:35:14 2016 (r300272) @@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotaty return (NULL); qf->fd = -1; qf->quotatype = quotatype; - strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); if (stat(qf->fsname, &st) != 0) goto error; qf->dev = st.st_dev; From owner-svn-src-stable-10@freebsd.org Fri May 20 06:38:47 2016 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 BE083B38454; Fri, 20 May 2016 06:38:47 +0000 (UTC) (envelope-from truckman@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 8B8D614BB; Fri, 20 May 2016 06:38:47 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6ckcK085004; Fri, 20 May 2016 06:38:46 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6ckT7085003; Fri, 20 May 2016 06:38:46 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200638.u4K6ckT7085003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:38: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: r300273 - stable/10/libexec/ftpd 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.22 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, 20 May 2016 06:38:47 -0000 Author: truckman Date: Fri May 20 06:38:46 2016 New Revision: 300273 URL: https://svnweb.freebsd.org/changeset/base/300273 Log: MFC r299585 Declare line[] in the outermost scope of retrieve() instead of declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by: Coverity CID: 605895 Modified: stable/10/libexec/ftpd/ftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Fri May 20 06:35:14 2016 (r300272) +++ stable/10/libexec/ftpd/ftpd.c Fri May 20 06:38:46 2016 (r300273) @@ -1671,14 +1671,14 @@ retrieve(char *cmd, char *name) struct stat st; int (*closefunc)(FILE *); time_t start; + char line[BUFSIZ]; if (cmd == 0) { fin = fopen(name, "r"), closefunc = fclose; st.st_size = 0; } else { - char line[BUFSIZ]; - - (void) snprintf(line, sizeof(line), cmd, name), name = line; + (void) snprintf(line, sizeof(line), cmd, name); + name = line; fin = ftpd_popen(line, "r"), closefunc = ftpd_pclose; st.st_size = -1; st.st_blksize = BUFSIZ; From owner-svn-src-stable-10@freebsd.org Fri May 20 06:41:28 2016 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 33DF2B384EA; Fri, 20 May 2016 06:41:28 +0000 (UTC) (envelope-from truckman@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 EDAFA18EF; Fri, 20 May 2016 06:41:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6fRBI087756; Fri, 20 May 2016 06:41:27 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6fRbu087755; Fri, 20 May 2016 06:41:27 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200641.u4K6fRbu087755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:41:27 +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: r300274 - stable/10/usr.bin/mail 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.22 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, 20 May 2016 06:41:28 -0000 Author: truckman Date: Fri May 20 06:41:26 2016 New Revision: 300274 URL: https://svnweb.freebsd.org/changeset/base/300274 Log: MFC r299591 Always return either a dynamically allocated string or NULL from expand(). Never return the name parameter, which could be a the buf[] buffer which is allocated on the stack by getdeadletter() and which would then be used after getdeadletter() has returned. Reported by: Coverity CID: 1199383 Modified: stable/10/usr.bin/mail/fio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mail/fio.c ============================================================================== --- stable/10/usr.bin/mail/fio.c Fri May 20 06:38:46 2016 (r300273) +++ stable/10/usr.bin/mail/fio.c Fri May 20 06:41:26 2016 (r300274) @@ -367,10 +367,10 @@ expand(char *name) name = savestr(xname); } if (!strpbrk(name, "~{[*?$`'\"\\")) - return (name); + return (savestr(name)); if (pipe(pivec) < 0) { warn("pipe"); - return (name); + return (NULL); } (void)snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name); if ((sh = value("SHELL")) == NULL) From owner-svn-src-stable-10@freebsd.org Fri May 20 06:43:56 2016 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 62D0EB38670; Fri, 20 May 2016 06:43:56 +0000 (UTC) (envelope-from truckman@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 2FF641B84; Fri, 20 May 2016 06:43:56 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6htUD087888; Fri, 20 May 2016 06:43:55 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6htf2087887; Fri, 20 May 2016 06:43:55 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200643.u4K6htf2087887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:43:55 +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: r300275 - stable/10/usr.sbin/mptutil 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.22 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, 20 May 2016 06:43:56 -0000 Author: truckman Date: Fri May 20 06:43:55 2016 New Revision: 300275 URL: https://svnweb.freebsd.org/changeset/base/300275 Log: MFC r299592 Move a call to cam_freeccb() to avoid a use after free error and a later double free. Reported by: Coverity CID: 1018507 Modified: stable/10/usr.sbin/mptutil/mpt_cam.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- stable/10/usr.sbin/mptutil/mpt_cam.c Fri May 20 06:41:26 2016 (r300274) +++ stable/10/usr.sbin/mptutil/mpt_cam.c Fri May 20 06:43:55 2016 (r300275) @@ -260,7 +260,6 @@ fetch_scsi_capacity(struct cam_device *d cam_freeccb(ccb); return (EIO); } - cam_freeccb(ccb); /* * A last block of 2^32-1 means that the true capacity is over 2TB, @@ -269,6 +268,7 @@ fetch_scsi_capacity(struct cam_device *d */ if (scsi_4btoul(rcap.addr) != 0xffffffff) { disk->maxlba = scsi_4btoul(rcap.addr); + cam_freeccb(ccb); return (0); } From owner-svn-src-stable-10@freebsd.org Fri May 20 06:47:43 2016 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 32626B387A6; Fri, 20 May 2016 06:47:43 +0000 (UTC) (envelope-from truckman@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 03F831DC6; Fri, 20 May 2016 06:47:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6lgC3088104; Fri, 20 May 2016 06:47:42 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6lgee088103; Fri, 20 May 2016 06:47:42 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200647.u4K6lgee088103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:47:42 +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: r300276 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 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, 20 May 2016 06:47:43 -0000 Author: truckman Date: Fri May 20 06:47:42 2016 New Revision: 300276 URL: https://svnweb.freebsd.org/changeset/base/300276 Log: MFC r299593 Properly compute the size argument to pass to malloc(). Reported by: Coverity CID: 1198856 Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:43:55 2016 (r300275) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:47:42 2016 (r300276) @@ -798,7 +798,7 @@ parse_server(char *opt_arg) return (-1); if (snmp_client.trans > SNMP_TRANS_UDP && snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL + 1))) + if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); From owner-svn-src-stable-10@freebsd.org Fri May 20 06:55:00 2016 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 6AD55B38959; Fri, 20 May 2016 06:55:00 +0000 (UTC) (envelope-from truckman@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 3BAB011B8; Fri, 20 May 2016 06:55:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6sx7m091027; Fri, 20 May 2016 06:54:59 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6sx6N091026; Fri, 20 May 2016 06:54:59 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200654.u4K6sx6N091026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:54: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: r300278 - 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.22 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, 20 May 2016 06:55:00 -0000 Author: truckman Date: Fri May 20 06:54:59 2016 New Revision: 300278 URL: https://svnweb.freebsd.org/changeset/base/300278 Log: MFC r299865 When handling SIOCSIFNAME ensure that the new interface name is NUL terminated. Reject the rename attempt if the name is too long. 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 Fri May 20 06:54:58 2016 (r300277) +++ stable/10/sys/net/if.c Fri May 20 06:54:59 2016 (r300278) @@ -2434,6 +2434,11 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); if (new_name[0] == '\0') return (EINVAL); + if (new_name[IFNAMSIZ-1] != '\0') { + new_name[IFNAMSIZ-1] = '\0'; + if (strlen(new_name) == IFNAMSIZ-1) + return (EINVAL); + } if (ifunit(new_name) != NULL) return (EEXIST); From owner-svn-src-stable-10@freebsd.org Fri May 20 06:56:44 2016 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 C957CB38ACE; Fri, 20 May 2016 06:56:44 +0000 (UTC) (envelope-from truckman@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 9B7F5165F; Fri, 20 May 2016 06:56:44 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6uhFb091159; Fri, 20 May 2016 06:56:43 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K6uhZs091158; Fri, 20 May 2016 06:56:43 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200656.u4K6uhZs091158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 06:56: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: r300279 - stable/10/usr.sbin/lmcconfig 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.22 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, 20 May 2016 06:56:44 -0000 Author: truckman Date: Fri May 20 06:56:43 2016 New Revision: 300279 URL: https://svnweb.freebsd.org/changeset/base/300279 Log: MFC 299866 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974852 Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:54:59 2016 (r300278) +++ stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:56:43 2016 (r300279) @@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct io { int error = 0; - strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); + strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); iohdr->cookie = NGM_LMC_COOKIE; iohdr->iohdr = iohdr; From owner-svn-src-stable-10@freebsd.org Fri May 20 07:00:13 2016 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 0989AB38E14; Fri, 20 May 2016 07:00:13 +0000 (UTC) (envelope-from truckman@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 B54AF1BA4; Fri, 20 May 2016 07:00:12 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K70BYT091416; Fri, 20 May 2016 07:00:11 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K70BGZ091414; Fri, 20 May 2016 07:00:11 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200700.u4K70BGZ091414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:00: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: r300281 - stable/10/usr.sbin/rtadvd 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.22 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, 20 May 2016 07:00:13 -0000 Author: truckman Date: Fri May 20 07:00:11 2016 New Revision: 300281 URL: https://svnweb.freebsd.org/changeset/base/300281 Log: MFC r299867 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974860, 1009972, 1009973 Modified: stable/10/usr.sbin/rtadvd/config.c stable/10/usr.sbin/rtadvd/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/config.c ============================================================================== --- stable/10/usr.sbin/rtadvd/config.c Fri May 20 06:59:38 2016 (r300280) +++ stable/10/usr.sbin/rtadvd/config.c Fri May 20 07:00:11 2016 (r300281) @@ -634,7 +634,7 @@ getconfig_free_pfx: exit(1); } memset(&ndi, 0, sizeof(ndi)); - strncpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); + strlcpy(ndi.ifname, ifi->ifi_ifname, sizeof(ndi.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s", __func__, ifi->ifi_ifname, strerror(errno)); Modified: stable/10/usr.sbin/rtadvd/if.c ============================================================================== --- stable/10/usr.sbin/rtadvd/if.c Fri May 20 06:59:38 2016 (r300280) +++ stable/10/usr.sbin/rtadvd/if.c Fri May 20 07:00:11 2016 (r300281) @@ -388,7 +388,7 @@ update_ifinfo_nd_flags(struct ifinfo *if } /* ND flags */ memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifi->ifi_ifname, + strlcpy(nd.ifname, ifi->ifi_ifname, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd); if (error) { @@ -517,7 +517,7 @@ update_ifinfo(struct ifilist_head_t *ifi if (ifi->ifi_phymtu == 0) { memset(&ifr, 0, sizeof(ifr)); ifr.ifr_addr.sa_family = AF_INET6; - strncpy(ifr.ifr_name, ifi->ifi_ifname, + strlcpy(ifr.ifr_name, ifi->ifi_ifname, sizeof(ifr.ifr_name)); error = ioctl(s, SIOCGIFMTU, (caddr_t)&ifr); if (error) { From owner-svn-src-stable-10@freebsd.org Fri May 20 07:08:20 2016 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 5C529B42179; Fri, 20 May 2016 07:08:20 +0000 (UTC) (envelope-from truckman@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 115351214; Fri, 20 May 2016 07:08:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K78JRr094362; Fri, 20 May 2016 07:08:19 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K78JaY094361; Fri, 20 May 2016 07:08:19 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200708.u4K78JaY094361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:08: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: r300283 - stable/10/usr.sbin/rtsold 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.22 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, 20 May 2016 07:08:20 -0000 Author: truckman Date: Fri May 20 07:08:19 2016 New Revision: 300283 URL: https://svnweb.freebsd.org/changeset/base/300283 Log: MFC r299868 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 991863, 991864, 991865 Modified: stable/10/usr.sbin/rtsold/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtsold/if.c ============================================================================== --- stable/10/usr.sbin/rtsold/if.c Fri May 20 07:07:27 2016 (r300282) +++ stable/10/usr.sbin/rtsold/if.c Fri May 20 07:08:19 2016 (r300283) @@ -83,7 +83,7 @@ interface_up(char *name) int s; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, name, sizeof(nd.ifname)); @@ -181,7 +181,7 @@ interface_status(struct ifinfo *ifinfo) /* get interface flags */ memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) { warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s", ifname, strerror(errno)); @@ -197,7 +197,7 @@ interface_status(struct ifinfo *ifinfo) if (!ifinfo->mediareqok) goto active; memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name)); if (ioctl(ifsock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { if (errno != EINVAL) { @@ -401,7 +401,7 @@ get_llflag(const char *name) continue; memset(&ifr6, 0, sizeof(ifr6)); - strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); + strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { warnmsg(LOG_ERR, __func__, From owner-svn-src-stable-10@freebsd.org Fri May 20 07:11:05 2016 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 6F703B42227; Fri, 20 May 2016 07:11:05 +0000 (UTC) (envelope-from truckman@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 3F1081532; Fri, 20 May 2016 07:11:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7B41n096495; Fri, 20 May 2016 07:11:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7B4qD096494; Fri, 20 May 2016 07:11:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200711.u4K7B4qD096494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:11:04 +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: r300284 - stable/10/usr.sbin/route6d 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.22 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, 20 May 2016 07:11:05 -0000 Author: truckman Date: Fri May 20 07:11:04 2016 New Revision: 300284 URL: https://svnweb.freebsd.org/changeset/base/300284 Log: MFC r299869 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 1009974 Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri May 20 07:08:19 2016 (r300283) +++ stable/10/usr.sbin/route6d/route6d.c Fri May 20 07:11:04 2016 (r300284) @@ -1593,7 +1593,7 @@ ifconfig1(const char *name, if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) return (-1); ifr.ifr_addr = *sin6; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK_IN6, (char *)&ifr) < 0) { syslog(LOG_INFO, "ioctl: SIOCGIFNETMASK_IN6"); return (-1); From owner-svn-src-stable-10@freebsd.org Fri May 20 07:14:05 2016 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 DD6E9B423FA; Fri, 20 May 2016 07:14:05 +0000 (UTC) (envelope-from truckman@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 A617018EC; Fri, 20 May 2016 07:14:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7E45i097380; Fri, 20 May 2016 07:14:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7E3YW097369; Fri, 20 May 2016 07:14:03 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200714.u4K7E3YW097369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:14:03 +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: r300285 - stable/10/sbin/ifconfig 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.22 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, 20 May 2016 07:14:06 -0000 Author: truckman Date: Fri May 20 07:14:03 2016 New Revision: 300285 URL: https://svnweb.freebsd.org/changeset/base/300285 Log: MFC r299873 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Use sizeof(destination) in a few places instead of IFNAMSIZ. Cast afp->af_ridreq and afp->af_addreq to make the intent of the code more obvious. Reported by: Coverity CID: 1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638 CID: 1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645 CID: 1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053 CID: 1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298 CID: 1011299, 1305821, 1351720, 1351721 Modified: stable/10/sbin/ifconfig/af_inet.c stable/10/sbin/ifconfig/af_inet6.c stable/10/sbin/ifconfig/af_nd6.c stable/10/sbin/ifconfig/ifclone.c stable/10/sbin/ifconfig/ifconfig.c stable/10/sbin/ifconfig/iffib.c stable/10/sbin/ifconfig/ifgre.c stable/10/sbin/ifconfig/ifieee80211.c stable/10/sbin/ifconfig/ifmac.c stable/10/sbin/ifconfig/ifmedia.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/af_inet.c ============================================================================== --- stable/10/sbin/ifconfig/af_inet.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_inet.c Fri May 20 07:14:03 2016 (r300285) @@ -152,7 +152,7 @@ in_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &ifr.ifr_addr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, IFNAMSIZ); + strlcpy(ifr.ifr_name, name, IFNAMSIZ); if (ioctl(s, SIOCGIFPSRCADDR, (caddr_t)&ifr) < 0) return; @@ -177,7 +177,7 @@ in_set_tunnel(int s, struct addrinfo *sr struct in_aliasreq addreq; memset(&addreq, 0, sizeof(addreq)); - strncpy(addreq.ifra_name, name, IFNAMSIZ); + strlcpy(addreq.ifra_name, name, IFNAMSIZ); memcpy(&addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: stable/10/sbin/ifconfig/af_inet6.c ============================================================================== --- stable/10/sbin/ifconfig/af_inet6.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_inet6.c Fri May 20 07:14:03 2016 (r300285) @@ -185,7 +185,7 @@ in6_status(int s __unused, const struct if (sin == NULL) return; - strncpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); + strlcpy(ifr6.ifr_name, ifr.ifr_name, sizeof(ifr.ifr_name)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { warn("socket(AF_INET6,SOCK_DGRAM)"); return; @@ -422,7 +422,7 @@ in6_status_tunnel(int s) const struct sockaddr *sa = (const struct sockaddr *) &in6_ifr.ifr_addr; memset(&in6_ifr, 0, sizeof(in6_ifr)); - strncpy(in6_ifr.ifr_name, name, IFNAMSIZ); + strlcpy(in6_ifr.ifr_name, name, sizeof(in6_ifr.ifr_name)); if (ioctl(s, SIOCGIFPSRCADDR_IN6, (caddr_t)&in6_ifr) < 0) return; @@ -449,7 +449,7 @@ in6_set_tunnel(int s, struct addrinfo *s struct in6_aliasreq in6_addreq; memset(&in6_addreq, 0, sizeof(in6_addreq)); - strncpy(in6_addreq.ifra_name, name, IFNAMSIZ); + strlcpy(in6_addreq.ifra_name, name, sizeof(in6_addreq.ifra_name)); memcpy(&in6_addreq.ifra_addr, srcres->ai_addr, srcres->ai_addr->sa_len); memcpy(&in6_addreq.ifra_dstaddr, dstres->ai_addr, dstres->ai_addr->sa_len); Modified: stable/10/sbin/ifconfig/af_nd6.c ============================================================================== --- stable/10/sbin/ifconfig/af_nd6.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/af_nd6.c Fri May 20 07:14:03 2016 (r300285) @@ -75,7 +75,7 @@ setnd6flags(const char *dummyaddr __unus int error; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); error = ioctl(s, SIOCGIFINFO_IN6, &nd); if (error) { warn("ioctl(SIOCGIFINFO_IN6)"); @@ -100,7 +100,7 @@ setnd6defif(const char *dummyaddr __unus int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); if (d < 0) { if (isnd6defif(s)) { @@ -127,7 +127,7 @@ isnd6defif(int s) int error; memset(&ndifreq, 0, sizeof(ndifreq)); - strncpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); + strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); ifindex = if_nametoindex(ndifreq.ifname); error = ioctl(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq); @@ -147,7 +147,7 @@ nd6_status(int s) int isdefif; memset(&nd, 0, sizeof(nd)); - strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); + strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); Modified: stable/10/sbin/ifconfig/ifclone.c ============================================================================== --- stable/10/sbin/ifconfig/ifclone.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifclone.c Fri May 20 07:14:03 2016 (r300285) @@ -162,7 +162,7 @@ DECL_CMD_FUNC(clone_create, arg, d) static DECL_CMD_FUNC(clone_destroy, arg, d) { - (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) err(1, "SIOCIFDESTROY"); } Modified: stable/10/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifconfig.c Fri May 20 07:14:03 2016 (r300285) @@ -304,7 +304,7 @@ main(int argc, char *argv[]) ifindex = 0; for (ifa = ifap; ifa; ifa = ifa->ifa_next) { memset(&paifr, 0, sizeof(paifr)); - strncpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); + strlcpy(paifr.ifr_name, ifa->ifa_name, sizeof(paifr.ifr_name)); if (sizeof(paifr.ifr_addr) >= ifa->ifa_addr->sa_len) { memcpy(&paifr.ifr_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len); @@ -502,7 +502,7 @@ ifconfig(int argc, char *const *argv, in struct callback *cb; int s; - strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); + strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; if (uafp != NULL) afp = uafp; @@ -623,7 +623,8 @@ top: } if (clearaddr) { int ret; - strncpy(afp->af_ridreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, + sizeof ifr.ifr_name); ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); if (ret < 0) { if (errno == EADDRNOTAVAIL && (doalias >= 0)) { @@ -640,7 +641,8 @@ top: } } if (newaddr && (setaddr || setmask)) { - strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); + strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, + sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } @@ -850,7 +852,7 @@ static void setifmetric(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_metric = atoi(val); if (ioctl(s, SIOCSIFMETRIC, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMETRIC (set metric)"); @@ -860,7 +862,7 @@ static void setifmtu(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_mtu = atoi(val); if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) < 0) err(1, "ioctl SIOCSIFMTU (set mtu)"); @@ -872,7 +874,7 @@ setifname(const char *val, int dummy __u { char *newname; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); newname = strdup(val); if (newname == NULL) @@ -894,7 +896,7 @@ setifdescr(const char *val, int dummy __ { char *newdescr; - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_buffer.length = strlen(val) + 1; if (ifr.ifr_buffer.length == 1) { @@ -954,7 +956,7 @@ status(const struct afswtch *afp, const ifr.ifr_addr.sa_family = afp->af_af == AF_LINK ? AF_LOCAL : afp->af_af; } - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0); if (s < 0) @@ -1036,7 +1038,7 @@ status(const struct afswtch *afp, const else if (afp->af_other_status != NULL) afp->af_other_status(s); - strncpy(ifs.ifs_name, name, sizeof ifs.ifs_name); + strlcpy(ifs.ifs_name, name, sizeof ifs.ifs_name); if (ioctl(s, SIOCGIFSTATUS, &ifs) == 0) printf("%s", ifs.ascii); Modified: stable/10/sbin/ifconfig/iffib.c ============================================================================== --- stable/10/sbin/ifconfig/iffib.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/iffib.c Fri May 20 07:14:03 2016 (r300285) @@ -49,13 +49,13 @@ fib_status(int s) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\tfib: %u\n", ifr.ifr_fib); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGTUNFIB, (caddr_t)&ifr) == 0 && ifr.ifr_fib != RT_DEFAULT_FIB) printf("\ttunnelfib: %u\n", ifr.ifr_fib); @@ -74,7 +74,7 @@ setiffib(const char *val, int dummy __un return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSIFFIB)"); @@ -93,7 +93,7 @@ settunfib(const char *val, int dummy __u return; } - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_fib = fib; if (ioctl(s, SIOCSTUNFIB, (caddr_t)&ifr) < 0) warn("ioctl (SIOCSTUNFIB)"); Modified: stable/10/sbin/ifconfig/ifgre.c ============================================================================== --- stable/10/sbin/ifconfig/ifgre.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifgre.c Fri May 20 07:14:03 2016 (r300285) @@ -68,7 +68,7 @@ setifgrekey(const char *val, int dummy _ { uint32_t grekey = strtol(val, NULL, 0); - strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_data = (caddr_t)&grekey; if (ioctl(s, GRESKEY, (caddr_t)&ifr) < 0) warn("ioctl (set grekey)"); Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifieee80211.c Fri May 20 07:14:03 2016 (r300285) @@ -3239,7 +3239,7 @@ scan_and_wait(int s) return; } (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_SCAN_REQ; memset(&sr, 0, sizeof(sr)); @@ -3705,7 +3705,7 @@ get80211wme(int s, int param, int ac, in struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = param; ireq.i_len = ac; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -3886,7 +3886,7 @@ list_mac(int s) char c; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); /* XXX ?? */ ireq.i_type = IEEE80211_IOC_MACCMD; ireq.i_val = IEEE80211_MACCMD_POLICY; if (ioctl(s, SIOCG80211, &ireq) < 0) { @@ -3992,7 +3992,7 @@ list_mesh(int s) struct ieee80211req_mesh_route *rt; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = IEEE80211_IOC_MESH_RTCMD; ireq.i_val = IEEE80211_MESH_RTCMD_LIST; ireq.i_data = &routes; @@ -4074,7 +4074,7 @@ get80211opmode(int s) struct ifmediareq ifmr; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) { @@ -4218,7 +4218,7 @@ getid(int s, int ix, void *data, size_t struct ieee80211req ireq; (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = (!mesh) ? IEEE80211_IOC_SSID : IEEE80211_IOC_MESH_ID; ireq.i_val = ix; ireq.i_data = data; Modified: stable/10/sbin/ifconfig/ifmac.c ============================================================================== --- stable/10/sbin/ifconfig/ifmac.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifmac.c Fri May 20 07:14:03 2016 (r300285) @@ -57,7 +57,7 @@ maclabel_status(int s) char *label_text; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (mac_prepare_ifnet_label(&label) == -1) return; @@ -90,7 +90,7 @@ setifmaclabel(const char *val, int d, in } memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_ifru.ifru_data = (void *)label; error = ioctl(s, SIOCSIFMAC, &ifr); Modified: stable/10/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/10/sbin/ifconfig/ifmedia.c Fri May 20 07:11:04 2016 (r300284) +++ stable/10/sbin/ifconfig/ifmedia.c Fri May 20 07:14:03 2016 (r300285) @@ -112,7 +112,7 @@ media_status(int s) int xmedia = 1; (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); /* * Check if interface supports extended media types. @@ -213,7 +213,7 @@ ifmedia_getstate(int s) err(1, "malloc"); (void) memset(ifmr, 0, sizeof(struct ifmediareq)); - (void) strncpy(ifmr->ifm_name, name, + (void) strlcpy(ifmr->ifm_name, name, sizeof(ifmr->ifm_name)); ifmr->ifm_count = 0; @@ -287,7 +287,7 @@ setmedia(const char *val, int d, int s, */ subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; @@ -319,7 +319,7 @@ domediaopt(const char *val, int clear, i options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = ifmr->ifm_current; if (clear) ifr.ifr_media &= ~options; @@ -346,7 +346,7 @@ setmediainst(const char *val, int d, int if (inst < 0 || inst > (int)IFM_INST_MAX) errx(1, "invalid media instance: %s", val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_IMASK) | inst << IFM_ISHIFT; ifmr->ifm_current = ifr.ifr_media; @@ -363,7 +363,7 @@ setmediamode(const char *val, int d, int mode = get_media_mode(IFM_TYPE(ifmr->ifm_ulist[0]), val); - strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_media = (ifmr->ifm_current & ~IFM_MMASK) | mode; ifmr->ifm_current = ifr.ifr_media; From owner-svn-src-stable-10@freebsd.org Fri May 20 07:18:34 2016 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 50116B4255D; Fri, 20 May 2016 07:18:34 +0000 (UTC) (envelope-from truckman@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 1D23F1B02; Fri, 20 May 2016 07:18:34 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K7IXrH097588; Fri, 20 May 2016 07:18:33 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4K7IXdM097587; Fri, 20 May 2016 07:18:33 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605200718.u4K7IXdM097587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 20 May 2016 07:18: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: r300286 - stable/10/lib/libc/resolv 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.22 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, 20 May 2016 07:18:34 -0000 Author: truckman Date: Fri May 20 07:18:33 2016 New Revision: 300286 URL: https://svnweb.freebsd.org/changeset/base/300286 Log: MFC r299879, r299880 r299879 | truckman | 2016-05-15 18:30:32 -0700 (Sun, 15 May 2016) | 7 lines Likely a false positive ... but make sure that -1 can't be used as an array index by splitting up a test. r299880 | truckman | 2016-05-15 18:38:24 -0700 (Sun, 15 May 2016) | 8 lines Since rdata is only used as an argument to the immediately following call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving rdata = &buf[n]; inside the if block. Reported by: Coverity CID: 603941 Modified: stable/10/lib/libc/resolv/res_query.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_query.c ============================================================================== --- stable/10/lib/libc/resolv/res_query.c Fri May 20 07:14:03 2016 (r300285) +++ stable/10/lib/libc/resolv/res_query.c Fri May 20 07:18:33 2016 (r300286) @@ -136,8 +136,8 @@ again: if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); - rdata = &buf[n]; if (n > 0 && (statp->options & RES_NSID) != 0U) { + rdata = &buf[n]; n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, NS_OPT_NSID, 0, NULL); } From owner-svn-src-stable-10@freebsd.org Fri May 20 17:25:38 2016 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 8FC72B43F11; Fri, 20 May 2016 17:25:38 +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 5CDBB1ECE; Fri, 20 May 2016 17:25:38 +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 u4KHPbAe083540; Fri, 20 May 2016 17:25:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KHPaXs083536; Fri, 20 May 2016 17:25:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605201725.u4KHPaXs083536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 May 2016 17:25:36 +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: r300312 - in stable/10/sys/dev: ahci sound/pci/hda usb/controller 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.22 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, 20 May 2016 17:25:38 -0000 Author: mav Date: Fri May 20 17:25:36 2016 New Revision: 300312 URL: https://svnweb.freebsd.org/changeset/base/300312 Log: MFC r298983: Add some device IDs from Intel Sunrise Point chipsets. Modified: stable/10/sys/dev/ahci/ahci_pci.c stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci_pci.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/ahci/ahci_pci.c Fri May 20 17:25:36 2016 (r300312) @@ -176,6 +176,15 @@ static const struct { {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9d038086, 0x00, "Intel Sunrise Point-LP", 0}, + {0x9d058086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0x9d078086, 0x00, "Intel Sunrise Point-LP (RAID)", 0}, + {0xa1028086, 0x00, "Intel Sunrise Point", 0}, + {0xa1038086, 0x00, "Intel Sunrise Point", 0}, + {0xa1058086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1068086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa1078086, 0x00, "Intel Sunrise Point (RAID)", 0}, + {0xa10f8086, 0x00, "Intel Sunrise Point (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Fri May 20 17:25:36 2016 (r300312) @@ -93,6 +93,8 @@ static const struct { { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, + { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, + { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Fri May 20 17:25:36 2016 (r300312) @@ -69,6 +69,8 @@ #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) #define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_BDW2 HDA_MODEL_CONSTRUCT(INTEL, 0x9ca0) +#define HDA_INTEL_SRPTLP HDA_MODEL_CONSTRUCT(INTEL, 0x9d70) +#define HDA_INTEL_SRPT HDA_MODEL_CONSTRUCT(INTEL, 0xa170) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:24:34 2016 (r300311) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:25:36 2016 (r300312) @@ -122,6 +122,8 @@ xhci_pci_match(device_t self) return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); + case 0xa12f8086: + return ("Intel Sunrise Point USB 3.0 controller"); case 0xa01b177d: return ("Cavium ThunderX USB 3.0 controller"); From owner-svn-src-stable-10@freebsd.org Fri May 20 19:05:34 2016 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 CD517B43F2C; Fri, 20 May 2016 19:05:34 +0000 (UTC) (envelope-from emaste@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 9CBEC1D56; Fri, 20 May 2016 19:05:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KJ5X17015393; Fri, 20 May 2016 19:05:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJ5XZl015392; Fri, 20 May 2016 19:05:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201905.u4KJ5XZl015392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 19:05: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: r300321 - stable/10/gnu/lib/libgcc 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.22 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, 20 May 2016 19:05:34 -0000 Author: emaste Date: Fri May 20 19:05:33 2016 New Revision: 300321 URL: https://svnweb.freebsd.org/changeset/base/300321 Log: MFC r294935 (kan): Make .debug file for libgcc_s.so.1 more useful. The files compiled into libgcc_s.so.1 did not have -g on compiler command line, making generated .debug quite pointless. PR: 206381 Modified: stable/10/gnu/lib/libgcc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/lib/libgcc/Makefile ============================================================================== --- stable/10/gnu/lib/libgcc/Makefile Fri May 20 18:54:42 2016 (r300320) +++ stable/10/gnu/lib/libgcc/Makefile Fri May 20 19:05:33 2016 (r300321) @@ -186,7 +186,7 @@ COMMONHDRS= tm.h tconfig.h options.h unw HIDE = -fvisibility=hidden -DHIDE_EXPORTS CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC -CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED +CC_S = ${CC} -c ${CFLAGS} ${SHARED_CFLAGS} ${PICFLAG} -DSHARED #----------------------------------------------------------------------- # From owner-svn-src-stable-10@freebsd.org Fri May 20 19:14:17 2016 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 7E233B441BB; Fri, 20 May 2016 19:14:17 +0000 (UTC) (envelope-from emaste@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 59A1F136C; Fri, 20 May 2016 19:14:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4KJEGAM018407; Fri, 20 May 2016 19:14:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4KJEFB8018399; Fri, 20 May 2016 19:14:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605201914.u4KJEFB8018399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 May 2016 19:14:15 +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: r300323 - in stable/10/lib/csu: amd64 arm i386-elf mips powerpc powerpc64 sparc64 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.22 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, 20 May 2016 19:14:17 -0000 Author: emaste Date: Fri May 20 19:14:15 2016 New Revision: 300323 URL: https://svnweb.freebsd.org/changeset/base/300323 Log: MFC r292000: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in csu. Modified: stable/10/lib/csu/amd64/crt1.c stable/10/lib/csu/arm/crt1.c stable/10/lib/csu/i386-elf/crt1_c.c stable/10/lib/csu/mips/crt1.c stable/10/lib/csu/powerpc/crt1.c stable/10/lib/csu/powerpc64/crt1.c stable/10/lib/csu/sparc64/crt1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/csu/amd64/crt1.c ============================================================================== --- stable/10/lib/csu/amd64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/amd64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -27,12 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/arm/crt1.c ============================================================================== --- stable/10/lib/csu/arm/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/arm/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/i386-elf/crt1_c.c ============================================================================== --- stable/10/lib/csu/i386-elf/crt1_c.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/i386-elf/crt1_c.c Fri May 20 19:14:15 2016 (r300323) @@ -29,12 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/mips/crt1.c ============================================================================== --- stable/10/lib/csu/mips/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/mips/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -36,10 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include "libc_private.h" #include "crtbrand.c" Modified: stable/10/lib/csu/powerpc/crt1.c ============================================================================== --- stable/10/lib/csu/powerpc/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/powerpc/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/powerpc64/crt1.c ============================================================================== --- stable/10/lib/csu/powerpc64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/powerpc64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: stable/10/lib/csu/sparc64/crt1.c ============================================================================== --- stable/10/lib/csu/sparc64/crt1.c Fri May 20 19:10:29 2016 (r300322) +++ stable/10/lib/csu/sparc64/crt1.c Fri May 20 19:14:15 2016 (r300323) @@ -33,12 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" From owner-svn-src-stable-10@freebsd.org Sat May 21 09:03:47 2016 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 90B37B441C5; Sat, 21 May 2016 09:03:47 +0000 (UTC) (envelope-from mm@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 414C51CF9; Sat, 21 May 2016 09:03:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4L93ki5070144; Sat, 21 May 2016 09:03:46 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4L93jgN070137; Sat, 21 May 2016 09:03:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605210903.u4L93jgN070137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 21 May 2016 09:03: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: r300361 - in stable/10/contrib/libarchive: cpio libarchive libarchive/test 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.22 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, 21 May 2016 09:03:47 -0000 Author: mm Date: Sat May 21 09:03:45 2016 New Revision: 300361 URL: https://svnweb.freebsd.org/changeset/base/300361 Log: Backport security fix for absolute path traversal vulnerability in bsdcpio. This is a direct commit to stable/10. Security: CVE-2015-2304 Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_write_disk.3 stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/10/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/cpio/bsdcpio.1 Sat May 21 09:03:45 2016 (r300361) @@ -156,7 +156,8 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links and path names containing +This allows extraction via symbolic links, absolute paths, +and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/cpio/cpio.c Sat May 21 09:03:45 2016 (r300361) @@ -179,6 +179,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -264,6 +265,7 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; @@ -300,6 +302,7 @@ main(int argc, char *argv[]) "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case OPTION_PRESERVE_OWNER: cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive.h Sat May 21 09:03:45 2016 (r300361) @@ -562,6 +562,8 @@ __LA_DECL int archive_read_set_options(s /* Default: Do not use HFS+ compression if it was not compressed. */ /* This has no effect except on Mac OS v10.6 or later. */ #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000) +/* Default: Do not reject entries with absolute paths */ +#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000) __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, int flags); Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk.3 Sat May 21 09:03:45 2016 (r300361) @@ -177,6 +177,9 @@ The default is to not refuse such paths. Note that paths ending in .Pa .. always cause an error, regardless of this flag. +.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS +Refuse to extract an absolute path. +The default is to not refuse such paths. .It Cm ARCHIVE_EXTRACT_SPARSE Scan data for blocks of NUL bytes and try to recreate them with holes. This results in sparse files, independent of whether the archive format Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sat May 21 09:03:45 2016 (r300361) @@ -2504,8 +2504,9 @@ cleanup_pathname_win(struct archive_writ /* * Canonicalize the pathname. In particular, this strips duplicate * '/' characters, '.' elements, and trailing '/'. It also raises an - * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is - * set) any '..' in the path. + * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is + * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS + * is set) if the path is absolute. */ static int cleanup_pathname(struct archive_write_disk *a) @@ -2524,8 +2525,15 @@ cleanup_pathname(struct archive_write_di cleanup_pathname_win(a); #endif /* Skip leading '/'. */ - if (*src == '/') + if (*src == '/') { + if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Path is absolute"); + return (ARCHIVE_FAILED); + } + separator = *src++; + } /* Scan the pathname one element at a time. */ for (;;) { Modified: stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 08:03:13 2016 (r300360) +++ stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c Sat May 21 09:03:45 2016 (r300361) @@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure) assert(S_ISDIR(st.st_mode)); archive_entry_free(ae); + /* + * Without security checks, we should be able to + * extract an absolute path. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + assert(0 == archive_write_header(a, ae)); + assert(0 == archive_write_finish_entry(a)); + assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp")); + + /* But with security checks enabled, this should fail. */ + assert(archive_entry_clear(ae) != NULL); + archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); + failure("Extracting an absolute path should fail here."); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + assert(0 == archive_write_finish_entry(a)); + assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); /* Test the entries on disk. */ From owner-svn-src-stable-10@freebsd.org Sat May 21 15:15:13 2016 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 7BA00B44A94; Sat, 21 May 2016 15:15:13 +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 04BB91777; Sat, 21 May 2016 15:15:12 +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 u4LFFCix082907; Sat, 21 May 2016 15:15:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LFFCMK082904; Sat, 21 May 2016 15:15:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605211515.u4LFFCMK082904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 May 2016 15:15: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: r300373 - in stable/10/sys: conf dev/ntb/if_ntb dev/ntb/ntb_hw 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.22 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, 21 May 2016 15:15:13 -0000 Author: mav Date: Sat May 21 15:15:11 2016 New Revision: 300373 URL: https://svnweb.freebsd.org/changeset/base/300373 Log: MFC 103 ntb(4) patches by cem@ up to r295487. Modified: stable/10/sys/conf/files.i386 stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat May 21 14:51:49 2016 (r300372) +++ stable/10/sys/conf/files.i386 Sat May 21 15:15:11 2016 (r300373) @@ -274,6 +274,8 @@ dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci +dev/ntb/if_ntb/if_ntb.c optional if_ntb +dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Sat May 21 14:51:49 2016 (r300372) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Sat May 21 15:15:11 2016 (r300373) @@ -1,5 +1,6 @@ /*- * Copyright (C) 2013 Intel Corporation + * Copyright (C) 2015 EMC Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,8 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -39,19 +42,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include + #include #include #include #include #include #include + #include #include + #include #include #include +#include +#include + #include "../ntb_hw/ntb_hw.h" /* @@ -65,72 +75,113 @@ __FBSDID("$FreeBSD$"); * be picked up and redistributed in Linux with a dual GPL/BSD license. */ -/* TODO: These functions should really be part of the kernel */ -#define test_bit(pos, bitmap_addr) (*(bitmap_addr) & 1UL << (pos)) -#define set_bit(pos, bitmap_addr) *(bitmap_addr) |= 1UL << (pos) -#define clear_bit(pos, bitmap_addr) *(bitmap_addr) &= ~(1UL << (pos)) +#define QP_SETSIZE 64 +BITSET_DEFINE(_qpset, QP_SETSIZE); +#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) +#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) +#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) +#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) #define KTR_NTB KTR_SPARE3 -#define NTB_TRANSPORT_VERSION 3 +#define NTB_TRANSPORT_VERSION 4 #define NTB_RX_MAX_PKTS 64 #define NTB_RXQ_SIZE 300 -static unsigned int transport_mtu = 0x4000 + ETHER_HDR_LEN + ETHER_CRC_LEN; -static unsigned int max_num_clients = 1; +enum ntb_link_event { + NTB_LINK_DOWN = 0, + NTB_LINK_UP, +}; + +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); + +static unsigned g_if_ntb_debug_level; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, + &g_if_ntb_debug_level, 0, "if_ntb log level -- higher is more verbose"); +#define ntb_printf(lvl, ...) do { \ + if ((lvl) <= g_if_ntb_debug_level) { \ + if_printf(nt->ifp, __VA_ARGS__); \ + } \ +} while (0) + +static unsigned transport_mtu = IP_MAXPACKET + ETHER_HDR_LEN + ETHER_CRC_LEN; + +static uint64_t max_mw_size; +SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, + "If enabled (non-zero), limit the size of large memory windows. " + "Both sides of the NTB MUST set the same value here."); + +static unsigned max_num_clients; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, + &max_num_clients, 0, "Maximum number of NTB transport clients. " + "0 (default) - use all available NTB memory windows; " + "positive integer N - Limit to N memory windows."); + +static unsigned enable_xeon_watchdog; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, + &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " + "keep a watchdog from tearing down the NTB link"); STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); +typedef uint32_t ntb_q_idx_t; + struct ntb_queue_entry { /* ntb_queue list reference */ STAILQ_ENTRY(ntb_queue_entry) entry; - /* info on data to be transfered */ + /* info on data to be transferred */ void *cb_data; void *buf; - uint64_t len; - uint64_t flags; + uint32_t len; + uint32_t flags; + + struct ntb_transport_qp *qp; + struct ntb_payload_header *x_hdr; + ntb_q_idx_t index; }; struct ntb_rx_info { - unsigned int entry; + ntb_q_idx_t entry; }; struct ntb_transport_qp { - struct ntb_netdev *transport; + struct ntb_transport_ctx *transport; struct ntb_softc *ntb; void *cb_data; bool client_ready; - bool qp_link; + volatile bool link_is_up; uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */ struct ntb_rx_info *rx_info; struct ntb_rx_info *remote_rx_info; - void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); struct ntb_queue_list tx_free_q; struct mtx ntb_tx_free_q_lock; - void *tx_mw; - uint64_t tx_index; - uint64_t tx_max_entry; + caddr_t tx_mw; + bus_addr_t tx_mw_phys; + ntb_q_idx_t tx_index; + ntb_q_idx_t tx_max_entry; uint64_t tx_max_frame; - void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); + struct ntb_queue_list rx_post_q; struct ntb_queue_list rx_pend_q; - struct ntb_queue_list rx_free_q; - struct mtx ntb_rx_pend_q_lock; - struct mtx ntb_rx_free_q_lock; + /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ + struct mtx ntb_rx_q_lock; struct task rx_completion_task; - void *rx_buff; - uint64_t rx_index; - uint64_t rx_max_entry; + struct task rxc_db_work; + caddr_t rx_buff; + ntb_q_idx_t rx_index; + ntb_q_idx_t rx_max_entry; uint64_t rx_max_frame; - void (*event_handler) (void *data, int status); + void (*event_handler)(void *data, enum ntb_link_event status); struct callout link_work; struct callout queue_full; struct callout rx_full; @@ -147,40 +198,55 @@ struct ntb_transport_qp { uint64_t tx_bytes; uint64_t tx_pkts; uint64_t tx_ring_full; + uint64_t tx_err_no_buf; }; struct ntb_queue_handlers { - void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); - void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); - void (*event_handler) (void *data, int status); + void (*event_handler)(void *data, enum ntb_link_event status); }; - struct ntb_transport_mw { - size_t size; - void *virt_addr; - vm_paddr_t dma_addr; + vm_paddr_t phys_addr; + size_t phys_size; + size_t xlat_align; + size_t xlat_align_size; + bus_addr_t addr_limit; + /* Tx buff is off vbase / phys_addr */ + caddr_t vbase; + size_t xlat_size; + size_t buff_size; + /* Rx buff is off virt_addr / dma_addr */ + caddr_t virt_addr; + bus_addr_t dma_addr; }; -struct ntb_netdev { +struct ntb_transport_ctx { struct ntb_softc *ntb; struct ifnet *ifp; - struct ntb_transport_mw mw[NTB_NUM_MW]; - struct ntb_transport_qp *qps; - uint64_t max_qps; - uint64_t qp_bitmap; - bool transport_link; + struct ntb_transport_mw mw_vec[NTB_MAX_NUM_MW]; + struct ntb_transport_qp *qp_vec; + struct _qpset qp_bitmap; + struct _qpset qp_bitmap_free; + unsigned mw_count; + unsigned qp_count; + volatile bool link_is_up; struct callout link_work; - struct ntb_transport_qp *qp; + struct callout link_watchdog; + struct task link_cleanup; uint64_t bufsize; u_char eaddr[ETHER_ADDR_LEN]; struct mtx tx_lock; struct mtx rx_lock; + + /* The hardcoded single queuepair in ntb_setup_interface() */ + struct ntb_transport_qp *qp; }; -static struct ntb_netdev net_softc; +static struct ntb_transport_ctx net_softc; enum { IF_NTB_DESC_DONE_FLAG = 1 << 0, @@ -188,21 +254,42 @@ enum { }; struct ntb_payload_header { - uint64_t ver; - uint64_t len; - uint64_t flags; + ntb_q_idx_t ver; + uint32_t len; + uint32_t flags; }; enum { + /* + * The order of this enum is part of the if_ntb remote protocol. Do + * not reorder without bumping protocol version (and it's probably best + * to keep the protocol in lock-step with the Linux NTB driver. + */ IF_NTB_VERSION = 0, - IF_NTB_MW0_SZ, - IF_NTB_MW1_SZ, - IF_NTB_NUM_QPS, IF_NTB_QP_LINKS, + IF_NTB_NUM_QPS, + IF_NTB_NUM_MWS, + /* + * N.B.: transport_link_work assumes MW1 enums = MW0 + 2. + */ + IF_NTB_MW0_SZ_HIGH, + IF_NTB_MW0_SZ_LOW, + IF_NTB_MW1_SZ_HIGH, + IF_NTB_MW1_SZ_LOW, IF_NTB_MAX_SPAD, + + /* + * Some NTB-using hardware have a watchdog to work around NTB hangs; if + * a register or doorbell isn't written every few seconds, the link is + * torn down. Write an otherwise unused register every few seconds to + * work around this watchdog. + */ + IF_NTB_WATCHDOG_SPAD = 15 }; +CTASSERT(IF_NTB_WATCHDOG_SPAD < XEON_SPAD_COUNT && + IF_NTB_WATCHDOG_SPAD < ATOM_SPAD_COUNT); -#define QP_TO_MW(qp) ((qp) % NTB_NUM_MW) +#define QP_TO_MW(nt, qp) ((qp) % nt->mw_count) #define NTB_QP_DEF_NUM_ENTRIES 100 #define NTB_LINK_DOWN_TIMEOUT 10 @@ -216,37 +303,41 @@ static void ntb_net_tx_handler(struct nt void *data, int len); static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); -static void ntb_net_event_handler(void *data, int status); -static int ntb_transport_init(struct ntb_softc *ntb); -static void ntb_transport_free(void *transport); -static void ntb_transport_init_queue(struct ntb_netdev *nt, +static void ntb_net_event_handler(void *data, enum ntb_link_event status); +static int ntb_transport_probe(struct ntb_softc *ntb); +static void ntb_transport_free(struct ntb_transport_ctx *); +static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num); static void ntb_transport_free_queue(struct ntb_transport_qp *qp); -static struct ntb_transport_qp * ntb_transport_create_queue(void *data, +static struct ntb_transport_qp *ntb_transport_create_queue(void *data, struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); static void ntb_transport_link_up(struct ntb_transport_qp *qp); static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, unsigned int len); static int ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry); -static void ntb_tx_copy_task(struct ntb_transport_qp *qp, +static void ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset); static void ntb_qp_full(void *arg); -static void ntb_transport_rxc_db(void *data, int db_num); -static void ntb_rx_pendq_full(void *arg); -static void ntb_transport_rx(struct ntb_transport_qp *qp); +static void ntb_transport_rxc_db(void *arg, int pending); static int ntb_process_rxc(struct ntb_transport_qp *qp); -static void ntb_rx_copy_task(struct ntb_transport_qp *qp, +static void ntb_memcpy_rx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset); -static void ntb_rx_completion_task(void *arg, int pending); -static void ntb_transport_event_callback(void *data, enum ntb_hw_event event); +static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, + void *data); +static void ntb_complete_rxc(void *arg, int pending); +static void ntb_transport_doorbell_callback(void *data, uint32_t vector); +static void ntb_transport_event_callback(void *data); static void ntb_transport_link_work(void *arg); -static int ntb_set_mw(struct ntb_netdev *nt, int num_mw, unsigned int size); -static void ntb_transport_setup_qp_mw(struct ntb_netdev *nt, +static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, size_t size); +static void ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw); +static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt, unsigned int qp_num); static void ntb_qp_link_work(void *arg); -static void ntb_transport_link_cleanup(struct ntb_netdev *nt); +static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt); +static void ntb_transport_link_cleanup_work(void *, int); static void ntb_qp_link_down(struct ntb_transport_qp *qp); +static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp); static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); static void ntb_transport_link_down(struct ntb_transport_qp *qp); static void ntb_send_link_down(struct ntb_transport_qp *qp); @@ -254,11 +345,27 @@ static void ntb_list_add(struct mtx *loc struct ntb_queue_list *list); static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, struct ntb_queue_list *list); +static struct ntb_queue_entry *ntb_list_mv(struct mtx *lock, + struct ntb_queue_list *from, struct ntb_queue_list *to); static void create_random_local_eui48(u_char *eaddr); static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); +static void xeon_link_watchdog_hb(void *); + +static const struct ntb_ctx_ops ntb_transport_ops = { + .link_event = ntb_transport_event_callback, + .db_event = ntb_transport_doorbell_callback, +}; MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); +static inline void +iowrite32(uint32_t val, void *addr) +{ + + bus_space_write_4(X86_BUS_SPACE_MEM, 0/* HACK */, (uintptr_t)addr, + val); +} + /* Module setup and teardown */ static int ntb_handle_module_events(struct module *m, int what, void *arg) @@ -289,11 +396,12 @@ DECLARE_MODULE(if_ntb, if_ntb_mod, SI_SU MODULE_DEPEND(if_ntb, ntb_hw, 1, 1, 1); static int -ntb_setup_interface() +ntb_setup_interface(void) { struct ifnet *ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; + int rc; net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); if (net_softc.ntb == NULL) { @@ -301,17 +409,23 @@ ntb_setup_interface() return (ENXIO); } - ntb_transport_init(net_softc.ntb); - ifp = net_softc.ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - printf("ntb: cannot allocate ifnet structure\n"); + ntb_transport_free(&net_softc); + printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } + if_initname(ifp, "ntb", 0); + + rc = ntb_transport_probe(net_softc.ntb); + if (rc != 0) { + printf("ntb: Cannot init transport: %d\n", rc); + if_free(net_softc.ifp); + return (rc); + } net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, &handlers); - if_initname(ifp, "ntb", 0); ifp->if_init = ntb_net_init; ifp->if_softc = &net_softc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; @@ -324,6 +438,8 @@ ntb_setup_interface() ether_ifattach(ifp, net_softc.eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; + ifp->if_mtu = ntb_transport_max_size(net_softc.qp) - ETHER_HDR_LEN - + ETHER_CRC_LEN; ntb_transport_link_up(net_softc.qp); net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + @@ -332,20 +448,20 @@ ntb_setup_interface() } static int -ntb_teardown_interface() +ntb_teardown_interface(void) { - if (net_softc.qp != NULL) + if (net_softc.qp != NULL) { ntb_transport_link_down(net_softc.qp); + ntb_transport_free_queue(net_softc.qp); + ntb_transport_free(&net_softc); + } + if (net_softc.ifp != NULL) { ether_ifdetach(net_softc.ifp); if_free(net_softc.ifp); - } - - if (net_softc.qp != NULL) { - ntb_transport_free_queue(net_softc.qp); - ntb_transport_free(&net_softc); + net_softc.ifp = NULL; } return (0); @@ -356,7 +472,7 @@ ntb_teardown_interface() static void ntb_net_init(void *arg) { - struct ntb_netdev *ntb_softc = arg; + struct ntb_transport_ctx *ntb_softc = arg; struct ifnet *ifp = ntb_softc->ifp; ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -368,7 +484,7 @@ ntb_net_init(void *arg) static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct ntb_netdev *nt = ifp->if_softc; + struct ntb_transport_ctx *nt = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error = 0; @@ -397,7 +513,7 @@ static void ntb_start(struct ifnet *ifp) { struct mbuf *m_head; - struct ntb_netdev *nt = ifp->if_softc; + struct ntb_transport_ctx *nt = ifp->if_softc; int rc; mtx_lock(&nt->tx_lock); @@ -447,125 +563,199 @@ ntb_net_rx_handler(struct ntb_transport_ } static void -ntb_net_event_handler(void *data, int status) +ntb_net_event_handler(void *data, enum ntb_link_event status) { + struct ifnet *ifp; + + ifp = data; + (void)ifp; + + /* XXX The Linux driver munges with the carrier status here. */ + switch (status) { + case NTB_LINK_DOWN: + break; + case NTB_LINK_UP: + break; + default: + panic("Bogus ntb_link_event %u\n", status); + } } /* Transport Init and teardown */ +static void +xeon_link_watchdog_hb(void *arg) +{ + struct ntb_transport_ctx *nt; + + nt = arg; + ntb_spad_write(nt->ntb, IF_NTB_WATCHDOG_SPAD, 0); + callout_reset(&nt->link_watchdog, 1 * hz, xeon_link_watchdog_hb, nt); +} + static int -ntb_transport_init(struct ntb_softc *ntb) +ntb_transport_probe(struct ntb_softc *ntb) { - struct ntb_netdev *nt = &net_softc; - int rc, i; + struct ntb_transport_ctx *nt = &net_softc; + struct ntb_transport_mw *mw; + uint64_t qp_bitmap; + int rc; + unsigned i; + + nt->mw_count = ntb_mw_count(ntb); + for (i = 0; i < nt->mw_count; i++) { + mw = &nt->mw_vec[i]; + + rc = ntb_mw_get_range(ntb, i, &mw->phys_addr, &mw->vbase, + &mw->phys_size, &mw->xlat_align, &mw->xlat_align_size, + &mw->addr_limit); + if (rc != 0) + goto err; + + mw->buff_size = 0; + mw->xlat_size = 0; + mw->virt_addr = NULL; + mw->dma_addr = 0; + } + + qp_bitmap = ntb_db_valid_mask(ntb); + nt->qp_count = flsll(qp_bitmap); + KASSERT(nt->qp_count != 0, ("bogus db bitmap")); + nt->qp_count -= 1; + + if (max_num_clients != 0 && max_num_clients < nt->qp_count) + nt->qp_count = max_num_clients; + else if (nt->mw_count < nt->qp_count) + nt->qp_count = nt->mw_count; + KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - nt->max_qps = max_num_clients; - ntb_register_transport(ntb, nt); mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - nt->qps = malloc(nt->max_qps * sizeof(struct ntb_transport_qp), - M_NTB_IF, M_WAITOK|M_ZERO); - - nt->qp_bitmap = ((uint64_t) 1 << nt->max_qps) - 1; + nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_IF, + M_WAITOK | M_ZERO); - for (i = 0; i < nt->max_qps; i++) + for (i = 0; i < nt->qp_count; i++) { + set_bit(i, &nt->qp_bitmap); + set_bit(i, &nt->qp_bitmap_free); ntb_transport_init_queue(nt, i); + } callout_init(&nt->link_work, 0); + callout_init(&nt->link_watchdog, 0); + TASK_INIT(&nt->link_cleanup, 0, ntb_transport_link_cleanup_work, nt); - rc = ntb_register_event_callback(ntb, - ntb_transport_event_callback); + rc = ntb_set_ctx(ntb, nt, &ntb_transport_ops); if (rc != 0) goto err; - if (ntb_query_link_status(ntb)) { - if (bootverbose) - device_printf(ntb_get_device(ntb), "link up\n"); - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); - } - + nt->link_is_up = false; + ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + ntb_link_event(ntb); + + callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); + if (enable_xeon_watchdog != 0) + callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); return (0); err: - free(nt->qps, M_NTB_IF); - ntb_unregister_transport(ntb); + free(nt->qp_vec, M_NTB_IF); + nt->qp_vec = NULL; return (rc); } static void -ntb_transport_free(void *transport) +ntb_transport_free(struct ntb_transport_ctx *nt) { - struct ntb_netdev *nt = transport; struct ntb_softc *ntb = nt->ntb; - int i; - - nt->transport_link = NTB_LINK_DOWN; + struct _qpset qp_bitmap_alloc; + uint8_t i; + ntb_transport_link_cleanup(nt); + taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); + callout_drain(&nt->link_watchdog); - /* verify that all the qps are freed */ - for (i = 0; i < nt->max_qps; i++) - if (!test_bit(i, &nt->qp_bitmap)) - ntb_transport_free_queue(&nt->qps[i]); + BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); + BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); + /* Verify that all the QPs are freed */ + for (i = 0; i < nt->qp_count; i++) + if (test_bit(i, &qp_bitmap_alloc)) + ntb_transport_free_queue(&nt->qp_vec[i]); - ntb_unregister_event_callback(ntb); + ntb_link_disable(ntb); + ntb_clear_ctx(ntb); - for (i = 0; i < NTB_NUM_MW; i++) - if (nt->mw[i].virt_addr != NULL) - contigfree(nt->mw[i].virt_addr, nt->mw[i].size, - M_NTB_IF); + for (i = 0; i < nt->mw_count; i++) + ntb_free_mw(nt, i); - free(nt->qps, M_NTB_IF); - ntb_unregister_transport(ntb); + free(nt->qp_vec, M_NTB_IF); } static void -ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num) +ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) { + struct ntb_transport_mw *mw; struct ntb_transport_qp *qp; - unsigned int num_qps_mw, tx_size; - uint8_t mw_num = QP_TO_MW(qp_num); + vm_paddr_t mw_base; + uint64_t mw_size, qp_offset; + size_t tx_size; + unsigned num_qps_mw, mw_num, mw_count; + + mw_count = nt->mw_count; + mw_num = QP_TO_MW(nt, qp_num); + mw = &nt->mw_vec[mw_num]; - qp = &nt->qps[qp_num]; + qp = &nt->qp_vec[qp_num]; qp->qp_num = qp_num; qp->transport = nt; qp->ntb = nt->ntb; - qp->qp_link = NTB_LINK_DOWN; - qp->client_ready = NTB_LINK_DOWN; + qp->client_ready = false; qp->event_handler = NULL; + ntb_qp_link_down_reset(qp); - if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW) - num_qps_mw = nt->max_qps / NTB_NUM_MW + 1; + if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + num_qps_mw = nt->qp_count / mw_count + 1; else - num_qps_mw = nt->max_qps / NTB_NUM_MW; + num_qps_mw = nt->qp_count / mw_count; + + mw_base = mw->phys_addr; + mw_size = mw->phys_size; + + tx_size = mw_size / num_qps_mw; + qp_offset = tx_size * (qp_num / mw_count); + + qp->tx_mw = mw->vbase + qp_offset; + KASSERT(qp->tx_mw != NULL, ("uh oh?")); + + /* XXX Assumes that a vm_paddr_t is equivalent to bus_addr_t */ + qp->tx_mw_phys = mw_base + qp_offset; + KASSERT(qp->tx_mw_phys != 0, ("uh oh?")); - tx_size = (unsigned int) ntb_get_mw_size(qp->ntb, mw_num) / num_qps_mw; - qp->rx_info = (struct ntb_rx_info *) - ((char *)ntb_get_mw_vbase(qp->ntb, mw_num) + - (qp_num / NTB_NUM_MW * tx_size)); tx_size -= sizeof(struct ntb_rx_info); + qp->rx_info = (void *)(qp->tx_mw + tx_size); - qp->tx_mw = qp->rx_info + sizeof(struct ntb_rx_info); - qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header), - tx_size); + /* Due to house-keeping, there must be at least 2 buffs */ + qp->tx_max_frame = qmin(tx_size / 2, + transport_mtu + sizeof(struct ntb_payload_header)); qp->tx_max_entry = tx_size / qp->tx_max_frame; - qp->tx_index = 0; callout_init(&qp->link_work, 0); callout_init(&qp->queue_full, CALLOUT_MPSAFE); callout_init(&qp->rx_full, CALLOUT_MPSAFE); - mtx_init(&qp->ntb_rx_pend_q_lock, "ntb rx pend q", NULL, MTX_SPIN); - mtx_init(&qp->ntb_rx_free_q_lock, "ntb rx free q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); - TASK_INIT(&qp->rx_completion_task, 0, ntb_rx_completion_task, qp); + TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); + TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); + STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); - STAILQ_INIT(&qp->rx_free_q); STAILQ_INIT(&qp->tx_free_q); + + callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } static void @@ -578,18 +768,25 @@ ntb_transport_free_queue(struct ntb_tran callout_drain(&qp->link_work); - ntb_unregister_db_callback(qp->ntb, qp->qp_num); + ntb_db_set_mask(qp->ntb, 1ull << qp->qp_num); + taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); + taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); + + qp->cb_data = NULL; + qp->rx_handler = NULL; + qp->tx_handler = NULL; + qp->event_handler = NULL; - while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_pend_q))) free(entry, M_NTB_IF); - while ((entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) + while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_post_q))) free(entry, M_NTB_IF); while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) free(entry, M_NTB_IF); - set_bit(qp->qp_num, &qp->transport->qp_bitmap); + set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); } /** @@ -607,64 +804,48 @@ ntb_transport_free_queue(struct ntb_tran * RETURNS: pointer to newly created ntb_queue, NULL on error. */ static struct ntb_transport_qp * -ntb_transport_create_queue(void *data, struct ntb_softc *pdev, +ntb_transport_create_queue(void *data, struct ntb_softc *ntb, const struct ntb_queue_handlers *handlers) { struct ntb_queue_entry *entry; struct ntb_transport_qp *qp; - struct ntb_netdev *nt; + struct ntb_transport_ctx *nt; unsigned int free_queue; - int rc, i; + int i; - nt = ntb_find_transport(pdev); - if (nt == NULL) - goto err; + nt = ntb_get_ctx(ntb, NULL); + KASSERT(nt != NULL, ("bogus")); - free_queue = ffs(nt->qp_bitmap); + free_queue = ffs_bit(&nt->qp_bitmap); if (free_queue == 0) - goto err; + return (NULL); /* decrement free_queue to make it zero based */ free_queue--; - clear_bit(free_queue, &nt->qp_bitmap); - - qp = &nt->qps[free_queue]; + qp = &nt->qp_vec[free_queue]; + clear_bit(qp->qp_num, &nt->qp_bitmap_free); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; qp->event_handler = handlers->event_handler; for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, - M_WAITOK|M_ZERO); + entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); entry->cb_data = nt->ifp; entry->buf = NULL; entry->len = transport_mtu; - ntb_list_add(&qp->ntb_rx_pend_q_lock, entry, &qp->rx_pend_q); + ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); } for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, - M_WAITOK|M_ZERO); + entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } - rc = ntb_register_db_callback(qp->ntb, free_queue, qp, - ntb_transport_rxc_db); - if (rc != 0) - goto err1; - + ntb_db_clear(ntb, 1ull << qp->qp_num); + ntb_db_clear_mask(ntb, 1ull << qp->qp_num); return (qp); - -err1: - while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) - free(entry, M_NTB_IF); - while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) - free(entry, M_NTB_IF); - set_bit(free_queue, &nt->qp_bitmap); -err: - return (NULL); } /** @@ -676,15 +857,17 @@ err: static void ntb_transport_link_up(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt; if (qp == NULL) return; - qp->client_ready = NTB_LINK_UP; - if (bootverbose) - device_printf(ntb_get_device(qp->ntb), "qp client ready\n"); + qp->client_ready = true; + + nt = qp->transport; + ntb_printf(2, "qp client ready\n"); - if (qp->transport->transport_link == NTB_LINK_UP) + if (qp->transport->link_is_up) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } @@ -700,7 +883,7 @@ ntb_transport_link_up(struct ntb_transpo * @len: length of the data buffer * * Enqueue a new transmit buffer onto the transport queue from which a NTB - * payload will be transmitted. This assumes that a lock is behing held to + * payload will be transmitted. This assumes that a lock is being held to * serialize access to the qp. * * RETURNS: An appropriate ERRNO error value on error, or zero for success. @@ -712,7 +895,7 @@ ntb_transport_tx_enqueue(struct ntb_tran struct ntb_queue_entry *entry; int rc; - if (qp == NULL || qp->qp_link != NTB_LINK_UP || len == 0) { + if (qp == NULL || !qp->link_is_up || len == 0) { CTR0(KTR_NTB, "TX: link not up"); return (EINVAL); } @@ -720,7 +903,8 @@ ntb_transport_tx_enqueue(struct ntb_tran entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); if (entry == NULL) { CTR0(KTR_NTB, "TX: could not get entry from tx_free_q"); - return (ENOMEM); + qp->tx_err_no_buf++; + return (EBUSY); } CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); @@ -744,9 +928,9 @@ ntb_process_tx(struct ntb_transport_qp * { void *offset; - offset = (char *)qp->tx_mw + qp->tx_max_frame * qp->tx_index; + offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%u, tx_index=%u, remote entry=%u", + "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); if (qp->tx_index == qp->remote_rx_info->entry) { CTR0(KTR_NTB, "TX: ring full"); @@ -757,8 +941,11 @@ ntb_process_tx(struct ntb_transport_qp * if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { if (qp->tx_handler != NULL) qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); + EIO); + else + m_freem(entry->buf); + entry->buf = NULL; ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); CTR1(KTR_NTB, "TX: frame too big. returning entry %p to tx_free_q", @@ -766,7 +953,7 @@ ntb_process_tx(struct ntb_transport_qp * return (0); } CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_tx_copy_task(qp, entry, offset); + ntb_memcpy_tx(qp, entry, offset); qp->tx_index++; qp->tx_index %= qp->tx_max_entry; @@ -777,26 +964,37 @@ ntb_process_tx(struct ntb_transport_qp * } static void -ntb_tx_copy_task(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, +ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, void *offset) { struct ntb_payload_header *hdr; + /* This piece is from Linux' ntb_async_tx() */ + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + entry->x_hdr = hdr; + iowrite32(entry->len, &hdr->len); + iowrite32(qp->tx_pkts, &hdr->ver); + + /* This piece is ntb_memcpy_tx() */ CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); - if (entry->buf != NULL) + if (entry->buf != NULL) { m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - hdr->len = entry->len; /* TODO: replace with bus_space_write */ - hdr->ver = qp->tx_pkts; /* TODO: replace with bus_space_write */ - wmb(); - /* TODO: replace with bus_space_write */ - hdr->flags = entry->flags | IF_NTB_DESC_DONE_FLAG; + /* + * Ensure that the data is fully copied before setting the + * flags + */ + wmb(); + } - ntb_ring_sdb(qp->ntb, qp->qp_num); + /* The rest is ntb_tx_copy_callback() */ + iowrite32(entry->flags | IF_NTB_DESC_DONE_FLAG, &hdr->flags); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat May 21 20:50:27 2016 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 22608B45EF4; Sat, 21 May 2016 20:50:27 +0000 (UTC) (envelope-from rmacklem@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 E31EA119F; Sat, 21 May 2016 20:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LKoQYm082955; Sat, 21 May 2016 20:50:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4LKoQPG082954; Sat, 21 May 2016 20:50:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605212050.u4LKoQPG082954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 21 May 2016 20:50:26 +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: r300379 - stable/10/sys/fs/nfsserver 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.22 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, 21 May 2016 20:50:27 -0000 Author: rmacklem Date: Sat May 21 20:50:25 2016 New Revision: 300379 URL: https://svnweb.freebsd.org/changeset/base/300379 Log: MFC: r299226 Don't increment srvrpccnt[] for the NFSv4.1 operations. When support for NFSv4.1 was added to the NFS server, it broke the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't have entries for the new NFSv4.1 operations. Without this patch, the code was incrementing bogus entries in newnfsstats for the new NFSv4.1 operations. This patch is an interim fix. The nfsstats structure needs to be updated and that will come in a future commit. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 21 19:54:10 2016 (r300378) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat May 21 20:50:25 2016 (r300379) @@ -771,7 +771,12 @@ nfsrvd_compound(struct nfsrv_descript *n } if (nfsv4_opflag[op].savereply) nd->nd_flag |= ND_SAVEREPLY; - NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); + /* + * For now, newnfsstats.srvrpccnt[] doesn't have entries + * for the NFSv4.1 operations. + */ + if (nd->nd_procnum < NFSV4OP_NOPS) + NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]); switch (op) { case NFSV4OP_PUTFH: error = nfsrv_mtofh(nd, &fh);