From owner-svn-src-stable@FreeBSD.ORG Sun Sep 14 02:55:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E77A06; Sun, 14 Sep 2014 02:55:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 4590B9DA; Sun, 14 Sep 2014 02:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2tIo0016446; Sun, 14 Sep 2014 02:55:18 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2tIZv016445; Sun, 14 Sep 2014 02:55:18 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201409140255.s8E2tIZv016445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 14 Sep 2014 02:55:18 +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: r271568 - stable/10/etc 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 02:55:18 -0000 Author: wblock (doc committer) Date: Sun Sep 14 02:55:17 2014 New Revision: 271568 URL: http://svnweb.freebsd.org/changeset/base/271568 Log: MFC r271434: Update motd, clarifying the information and adding pointers to other resources. Approved by: re@ (marius@) Modified: stable/10/etc/motd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/motd ============================================================================== --- stable/10/etc/motd Sun Sep 14 02:31:53 2014 (r271567) +++ stable/10/etc/motd Sun Sep 14 02:55:17 2014 (r271568) @@ -1,25 +1,21 @@ FreeBSD ?.?.? (UNKNOWN) -Welcome to FreeBSD! +Welcome to FreeBSD! Handy technical support resources: -Before seeking technical support, please use the following resources: +Security advisories and errata: https://www.FreeBSD.org/releases/ +Handbook: https://www.FreeBSD.org/handbook/ +FAQ: https://www.FreeBSD.org/faq/ +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ +Forums: https://forums.FreeBSD.org/ + +Documents installed with the system are in the /usr/local/share/doc/freebsd/ +directory, or can be installed later with: pkg install en-freebsd-doc +For other languages, replace "en" with a language code like de or fr. -o Security advisories and updated errata information for all releases are - at http://www.FreeBSD.org/releases/ - always consult the ERRATA section - for your release first as it's updated frequently. - -o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, - along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc package has been installed - (or fetched via pkg install lang-freebsd-doc, where lang is the - 2-letter language code, e.g. en), they are also available formatted - in /usr/local/share/doc/freebsd. - -If you still have a question or problem, please take the output of -`uname -a', along with any relevant error messages, and email it -as a question to the questions@FreeBSD.org mailing list. If you are -unfamiliar with FreeBSD's directory layout, please refer to the hier(7) -manual page. If you are not familiar with manual pages, type `man man'. +Show the version of FreeBSD installed: uname -a +Please include that output and any error messages when posting questions. -Edit /etc/motd to change this login announcement. +Introduction to manual pages: man man +FreeBSD directory layout: man hier +Edit /etc/motd to change this login announcement. From owner-svn-src-stable@FreeBSD.ORG Sun Sep 14 03:01:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D34D3C1E; Sun, 14 Sep 2014 03:01:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A546DA72; Sun, 14 Sep 2014 03:01:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E31IAE019531; Sun, 14 Sep 2014 03:01:18 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E31IMm019530; Sun, 14 Sep 2014 03:01:18 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201409140301.s8E31IMm019530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 14 Sep 2014 03:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271569 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 03:01:19 -0000 Author: wblock (doc committer) Date: Sun Sep 14 03:01:18 2014 New Revision: 271569 URL: http://svnweb.freebsd.org/changeset/base/271569 Log: MFC r271434: Update motd, clarifying the information and adding pointers to other resources. Modified: stable/9/etc/motd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/motd ============================================================================== --- stable/9/etc/motd Sun Sep 14 02:55:17 2014 (r271568) +++ stable/9/etc/motd Sun Sep 14 03:01:18 2014 (r271569) @@ -1,25 +1,21 @@ FreeBSD ?.?.? (UNKNOWN) -Welcome to FreeBSD! +Welcome to FreeBSD! Handy technical support resources: -Before seeking technical support, please use the following resources: +Security advisories and errata: https://www.FreeBSD.org/releases/ +Handbook: https://www.FreeBSD.org/handbook/ +FAQ: https://www.FreeBSD.org/faq/ +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ +Forums: https://forums.FreeBSD.org/ + +Documents installed with the system are in the /usr/local/share/doc/freebsd/ +directory, or can be installed later with: pkg install en-freebsd-doc +For other languages, replace "en" with a language code like de or fr. -o Security advisories and updated errata information for all releases are - at http://www.FreeBSD.org/releases/ - always consult the ERRATA section - for your release first as it's updated frequently. - -o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, - along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc package has been installed - (or fetched via pkg_add -r lang-freebsd-doc, where lang is the - 2-letter language code, e.g. en), they are also available formatted - in /usr/local/share/doc/freebsd. - -If you still have a question or problem, please take the output of -`uname -a', along with any relevant error messages, and email it -as a question to the questions@FreeBSD.org mailing list. If you are -unfamiliar with FreeBSD's directory layout, please refer to the hier(7) -manual page. If you are not familiar with manual pages, type `man man'. +Show the version of FreeBSD installed: uname -a +Please include that output and any error messages when posting questions. -Edit /etc/motd to change this login announcement. +Introduction to manual pages: man man +FreeBSD directory layout: man hier +Edit /etc/motd to change this login announcement. From owner-svn-src-stable@FreeBSD.ORG Sun Sep 14 23:25:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00753F95; Sun, 14 Sep 2014 23:25:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DF7C2692; Sun, 14 Sep 2014 23:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ENPAw9097770; Sun, 14 Sep 2014 23:25:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ENPA76097769; Sun, 14 Sep 2014 23:25:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409142325.s8ENPA76097769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 14 Sep 2014 23:25: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: r271605 - stable/10/etc 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 23:25:11 -0000 Author: gjb Date: Sun Sep 14 23:25:10 2014 New Revision: 271605 URL: http://svnweb.freebsd.org/changeset/base/271605 Log: Define NO_TESTS instead of WITHOUT_TESTS for the etc/ 'distribute' target to fix the WITH_TESTS=1 build. This is a direct commit to stable/10. Submitted by: ngie Approved by: re (rodrigc) Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/Makefile Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Sun Sep 14 22:13:19 2014 (r271604) +++ stable/10/etc/Makefile Sun Sep 14 23:25:10 2014 (r271605) @@ -177,7 +177,7 @@ afterinstall: distribute: # Avoid installing tests here; "make distribution" will do this and # correctly place them in the right location. - ${_+_}cd ${.CURDIR} ; ${MAKE} WITHOUT_TESTS=1 install \ + ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \ DESTDIR=${DISTDIR}/${DISTRIBUTION} ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 02:21:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C62D21; Mon, 15 Sep 2014 02:21:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 92ADC84E; Mon, 15 Sep 2014 02:21:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F2LYEf082143; Mon, 15 Sep 2014 02:21:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F2LYd4082142; Mon, 15 Sep 2014 02:21:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409150221.s8F2LYd4082142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 15 Sep 2014 02:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271608 - stable/10/release/scripts 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 02:21:34 -0000 Author: gjb Date: Mon Sep 15 02:21:34 2014 New Revision: 271608 URL: http://svnweb.freebsd.org/changeset/base/271608 Log: MFC r271480, r271483, r271491: r271480: Set PKG_CACHEDIR to an 'All/' directory one level lower to fix 'pkg repo' generating repository metadata for the on-disc packages. r271483: Fix duplicate PKG_ABI in the PKG_CACHEDIR path. r271491: Simplify dvd package population with pkg-1.3. Approved by: re (rodrigc) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/pkg-stage.sh ============================================================================== --- stable/10/release/scripts/pkg-stage.sh Sun Sep 14 23:48:18 2014 (r271607) +++ stable/10/release/scripts/pkg-stage.sh Mon Sep 15 02:21:34 2014 (r271608) @@ -40,20 +40,17 @@ if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi -PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') -PKG_ABI="${PKG_ABI%\";}" -PKG_ABI="${PKG_ABI#\"}" -export PKG_ABI -export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" +export PKG_ABI=$(pkg config ABI) +export PKG_REPODIR="dvd/packages/${PKG_ABI}" -/bin/mkdir -p ${PKG_CACHEDIR} +/bin/mkdir -p ${PKG_REPODIR} # Print pkg(8) information to make debugging easier. ${PKGCMD} -vv ${PKGCMD} update -f -${PKGCMD} fetch -d ${DVD_PACKAGES} +${PKGCMD} fetch -o ${PKG_REPODIR} -d ${DVD_PACKAGES} -${PKGCMD} repo ${PKG_CACHEDIR} +${PKGCMD} repo ${PKG_REPODIR} # Always exit '0', even if pkg(8) complains about conflicts. exit 0 From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 04:25:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 52F0E77; Mon, 15 Sep 2014 04:25:50 +0000 (UTC) Date: Mon, 15 Sep 2014 04:25:50 +0000 From: Alexey Dokuchaev To: Alexander Motin Subject: Re: svn commit: r271514 - stable/8/sys/dev/sound/pcm Message-ID: <20140915042550.GA15180@FreeBSD.org> References: <201409131522.s8DFM9dT079692@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409131522.s8DFM9dT079692@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 04:25:50 -0000 On Sat, Sep 13, 2014 at 03:22:09PM +0000, Alexander Motin wrote: > New Revision: 271514 > URL: http://svnweb.freebsd.org/changeset/base/271514 > > Log: > MFC r269228: > Add support for SOUND_MIXER_INFO IOCTL, used by gstreamer. Thank you! ./danfe From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 08:58:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 633DF1CE; Mon, 15 Sep 2014 08:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 342DD187; Mon, 15 Sep 2014 08:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F8wIXj064528; Mon, 15 Sep 2014 08:58:18 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F8wIpI064527; Mon, 15 Sep 2014 08:58:18 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409150858.s8F8wIpI064527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau MonnĂ© Date: Mon, 15 Sep 2014 08:58:18 +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: r271611 - stable/10/sys/dev/xen/blkfront 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 08:58:18 -0000 Author: royger Date: Mon Sep 15 08:58:17 2014 New Revision: 271611 URL: http://svnweb.freebsd.org/changeset/base/271611 Log: MFC r271099: revert r269814: blkfront: add support for unmapped IO Current busdma code for unmapped bios will not properly align the segment size, causing corruption on blkfront devices. Revert the commit until busdma code is fixed. Reported by: mav Approved by: re Modified: stable/10/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Mon Sep 15 07:20:40 2014 (r271610) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Mon Sep 15 08:58:17 2014 (r271611) @@ -272,12 +272,8 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - if (cm->cm_bp != NULL) - error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, - cm->cm_bp, xbd_queue_cb, cm, 0); - else - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, - cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -337,6 +333,8 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -995,7 +993,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; + sc->xbd_disk->d_flags = 0; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 11:35:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD475F46; Mon, 15 Sep 2014 11:35:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A883263B; Mon, 15 Sep 2014 11:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FBZEiv039070; Mon, 15 Sep 2014 11:35:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FBZEc0039069; Mon, 15 Sep 2014 11:35:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151135.s8FBZEc0039069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 11: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: r271618 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 11:35:14 -0000 Author: trasz Date: Mon Sep 15 11:35:14 2014 New Revision: 271618 URL: http://svnweb.freebsd.org/changeset/base/271618 Log: MFC r271393: Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting kern.cam.ctl.iscsi.ping_timeout to 0. This fixes interoperability with some initiators that don't properly support NOP-Ins, namely iPXE/gPXE. Approved by: re (kib) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 15 11:32:08 2014 (r271617) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 15 11:35:14 2014 (r271618) @@ -1006,6 +1006,19 @@ cfiscsi_callout(void *context) } #endif + if (ping_timeout <= 0) { + /* + * Pings are disabled. Don't send NOP-In in this case; + * user might have disabled pings to work around problems + * with certain initiators that can't properly handle + * NOP-In, such as iPXE. Reset the timeout, to avoid + * triggering reconnection, should the user decide to + * reenable them. + */ + cs->cs_timeout = 0; + return; + } + if (cs->cs_timeout >= ping_timeout) { CFISCSI_SESSION_WARN(cs, "no ping reply (NOP-Out) after %d seconds; " "dropping connection", ping_timeout); From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 12:36:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2A3CFA; Mon, 15 Sep 2014 12:36:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3A01CC3F; Mon, 15 Sep 2014 12:36:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FCafeR067308; Mon, 15 Sep 2014 12:36:41 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FCaex0067306; Mon, 15 Sep 2014 12:36:40 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409151236.s8FCaex0067306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 15 Sep 2014 12:36: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: r271620 - stable/10/sys/dev/ixgbe 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 12:36:41 -0000 Author: brueffer Date: Mon Sep 15 12:36:40 2014 New Revision: 271620 URL: http://svnweb.freebsd.org/changeset/base/271620 Log: MFC: r271286 Use the right constants in comparisons. This is currently a nop, as MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. Reviewed by: Eric Joyner @ Intel Approved by: re (kib) Modified: stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/ixgbe/ixv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:28:29 2014 (r271619) +++ stable/10/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) } if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else Modified: stable/10/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixv.c Mon Sep 15 12:28:29 2014 (r271619) +++ stable/10/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) @@ -347,7 +347,7 @@ ixv_attach(device_t dev) adapter->num_tx_desc = ixv_txd; if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 12:44:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CEF4F54; Mon, 15 Sep 2014 12:44:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 58047D15; Mon, 15 Sep 2014 12:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FCij2Y071635; Mon, 15 Sep 2014 12:44:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FCiiqE071632; Mon, 15 Sep 2014 12:44:44 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409151244.s8FCiiqE071632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 15 Sep 2014 12:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271621 - stable/9/sys/dev/ixgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 12:44:45 -0000 Author: brueffer Date: Mon Sep 15 12:44:44 2014 New Revision: 271621 URL: http://svnweb.freebsd.org/changeset/base/271621 Log: MFC: r271286 Use the right constants in comparisons. This is currently a nop, as MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. Reviewed by: Eric Joyner @ Intel Approved by: re (kib) Modified: stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) +++ stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:44:44 2014 (r271621) @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) } if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) +++ stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:44:44 2014 (r271621) @@ -347,7 +347,7 @@ ixv_attach(device_t dev) adapter->num_tx_desc = ixv_txd; if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 12:54:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F6E81DF; Mon, 15 Sep 2014 12:54:23 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8A5E02; Mon, 15 Sep 2014 12:54:22 +0000 (UTC) Received: from [130.235.5.34] (dator-30.onk.lu.se [130.235.5.34]) by mrelayeu.kundenserver.de (node=mreue004) with ESMTP (Nemesis) id 0M9tU4-1XeU8x024e-00B5bI; Mon, 15 Sep 2014 14:54:19 +0200 Message-ID: <5416E174.5040409@FreeBSD.org> Date: Mon, 15 Sep 2014 14:54:12 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r271621 - stable/9/sys/dev/ixgbe References: <201409151244.s8FCiiqE071632@svn.freebsd.org> In-Reply-To: <201409151244.s8FCiiqE071632@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:g+NUu2dvq8uxC/gorxFvtIrOPtsDXqTymFQKa4Y5FUc DER576DwNbe/o+hLLiVkjG+026R95q6GAEaHIsgOlXqggWgjGK 9Jv0SZ1uL3cBkJsCaU66l80ApoBAVZV4WXeTYir8Ipcqp6Xcb+ rt3SUUPkQUone0bMSPMUvMxKBq+vy+vB8tDZbFY91cDoFGQcqb ypIrQeHcxFB1tJK4TjKC0Wo5blgOvptwXMKyxX5nVHVIeCRta5 ARwrR51FvQG1IwwKvdcBPaG4IukP1XcsLG5Y7peBMlZcajNnIi fZFQ7/CC1mzfbuWz/9hL7j67jLz5cv92OKbTb0tdBQvJNvMRHm 3Q7lU3Zb59Th76/Cy+rI= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 12:54:23 -0000 Not approved by RE of course, since stable/9 is open. Chris On 2014-09-15 14:44, Christian Brueffer wrote: > Author: brueffer > Date: Mon Sep 15 12:44:44 2014 > New Revision: 271621 > URL: http://svnweb.freebsd.org/changeset/base/271621 > > Log: > MFC: r271286 > > Use the right constants in comparisons. This is currently a nop, as > MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. > > Reviewed by: Eric Joyner @ Intel > Approved by: re (kib) > > Modified: > stable/9/sys/dev/ixgbe/ixgbe.c > stable/9/sys/dev/ixgbe/ixv.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) > stable/9/sys/dev/ixgbe/ (props changed) > > Modified: stable/9/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) > +++ stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:44:44 2014 (r271621) > @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) > } > > if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || > - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { > + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { > device_printf(dev, "RXD config issue, using default!\n"); > adapter->num_rx_desc = DEFAULT_RXD; > } else > > Modified: stable/9/sys/dev/ixgbe/ixv.c > ============================================================================== > --- stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) > +++ stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:44:44 2014 (r271621) > @@ -347,7 +347,7 @@ ixv_attach(device_t dev) > adapter->num_tx_desc = ixv_txd; > > if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || > - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { > + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { > device_printf(dev, "RXD config issue, using default!\n"); > adapter->num_rx_desc = DEFAULT_RXD; > } else > From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 13:01:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371D93DA; Mon, 15 Sep 2014 13:01:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 222D7ED7; Mon, 15 Sep 2014 13:01:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FD1mjK080780; Mon, 15 Sep 2014 13:01:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FD1lpB080779; Mon, 15 Sep 2014 13:01:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151301.s8FD1lpB080779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 13:01: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: r271622 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 13:01:48 -0000 Author: trasz Date: Mon Sep 15 13:01:47 2014 New Revision: 271622 URL: http://svnweb.freebsd.org/changeset/base/271622 Log: MFC r271317: Avoid unlocking unlocked mutex in RCTL jail code. Specific test case is attached to PR. PR: 193457 Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Mon Sep 15 12:44:44 2014 (r271621) +++ stable/10/sys/kern/kern_jail.c Mon Sep 15 13:01:47 2014 (r271622) @@ -1811,9 +1811,11 @@ kern_jail_set(struct thread *td, struct #ifdef RACCT if (!created) { - sx_sunlock(&allprison_lock); + if (!(flags & JAIL_ATTACH)) + sx_sunlock(&allprison_lock); prison_racct_modify(pr); - sx_slock(&allprison_lock); + if (!(flags & JAIL_ATTACH)) + sx_slock(&allprison_lock); } #endif From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 13:19:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C196D78C; Mon, 15 Sep 2014 13:19:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AC4A0D0; Mon, 15 Sep 2014 13:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FDJeCf086488; Mon, 15 Sep 2014 13:19:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FDJeAI086487; Mon, 15 Sep 2014 13:19:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151319.s8FDJeAI086487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 13:19: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: r271623 - stable/10/usr.bin/rctl 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 13:19:40 -0000 Author: trasz Date: Mon Sep 15 13:19:40 2014 New Revision: 271623 URL: http://svnweb.freebsd.org/changeset/base/271623 Log: MFC r271436: Fix typo. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/rctl/rctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rctl/rctl.8 ============================================================================== --- stable/10/usr.bin/rctl/rctl.8 Mon Sep 15 13:01:47 2014 (r271622) +++ stable/10/usr.bin/rctl/rctl.8 Mon Sep 15 13:19:40 2014 (r271623) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2014 +.Dd September 11, 2014 .Dt RCTL 8 .Os .Sh NAME @@ -209,7 +209,7 @@ resource would be .Bl -column -offset 3n "pseudoterminals" .It Em action .It Sy deny Ta deny the allocation; not supported for -.Sy cpu +.Sy cputime and .Sy wallclock .It Sy log Ta "log a warning to the console" From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 14:04:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4FA5205; Mon, 15 Sep 2014 14:04:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9002F7B6; Mon, 15 Sep 2014 14:04:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FE4tmT009143; Mon, 15 Sep 2014 14:04:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FE4tgg009142; Mon, 15 Sep 2014 14:04:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151404.s8FE4tgg009142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 14:04: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: r271626 - stable/10/usr.sbin/ctld 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 14:04:55 -0000 Author: trasz Date: Mon Sep 15 14:04:55 2014 New Revision: 271626 URL: http://svnweb.freebsd.org/changeset/base/271626 Log: MFC r271157: Fix typo. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Mon Sep 15 13:59:36 2014 (r271625) +++ stable/10/usr.sbin/ctld/login.c Mon Sep 15 14:04:55 2014 (r271626) @@ -720,8 +720,8 @@ login_negotiate_key(struct pdu *request, "MaxRecvDataSegmentLength"); } if (tmp > MAX_DATA_SEGMENT_LENGTH) { - log_debugx("capping MaxDataSegmentLength from %d to %d", - tmp, MAX_DATA_SEGMENT_LENGTH); + log_debugx("capping MaxRecvDataSegmentLength " + "from %d to %d", tmp, MAX_DATA_SEGMENT_LENGTH); tmp = MAX_DATA_SEGMENT_LENGTH; } conn->conn_max_data_segment_length = tmp; From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 14:21:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CA8370C; Mon, 15 Sep 2014 14:21:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EB6B1999; Mon, 15 Sep 2014 14:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FELvte018262; Mon, 15 Sep 2014 14:21:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FELviL018261; Mon, 15 Sep 2014 14:21:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151421.s8FELviL018261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 14:21: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: r271627 - stable/10/usr.sbin/ctld 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 14:21:58 -0000 Author: trasz Date: Mon Sep 15 14:21:57 2014 New Revision: 271627 URL: http://svnweb.freebsd.org/changeset/base/271627 Log: MFC r271169: Turn two errors, which are possible to trigger only by bugs, into assertions. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:04:55 2014 (r271626) +++ stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:21:57 2014 (r271627) @@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_f client_salen = sizeof(client_sa); kernel_accept(&connection_id, &portal_id, (struct sockaddr *)&client_sa, &client_salen); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1806,10 +1804,8 @@ found: &client_salen); if (client_fd < 0) log_err(1, "accept"); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, - client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); + handle_connection(portal, client_fd, (struct sockaddr *)&client_sa, dont_fork); From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 16:40:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 408925ED; Mon, 15 Sep 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 11827CD3; Mon, 15 Sep 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FGeRMk080814; Mon, 15 Sep 2014 16:40:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FGeRhm080813; Mon, 15 Sep 2014 16:40:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151640.s8FGeRhm080813@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 16:40: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: r271632 - stable/10/usr.sbin/ctld 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 16:40:28 -0000 Author: trasz Date: Mon Sep 15 16:40:27 2014 New Revision: 271632 URL: http://svnweb.freebsd.org/changeset/base/271632 Log: MFC r271187: Avoid ctld(8) crash on getaddrinfo(3) failure. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 15:49:29 2014 (r271631) +++ stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 16:40:27 2014 (r271632) @@ -561,8 +561,10 @@ portal_new(struct portal_group *pg) static void portal_delete(struct portal *portal) { + TAILQ_REMOVE(&portal->p_portal_group->pg_portals, portal, p_next); - freeaddrinfo(portal->p_ai); + if (portal->p_ai != NULL) + freeaddrinfo(portal->p_ai); free(portal->p_listen); free(portal); } @@ -633,8 +635,7 @@ portal_group_add_listen(struct portal_gr arg = portal->p_listen; if (arg[0] == '\0') { log_warnx("empty listen address"); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '[') { @@ -646,8 +647,7 @@ portal_group_add_listen(struct portal_gr if (arg == NULL) { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '\0') { @@ -657,8 +657,7 @@ portal_group_add_listen(struct portal_gr } else { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } } else { @@ -691,8 +690,7 @@ portal_group_add_listen(struct portal_gr if (error != 0) { log_warnx("getaddrinfo for %s failed: %s", portal->p_listen, gai_strerror(error)); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 16:47:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 337478AC; Mon, 15 Sep 2014 16:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1E371DCB; Mon, 15 Sep 2014 16:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FGl4UY085012; Mon, 15 Sep 2014 16:47:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FGl4V3085011; Mon, 15 Sep 2014 16:47:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151647.s8FGl4V3085011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 16:47: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: r271633 - stable/10/release/powerpc 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 16:47:05 -0000 Author: emaste Date: Mon Sep 15 16:47:04 2014 New Revision: 271633 URL: http://svnweb.freebsd.org/changeset/base/271633 Log: MFC r265171 by nwhitehorn: Use mkimg instead of md(4) and gpart [for powerpc]. Approved by: re Modified: stable/10/release/powerpc/make-memstick.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/powerpc/make-memstick.sh ============================================================================== --- stable/10/release/powerpc/make-memstick.sh Mon Sep 15 16:40:27 2014 (r271632) +++ stable/10/release/powerpc/make-memstick.sh Mon Sep 15 16:47:04 2014 (r271633) @@ -41,38 +41,7 @@ if [ $? -ne 0 ]; then fi rm ${1}/etc/fstab -# -# Use $BLOCKSIZE for transfers to improve efficiency. When calculating -# how many blocks to transfer "+ 2" is to account for truncation in the -# division and to provide space for the label. -# - -filesize=`stat -f "%z" ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 1728)) -dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} -if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 -fi - -unit=`mdconfig -a -t vnode -f ${2}` -if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi - -gpart create -s APM ${unit} -gpart add -t freebsd-boot -s 800K ${unit} -gpart bootcode -p ${1}/boot/boot1.hfs -i 1 ${unit} -gpart add -t freebsd-ufs -l FreeBSD_Install ${unit} - -dd if=${tempfile} of=/dev/${unit}s3 bs=$BLOCKSIZE conv=sync -if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 -fi - -mdconfig -d -u ${unit} +mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} rm -f ${tempfile} From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 17:49:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A25ED67; Mon, 15 Sep 2014 17:49:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 52BC97A4; Mon, 15 Sep 2014 17:49:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHnncL014093; Mon, 15 Sep 2014 17:49:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHnksP014072; Mon, 15 Sep 2014 17:49:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151749.s8FHnksP014072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 17:49: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: r271636 - in stable/10: sbin/geom/class/part sys/geom/part sys/sys usr.sbin/bsdinstall/partedit 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 17:49:49 -0000 Author: emaste Date: Mon Sep 15 17:49:46 2014 New Revision: 271636 URL: http://svnweb.freebsd.org/changeset/base/271636 Log: MFC EFI support for the installer r264978 (nwhitehorn): Add EFI support to the installer. This requires that the kernel provide a sysctl to determine what firmware is in use. This sysctl does not exist yet, so the following blocks are in front of the wheels: - I've provisionally called this "hw.platform" after the equivalent thing on PPC - The logic to check the sysctl is short-circuited to always choose BIOS. There's a comment in the top of the file about how to turn this off. If IA64 acquired a boot1.efifat-like thing (probably with very few modifications), the same code could be adapted there. r265016 (nwhitehorn): Finish connecting up installer UEFI support. If the kernel was booted using EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up for BIOS. r268256 (nwhitehorn): After EFI support was added to the installer, it needed to allow boot partitions of types other than "freebsd-boot" (in particular, "efi"). This allows the removal of some nasty hacks for supporting PowerPC systems, in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific code on MBR. This changes the installer to use the correct names, which also breaks a degeneracy in the meaning of "freebsd-boot" that allows the addition of support for some newer IBM systems that can boot from GPT in addition to MBR. Since I have no idea how to detect which those systems are, leave the default on IBM PPC systems as MBR for now. Approved by: re PR: 193658 Relnotes: Yes Modified: stable/10/sbin/geom/class/part/gpart.8 stable/10/sys/geom/part/g_part.c stable/10/sys/geom/part/g_part.h stable/10/sys/geom/part/g_part_apm.c stable/10/sys/geom/part/g_part_gpt.c stable/10/sys/geom/part/g_part_mbr.c stable/10/sys/sys/gpt.h stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c stable/10/usr.sbin/bsdinstall/partedit/partedit.h stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sbin/geom/class/part/gpart.8 Mon Sep 15 17:49:46 2014 (r271636) @@ -574,6 +574,16 @@ Symbolic names currently understood and .Fx are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-boot +The system partition dedicated to storing boot loaders on some Apple +systems. +The scheme-specific types are +.Qq Li "!171" +for MBR, +.Qq Li "!Apple_Bootstrap" +for APM, and +.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac" +for GPT. .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. Usually it is used by the GRUB 2 loader for GPT partitioning schemes. @@ -844,6 +854,14 @@ A partition that contains a NTFS or exFA The scheme-specific type is .Qq Li "!7" for MBR. +.It Cm prep-boot +The system partition dedicated to storing boot loaders on some PowerPC systems, +notably those made by IBM. +The scheme-specific types are +.Qq Li "!65" +for MBR and +.Qq Li "!0x9e1a2d38-c612-4316-aa26-8b49521e5a8b" +for GPT. .It Cm vmware-vmfs A partition that contains a VMware File System (VMFS). The scheme-specific types are @@ -1039,7 +1057,7 @@ Instead, the 800 KBytes bootstrap code i should be written with the .Cm gpart bootcode command to a partition of type -.Cm freebsd-boot , +.Cm apple-boot , which should also be 800 KB in size. .Sh OPERATIONAL FLAGS Actions other than the Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part.c Mon Sep 15 17:49:46 2014 (r271636) @@ -117,6 +117,7 @@ struct g_part_alias_list { { "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY }, { "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER }, { "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 }, + { "prep-boot", G_PART_ALIAS_PREP_BOOT }, }; SYSCTL_DECL(_kern_geom); Modified: stable/10/sys/geom/part/g_part.h ============================================================================== --- stable/10/sys/geom/part/g_part.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part.h Mon Sep 15 17:49:46 2014 (r271636) @@ -84,6 +84,7 @@ enum g_part_alias { G_PART_ALIAS_DFBSD_LEGACY, /* A DfBSD legacy partition entry */ G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ + G_PART_ALIAS_PREP_BOOT, /* A PREP/CHRP boot partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: stable/10/sys/geom/part/g_part_apm.c ============================================================================== --- stable/10/sys/geom/part/g_part_apm.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_apm.c Mon Sep 15 17:49:46 2014 (r271636) @@ -149,11 +149,6 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_APPLE_UFS); return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT); - if (!strcasecmp(type, alias)) { - strcpy(buf, APM_ENT_TYPE_APPLE_BOOT); - return (0); - } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD); Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_gpt.c Mon Sep 15 17:49:46 2014 (r271636) @@ -190,6 +190,7 @@ static struct uuid gpt_uuid_dfbsd_hammer static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32; static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64; +static struct uuid gpt_uuid_prep_boot = GPT_ENT_TYPE_PREP_BOOT; static struct g_part_uuid_alias { struct uuid *uuid; @@ -240,6 +241,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_dfbsd_hammer2, G_PART_ALIAS_DFBSD_HAMMER2, 0 }, { &gpt_uuid_dfbsd_label32, G_PART_ALIAS_DFBSD, 0xa5 }, { &gpt_uuid_dfbsd_label64, G_PART_ALIAS_DFBSD64, 0xa5 }, + { &gpt_uuid_prep_boot, G_PART_ALIAS_PREP_BOOT, 0x41 }, { NULL, 0, 0 } }; Modified: stable/10/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/10/sys/geom/part/g_part_mbr.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_mbr.c Mon Sep 15 17:49:46 2014 (r271636) @@ -135,7 +135,7 @@ static struct g_part_mbr_alias { { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, - { DOSPTYP_PPCBOOT, G_PART_ALIAS_FREEBSD_BOOT }, + { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, }; Modified: stable/10/sys/sys/gpt.h ============================================================================== --- stable/10/sys/sys/gpt.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/sys/gpt.h Mon Sep 15 17:49:46 2014 (r271636) @@ -91,6 +91,8 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_PREP_BOOT \ + {0x9e1a2d38,0xc612,0x4316,0xaa,0x26,{0x8b,0x49,0x52,0x1e,0x5a,0x8b}} /* * The following are unused but documented here to avoid reuse. Modified: stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 15 17:49:46 2014 (r271636) @@ -584,7 +584,7 @@ set_default_part_metadata(const char *na if (strcmp(type, "freebsd-swap") == 0) mountpoint = "none"; - if (strcmp(type, "freebsd-boot") == 0) + if (strcmp(type, bootpart_type(scheme)) == 0) md->bootcode = 1; /* VTOC8 needs partcode in UFS partitions */ @@ -949,7 +949,8 @@ addpartform: LIST_FOREACH(gc, &pp->lg_config, lg_config) if (strcmp(gc->lg_name, "type") == 0) break; - if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0) + if (gc != NULL && strcmp(gc->lg_val, + bootpart_type(scheme)) == 0) break; } @@ -971,7 +972,7 @@ addpartform: gctl_ro_param(r, "arg0", -1, geom->lg_name); gctl_ro_param(r, "flags", -1, GPART_FLAGS); gctl_ro_param(r, "verb", -1, "add"); - gctl_ro_param(r, "type", -1, "freebsd-boot"); + gctl_ro_param(r, "type", -1, bootpart_type(scheme)); snprintf(sizestr, sizeof(sizestr), "%jd", bootpart_size(scheme) / sector); gctl_ro_param(r, "size", -1, sizestr); @@ -1031,7 +1032,7 @@ addpartform: gctl_issue(r); /* Error usually expected and non-fatal */ gctl_free(r); - if (strcmp(items[0].text, "freebsd-boot") == 0) + if (strcmp(items[0].text, bootpart_type(scheme)) == 0) get_part_metadata(newpartname, 1)->bootcode = 1; else if (strcmp(items[0].text, "freebsd") == 0) gpart_partition(newpartname, "BSD"); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit.h ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit.h Mon Sep 15 17:49:46 2014 (r271636) @@ -74,9 +74,10 @@ void set_default_part_metadata(const cha /* machine-dependent bootability checks */ const char *default_scheme(void); -int is_scheme_bootable(const char *part_type); -size_t bootpart_size(const char *part_type); -const char *bootcode_path(const char *part_type); -const char *partcode_path(const char *part_type); +int is_scheme_bootable(const char *scheme); +size_t bootpart_size(const char *scheme); +const char *bootpart_type(const char *scheme); +const char *bootcode_path(const char *scheme); +const char *partcode_path(const char *scheme); #endif Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Mon Sep 15 17:49:46 2014 (r271636) @@ -58,6 +58,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Mon Sep 15 17:49:46 2014 (r271636) @@ -52,6 +52,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { if (strcmp(part_type, "PC98") == 0) return ("/boot/pc98boot"); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Sep 15 17:49:46 2014 (r271636) @@ -60,7 +60,8 @@ is_scheme_bootable(const char *part_type if (strcmp(platform, "ps3") == 0 && strcmp(part_type, "GPT") == 0) return (1); if (strcmp(platform, "chrp") == 0 && - (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0)) + (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 || + strcmp(part_type, "GPT") == 0)) return (1); return (0); @@ -68,21 +69,46 @@ is_scheme_bootable(const char *part_type size_t bootpart_size(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0) return (800*1024); + if (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0) + return (800*1024); return (0); } const char * +bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + + if (strcmp(platform, "chrp") == 0) + return ("prep-boot"); + if (strcmp(platform, "powermac") == 0) + return ("apple-boot"); + + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } const char * partcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0) return ("/boot/boot1.hfs"); - if (strcmp(part_type, "MBR") == 0) + if (strcmp(part_type, "MBR") == 0 || + (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0)) return ("/boot/boot1.elf"); return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Mon Sep 15 17:49:46 2014 (r271636) @@ -50,6 +50,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:49:46 2014 (r271636) @@ -26,10 +26,15 @@ * $FreeBSD$ */ +#include +#include #include #include "partedit.h" +static char platform[255] = ""; +static const char *platform_sysctl = "machdep.bootmethod"; + const char * default_scheme(void) { return ("GPT"); @@ -37,27 +42,60 @@ default_scheme(void) { int is_scheme_bootable(const char *part_type) { - if (strcmp(part_type, "BSD") == 0) - return (1); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(part_type, "GPT") == 0) return (1); - if (strcmp(part_type, "MBR") == 0) - return (1); + if (strcmp(platform, "BIOS") == 0) { + if (strcmp(part_type, "BSD") == 0) + return (1); + if (strcmp(part_type, "MBR") == 0) + return (1); + } return (0); } size_t -bootpart_size(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return (64*1024); +bootpart_size(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); /* No partcode except for GPT */ + if (strcmp(scheme, "GPT") != 0) + return (0); + + if (strcmp(platform, "BIOS") == 0) + return (64*1024); + else + return (800*1024); + return (0); } const char * +bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(platform, "UEFI") == 0) + return ("efi"); + + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(platform, "UEFI") == 0) + return (NULL); + if (strcmp(part_type, "GPT") == 0) return ("/boot/pmbr"); if (strcmp(part_type, "MBR") == 0) @@ -70,8 +108,16 @@ bootcode_path(const char *part_type) { const char * partcode_path(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return ("/boot/gptboot"); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(part_type, "GPT") == 0) { + if (strcmp(platform, "UEFI") == 0) + return ("/boot/boot1.efifat"); + else + return ("/boot/gptboot"); + } /* No partcode except for GPT */ return (NULL); From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 17:56:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A1B9EE; Mon, 15 Sep 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1460088F; Mon, 15 Sep 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHutlC018410; Mon, 15 Sep 2014 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHutEc018409; Mon, 15 Sep 2014 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151756.s8FHutEc018409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 17:56: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: r271637 - stable/10/usr.sbin/bsdinstall/partedit 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 17:56:56 -0000 Author: emaste Date: Mon Sep 15 17:56:55 2014 New Revision: 271637 URL: http://svnweb.freebsd.org/changeset/base/271637 Log: MFC r268540 by nwhitehorn: Allow up to 512K for boot code on GPT with BIOS. As pmbr.s says in a comment, "545K should be enough for any boot code". This rounds down slightly. Approved by: re Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:49:46 2014 (r271636) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:56:55 2014 (r271637) @@ -69,7 +69,7 @@ bootpart_size(const char *scheme) { return (0); if (strcmp(platform, "BIOS") == 0) - return (64*1024); + return (512*1024); else return (800*1024); From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 18:11:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75FFB8F9; Mon, 15 Sep 2014 18:11:50 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 13A5CA72; Mon, 15 Sep 2014 18:11:50 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 143891) id 3A42443AD; Mon, 15 Sep 2014 20:11:27 +0200 (SAST) Date: Mon, 15 Sep 2014 20:11:27 +0200 From: John Hay To: Xin LI Subject: Re: svn commit: r269800 - stable/10/sbin/ping6 Message-ID: <20140915181126.GA22013@zibbi.meraka.csir.co.za> References: <53e8688f.2851.32479e23@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e8688f.2851.32479e23@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 18:11:50 -0000 Hi Xin, I have just upgraded one of my boxes to 10-stable and found one of my scripts just hangs. I traced it to this change in ping6. If you do "ping6 -c 3 ", ping6 will hang until you ^C it. Regards John On Mon, Aug 11, 2014 at 06:54:07AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Aug 11 06:54:07 2014 > New Revision: 269800 > URL: http://svnweb.freebsd.org/changeset/base/269800 > > Log: > MFC r269180: > > When interval is set to very small value with limited amount of packets, > ping6(8) would quit before the remote side gets a chance to respond. > > Solve this by resetting the itimer when we have reached the maximum packet > number have reached, but let the other handling to continue. > > PR: bin/151023 > Submitted by: tjmao at tjmao.net > > Modified: > stable/10/sbin/ping6/ping6.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/ping6/ping6.c > ============================================================================== > --- stable/10/sbin/ping6/ping6.c Mon Aug 11 03:04:16 2014 (r269799) > +++ stable/10/sbin/ping6/ping6.c Mon Aug 11 06:54:07 2014 (r269800) > @@ -1090,8 +1090,14 @@ main(int argc, char *argv[]) > /* signal handling */ > if (seenalrm) { > /* last packet sent, timeout reached? */ > - if (npackets && ntransmitted >= npackets) > - break; > + if (npackets && ntransmitted >= npackets) { > + struct timeval zerotime = {0, 0}; > + itimer.it_value = zerotime; > + itimer.it_interval = zerotime; > + (void)setitimer(ITIMER_REAL, &itimer, NULL); > + seenalrm = 0; /* clear flag */ > + continue; > + } > retransmit(); > seenalrm = 0; > continue; From owner-svn-src-stable@FreeBSD.ORG Mon Sep 15 20:08:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17E6A226; Mon, 15 Sep 2014 20:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 034D1928; Mon, 15 Sep 2014 20:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FK87cX081112; Mon, 15 Sep 2014 20:08:07 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FK87B2081111; Mon, 15 Sep 2014 20:08:07 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409152008.s8FK87B2081111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 15 Sep 2014 20:08:07 +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: r271646 - stable/10/share/vt/keymaps 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 20:08:08 -0000 Author: se Date: Mon Sep 15 20:08:07 2014 New Revision: 271646 URL: http://svnweb.freebsd.org/changeset/base/271646 Log: MFC r271452: Add two forgotten keymap names (fr.kbd and fr.acc.kbd) to the list of files to be installed. Approved by: re Modified: stable/10/share/vt/keymaps/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/keymaps/Makefile ============================================================================== --- stable/10/share/vt/keymaps/Makefile Mon Sep 15 19:53:49 2014 (r271645) +++ stable/10/share/vt/keymaps/Makefile Mon Sep 15 20:08:07 2014 (r271646) @@ -31,8 +31,10 @@ FILES= INDEX.keymaps \ es.dvorak.kbd \ es.kbd \ fi.kbd \ + fr.acc.kbd \ fr.dvorak.acc.kbd \ fr.dvorak.kbd \ + fr.kbd \ fr.macbook.kbd \ gr.101.acc.kbd \ gr.elot.acc.kbd \ From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 00:04:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DB7B4C2; Tue, 16 Sep 2014 00:04:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 77F5E3C9; Tue, 16 Sep 2014 00:04:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G04dcB093979; Tue, 16 Sep 2014 00:04:39 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G04d8D093978; Tue, 16 Sep 2014 00:04:39 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409160004.s8G04d8D093978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 00:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271653 - stable/9/sys/netinet/cc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 00:04:39 -0000 Author: lstewart Date: Tue Sep 16 00:04:38 2014 New Revision: 271653 URL: http://svnweb.freebsd.org/changeset/base/271653 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Modified: stable/9/sys/netinet/cc/cc_cdg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/9/sys/netinet/cc/cc_cdg.c Mon Sep 15 23:43:01 2014 (r271652) +++ stable/9/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:04:38 2014 (r271653) @@ -226,6 +226,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -239,7 +240,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -283,6 +285,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 00:11:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBF773B; Tue, 16 Sep 2014 00:11:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 0731266E; Tue, 16 Sep 2014 00:11:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G0B1sC096567; Tue, 16 Sep 2014 00:11:01 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G0B1uQ096566; Tue, 16 Sep 2014 00:11:01 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409160011.s8G0B1uQ096566@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 00:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271654 - stable/8/sys/netinet/cc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 00:11:02 -0000 Author: lstewart Date: Tue Sep 16 00:11:01 2014 New Revision: 271654 URL: http://svnweb.freebsd.org/changeset/base/271654 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Modified: stable/8/sys/netinet/cc/cc_cdg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/8/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:04:38 2014 (r271653) +++ stable/8/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:11:01 2014 (r271654) @@ -226,6 +226,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -239,7 +240,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -283,6 +285,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 01:59:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3CCE1E; Tue, 16 Sep 2014 01:59:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 698B5F2D; Tue, 16 Sep 2014 01:59:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G1xKDL045979; Tue, 16 Sep 2014 01:59:20 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G1xKtd045978; Tue, 16 Sep 2014 01:59:20 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409160159.s8G1xKtd045978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 16 Sep 2014 01:59: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: r271659 - stable/10/sys/amd64/vmm 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 01:59:20 -0000 Author: grehan Date: Tue Sep 16 01:59:19 2014 New Revision: 271659 URL: http://svnweb.freebsd.org/changeset/base/271659 Log: MFC r270689: Implement the 0x2B SUB instruction, and the OR variant of 0x81. Found with local APIC accesses from bitrig/amd64 bsd.rd, 07/15-snap. Approved by: re (rodrigc) Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Sep 16 01:21:47 2014 (r271658) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Sep 16 01:59:19 2014 (r271659) @@ -65,6 +65,7 @@ enum { VIE_OP_TYPE_MOVZX, VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, + VIE_OP_TYPE_SUB, VIE_OP_TYPE_TWO_BYTE, VIE_OP_TYPE_PUSH, VIE_OP_TYPE_CMP, @@ -97,6 +98,10 @@ static const struct vie_op one_byte_opco .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE }, + [0x2B] = { + .op_byte = 0x2B, + .op_type = VIE_OP_TYPE_SUB, + }, [0x3B] = { .op_byte = 0x3B, .op_type = VIE_OP_TYPE_CMP, @@ -597,18 +602,16 @@ emulate_and(void *vm, int vcpuid, uint64 break; case 0x81: /* - * AND mem (ModRM:r/m) with immediate and store the + * AND/OR mem (ModRM:r/m) with immediate and store the * result in mem. * - * 81 /4 and r/m16, imm16 - * 81 /4 and r/m32, imm32 - * REX.W + 81 /4 and r/m64, imm32 sign-extended to 64 + * AND: i = 4 + * OR: i = 1 + * 81 /i op r/m16, imm16 + * 81 /i op r/m32, imm32 + * REX.W + 81 /i op r/m64, imm32 sign-extended to 64 * - * Currently, only the AND operation of the 0x81 opcode - * is implemented (ModRM:reg = b100). */ - if ((vie->reg & 7) != 4) - break; /* get the first operand */ error = memread(vm, vcpuid, gpa, &val1, size, arg); @@ -616,11 +619,26 @@ emulate_and(void *vm, int vcpuid, uint64 break; /* - * perform the operation with the pre-fetched immediate - * operand and write the result - */ - val1 &= vie->immediate; - error = memwrite(vm, vcpuid, gpa, val1, size, arg); + * perform the operation with the pre-fetched immediate + * operand and write the result + */ + switch (vie->reg & 7) { + case 0x4: + /* modrm:reg == b100, AND */ + val1 &= vie->immediate; + break; + case 0x1: + /* modrm:reg == b001, OR */ + val1 |= vie->immediate; + break; + default: + error = EINVAL; + break; + } + if (error) + break; + + error = memwrite(vm, vcpuid, gpa, val1, size, arg); break; default: break; @@ -723,6 +741,62 @@ emulate_cmp(void *vm, int vcpuid, uint64 } static int +emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x2B: + /* + * SUB r/m from r and store the result in r + * + * 2B/r SUB r16, r/m16 + * 2B/r SUB r32, r/m32 + * REX.W + 2B/r SUB r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 - val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getcc(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_push(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie, struct vm_guest_paging *paging, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -865,6 +939,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_or(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_SUB: + error = emulate_sub(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; default: error = EINVAL; break; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 09:48:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0B2EF75; Tue, 16 Sep 2014 09:48:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8C60AF5B; Tue, 16 Sep 2014 09:48:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9mZeg062802; Tue, 16 Sep 2014 09:48:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9mZnx062801; Tue, 16 Sep 2014 09:48:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160948.s8G9mZnx062801@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:48: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: r271667 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 09:48:35 -0000 Author: delphij Date: Tue Sep 16 09:48:35 2014 New Revision: 271667 URL: http://svnweb.freebsd.org/changeset/base/271667 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Approved by: re (implicit, security advisory) Modified: stable/10/sys/netinet/tcp_input.c Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Tue Sep 16 09:48:24 2014 (r271666) +++ stable/10/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) @@ -2176,11 +2176,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 09:49:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 850D5132; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 70B29F65; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9nCgk062943; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9nCV3062942; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160949.s8G9nCV3062942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271668 - in stable: 8/sys/netinet 9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 09:49:12 -0000 Author: delphij Date: Tue Sep 16 09:49:11 2014 New Revision: 271668 URL: http://svnweb.freebsd.org/changeset/base/271668 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Modified: stable/9/sys/netinet/tcp_input.c Changes in other areas also in this revision: Modified: stable/8/sys/netinet/tcp_input.c Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) +++ stable/9/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) @@ -2184,11 +2184,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 09:49:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7DC6134; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C2269F66; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9nCjl062949; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9nC7A062948; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160949.s8G9nC7A062948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271668 - in stable: 8/sys/netinet 9/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 09:49:13 -0000 Author: delphij Date: Tue Sep 16 09:49:11 2014 New Revision: 271668 URL: http://svnweb.freebsd.org/changeset/base/271668 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Modified: stable/8/sys/netinet/tcp_input.c Changes in other areas also in this revision: Modified: stable/9/sys/netinet/tcp_input.c Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) +++ stable/8/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) @@ -2092,11 +2092,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 17:47:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1296CD; Tue, 16 Sep 2014 17:47:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8B9A91E4; Tue, 16 Sep 2014 17:47:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GHlDgX093265; Tue, 16 Sep 2014 17:47:13 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GHlD4M093264; Tue, 16 Sep 2014 17:47:13 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409161747.s8GHlD4M093264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 16 Sep 2014 17:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271683 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 17:47:13 -0000 Author: smh Date: Tue Sep 16 17:47:13 2014 New Revision: 271683 URL: http://svnweb.freebsd.org/changeset/base/271683 Log: MFC 265253: Don't treat TRIM requests returning ENOTSUP as an unexpected error Approved by: re (gjb) Sponsored by: Multiplay Modified: 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/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Sep 16 17:42:37 2014 (r271682) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Sep 16 17:47:13 2014 (r271683) @@ -2738,7 +2738,10 @@ zio_vdev_io_done(zio_t *zio) zio->io_error = zio_handle_label_injection(zio, EIO); if (zio->io_error) { - if (!vdev_accessible(vd, zio)) { + if (zio->io_error == ENOTSUP && + zio->io_type == ZIO_TYPE_FREE) { + /* Not all devices support TRIM. */ + } else if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); } else { unexpected_error = B_TRUE; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:08:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 434BBC36; Tue, 16 Sep 2014 19:08:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 22E55D7E; Tue, 16 Sep 2014 19:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJ8uYK031419; Tue, 16 Sep 2014 19:08:56 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJ8tZ3031411; Tue, 16 Sep 2014 19:08:55 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409161908.s8GJ8tZ3031411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 16 Sep 2014 19:08: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: r271685 - stable/10/usr.sbin/bhyve 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:08:56 -0000 Author: grehan Date: Tue Sep 16 19:08:54 2014 New Revision: 271685 URL: http://svnweb.freebsd.org/changeset/base/271685 Log: MFC virtio-net changes. Re-tested with NetBSD/amd64 5.2.2, 6.1.4 and 7-beta. r271299: Add a callback to be notified about negotiated features. r271338: Allow vtnet operation without merged rx buffers. NetBSD's virtio-net implementation doesn't negotiate the merged rx-buffers feature. To support this, check to see if the feature was negotiated, and then adjust the operation of the receive path accordingly by using a larger iovec, and a smaller rx header. In addition, ignore writes to the (read-only) status byte. Approved by: re (glebius) Obtained from: Vincenzo Maffione, Universita` di Pisa (r271299) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/pci_virtio_rnd.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 16 19:08:54 2014 (r271685) @@ -133,6 +133,7 @@ static struct virtio_consts vtblk_vi_con pci_vtblk_notify, /* device-wide qnotify */ pci_vtblk_cfgread, /* read PCI config */ pci_vtblk_cfgwrite, /* write PCI config */ + NULL, /* apply negotiated features */ VTBLK_S_HOSTCAPS, /* our capabilities */ }; Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 16 19:08:54 2014 (r271685) @@ -135,11 +135,14 @@ struct pci_vtnet_softc { int vsc_rx_ready; volatile int resetting; /* set and checked outside lock */ - uint32_t vsc_features; + uint64_t vsc_features; /* negotiated features */ + struct virtio_net_config vsc_config; pthread_mutex_t rx_mtx; int rx_in_progress; + int rx_vhdrlen; + int rx_merge; /* merged rx bufs in use */ pthread_t tx_tid; pthread_mutex_t tx_mtx; @@ -151,6 +154,7 @@ static void pci_vtnet_reset(void *); /* static void pci_vtnet_notify(void *, struct vqueue_info *); */ static int pci_vtnet_cfgread(void *, int, int, uint32_t *); static int pci_vtnet_cfgwrite(void *, int, int, uint32_t); +static void pci_vtnet_neg_features(void *, uint64_t); static struct virtio_consts vtnet_vi_consts = { "vtnet", /* our name */ @@ -160,6 +164,7 @@ static struct virtio_consts vtnet_vi_con NULL, /* device-wide qnotify -- not used */ pci_vtnet_cfgread, /* read PCI config */ pci_vtnet_cfgwrite, /* write PCI config */ + pci_vtnet_neg_features, /* apply negotiated features */ VTNET_S_HOSTCAPS, /* our capabilities */ }; @@ -212,6 +217,8 @@ pci_vtnet_reset(void *vsc) pci_vtnet_rxwait(sc); sc->vsc_rx_ready = 0; + sc->rx_merge = 1; + sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); /* now reset rings, MSI-X vectors, and negotiated capabilities */ vi_reset_dev(&sc->vsc_vs); @@ -253,14 +260,34 @@ pci_vtnet_tap_tx(struct pci_vtnet_softc */ static uint8_t dummybuf[2048]; +static __inline struct iovec * +rx_iov_trim(struct iovec *iov, int *niov, int tlen) +{ + struct iovec *riov; + + /* XXX short-cut: assume first segment is >= tlen */ + assert(iov[0].iov_len >= tlen); + + iov[0].iov_len -= tlen; + if (iov[0].iov_len == 0) { + assert(*niov > 1); + *niov -= 1; + riov = &iov[1]; + } else { + iov[0].iov_base = (void *)((uintptr_t)iov[0].iov_base + tlen); + riov = &iov[0]; + } + + return (riov); +} + static void pci_vtnet_tap_rx(struct pci_vtnet_softc *sc) { + struct iovec iov[VTNET_MAXSEGS], *riov; struct vqueue_info *vq; - struct virtio_net_rxhdr *vrx; - uint8_t *buf; - int len; - struct iovec iov; + void *vrx; + int len, n; /* * Should never be called without a valid tap fd @@ -296,21 +323,19 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc do { /* - * Get descriptor chain, which should have just - * one descriptor in it. - * ??? allow guests to use multiple descs? + * Get descriptor chain. */ - assert(vq_getchain(vq, &iov, 1, NULL) == 1); + n = vq_getchain(vq, iov, VTNET_MAXSEGS, NULL); + assert(n >= 1 && n <= VTNET_MAXSEGS); /* * Get a pointer to the rx header, and use the * data immediately following it for the packet buffer. */ - vrx = iov.iov_base; - buf = (uint8_t *)(vrx + 1); + vrx = iov[0].iov_base; + riov = rx_iov_trim(iov, &n, sc->rx_vhdrlen); - len = read(sc->vsc_tapfd, buf, - iov.iov_len - sizeof(struct virtio_net_rxhdr)); + len = readv(sc->vsc_tapfd, riov, n); if (len < 0 && errno == EWOULDBLOCK) { /* @@ -323,16 +348,21 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * The only valid field in the rx packet header is the - * number of buffers, which is always 1 without TSO - * support. + * number of buffers if merged rx bufs were negotiated. */ - memset(vrx, 0, sizeof(struct virtio_net_rxhdr)); - vrx->vrh_bufs = 1; + memset(vrx, 0, sc->rx_vhdrlen); + + if (sc->rx_merge) { + struct virtio_net_rxhdr *vrxh; + + vrxh = vrx; + vrxh->vrh_bufs = 1; + } /* * Release this chain and handle more chains. */ - vq_relchain(vq, len + sizeof(struct virtio_net_rxhdr)); + vq_relchain(vq, len + sc->rx_vhdrlen); } while (vq_has_descs(vq)); /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ @@ -623,6 +653,8 @@ pci_vtnet_init(struct vmctx *ctx, struct sc->resetting = 0; + sc->rx_merge = 1; + sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); sc->rx_in_progress = 0; pthread_mutex_init(&sc->rx_mtx, NULL); @@ -656,9 +688,10 @@ pci_vtnet_cfgwrite(void *vsc, int offset ptr = &sc->vsc_config.mac[offset]; memcpy(ptr, &value, size); } else { + /* silently ignore other writes */ DPRINTF(("vtnet: write to readonly reg %d\n\r", offset)); - return (1); } + return (0); } @@ -673,6 +706,20 @@ pci_vtnet_cfgread(void *vsc, int offset, return (0); } +static void +pci_vtnet_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vtnet_softc *sc = vsc; + + sc->vsc_features = negotiated_features; + + if (!(sc->vsc_features & VIRTIO_NET_F_MRG_RXBUF)) { + sc->rx_merge = 0; + /* non-merge rx header is 2 bytes shorter */ + sc->rx_vhdrlen -= 2; + } +} + struct pci_devemu pci_de_vnet = { .pe_emu = "virtio-net", .pe_init = pci_vtnet_init, Modified: stable/10/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 16 19:08:54 2014 (r271685) @@ -80,6 +80,7 @@ static struct virtio_consts vtrnd_vi_con pci_vtrnd_notify, /* device-wide qnotify */ NULL, /* read virtio config */ NULL, /* write virtio config */ + NULL, /* apply negotiated features */ 0, /* our capabilities */ }; Modified: stable/10/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/virtio.c Tue Sep 16 19:08:54 2014 (r271685) @@ -694,6 +694,9 @@ bad: switch (offset) { case VTCFG_R_GUESTCAP: vs->vs_negotiated_caps = value & vc->vc_hv_caps; + if (vc->vc_apply_features) + (*vc->vc_apply_features)(DEV_SOFTC(vs), + vs->vs_negotiated_caps); break; case VTCFG_R_PFN: if (vs->vs_curq >= vc->vc_nvq) Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/virtio.h Tue Sep 16 19:08:54 2014 (r271685) @@ -352,6 +352,8 @@ struct virtio_consts { /* called to read config regs */ int (*vc_cfgwrite)(void *, int, int, uint32_t); /* called to write config regs */ + void (*vc_apply_features)(void *, uint64_t); + /* called to apply negotiated features */ uint64_t vc_hv_caps; /* hypervisor-provided capabilities */ }; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46E5CFBA; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 31B3DE86; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK7uu036457; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK7vh036456; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK7vh036456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20:07 +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: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:20:07 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/10/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000715 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000716 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA4DEFBC; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D58A4E88; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK71U036469; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK7aS036468; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK7aS036468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:20:08 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/8/sys/sys/param.h Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/9/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903503 /* Master, propagated to newvers */ +#define __FreeBSD_version 903504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D2CBFB9; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EC0EDE85; Tue, 16 Sep 2014 19:20:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK6PN036451; Tue, 16 Sep 2014 19:20:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK6Nw036450; Tue, 16 Sep 2014 19:20:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK6Nw036450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:20:07 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/8/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804504 /* Master, propagated to newvers */ +#define __FreeBSD_version 804505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:25:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B4362F; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2F93BF63; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJPS3L040581; Tue, 16 Sep 2014 19:25:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJPSl4040580; Tue, 16 Sep 2014 19:25:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161925.s8GJPSl4040580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271687 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:25:28 -0000 Author: gjb Date: Tue Sep 16 19:25:27 2014 New Revision: 271687 URL: http://svnweb.freebsd.org/changeset/base/271687 Log: Document SA-14:19 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:20:06 2014 (r271686) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:25:27 2014 (r271687) @@ -105,6 +105,13 @@ 9 September 2014 Multiple vulnerabilities + + + SA-14:19.tcp + 16 September 2014 + Denial of Service in TCP packet + processing. + From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 19:25:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A2462E; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1429DF62; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJPRW3040575; Tue, 16 Sep 2014 19:25:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJPRT6040574; Tue, 16 Sep 2014 19:25:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161925.s8GJPRT6040574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:25: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: r271687 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 19:25:28 -0000 Author: gjb Date: Tue Sep 16 19:25:27 2014 New Revision: 271687 URL: http://svnweb.freebsd.org/changeset/base/271687 Log: Document SA-14:19 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:20:06 2014 (r271686) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:25:27 2014 (r271687) @@ -227,6 +227,13 @@ 9 September 2014 Multiple vulnerabilities + + + SA-14:19.tcp + 16 September 2014 + Denial of Service in TCP packet + processing. + From owner-svn-src-stable@FreeBSD.ORG Tue Sep 16 21:26:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56B56348; Tue, 16 Sep 2014 21:26:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 41C5FE44; Tue, 16 Sep 2014 21:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GLQPm3097600; Tue, 16 Sep 2014 21:26:25 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GLQP1C097599; Tue, 16 Sep 2014 21:26:25 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409162126.s8GLQP1C097599@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 21:26:25 +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: r271690 - stable/10/sys/netinet/cc 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 21:26:25 -0000 Author: lstewart Date: Tue Sep 16 21:26:24 2014 New Revision: 271690 URL: http://svnweb.freebsd.org/changeset/base/271690 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Approved by: re(gjb) Modified: stable/10/sys/netinet/cc/cc_cdg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/10/sys/netinet/cc/cc_cdg.c Tue Sep 16 20:48:13 2014 (r271689) +++ stable/10/sys/netinet/cc/cc_cdg.c Tue Sep 16 21:26:24 2014 (r271690) @@ -221,6 +221,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -234,7 +235,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -278,6 +280,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 07:06:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8957C6C; Wed, 17 Sep 2014 07:06:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 77359E5; Wed, 17 Sep 2014 07:06:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H763JL067887; Wed, 17 Sep 2014 07:06:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H763sG067886; Wed, 17 Sep 2014 07:06:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170706.s8H763sG067886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 07:06: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: r271701 - stable/10/usr.sbin/ctld 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 07:06:03 -0000 Author: trasz Date: Wed Sep 17 07:06:02 2014 New Revision: 271701 URL: http://svnweb.freebsd.org/changeset/base/271701 Log: MFC r271319: Fix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias when the initiator skips security negotiation. This fixes interoperability with Xtend SAN initiator. PR: 193021 Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Wed Sep 17 06:46:37 2014 (r271700) +++ stable/10/usr.sbin/ctld/login.c Wed Sep 17 07:06:02 2014 (r271701) @@ -785,7 +785,8 @@ login_negotiate(struct connection *conn, struct pdu *response; struct iscsi_bhs_login_response *bhslr2; struct keys *request_keys, *response_keys; - int i; + char *portal_group_tag; + int i, rv; bool skipped_security; if (request == NULL) { @@ -806,6 +807,21 @@ login_negotiate(struct connection *conn, login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE); response_keys = keys_new(); + + if (skipped_security && + conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { + if (conn->conn_target->t_alias != NULL) + keys_add(response_keys, + "TargetAlias", conn->conn_target->t_alias); + rv = asprintf(&portal_group_tag, "%d", + conn->conn_portal->p_portal_group->pg_tag); + if (rv <= 0) + log_err(1, "asprintf"); + keys_add(response_keys, + "TargetPortalGroupTag", portal_group_tag); + free(portal_group_tag); + } + for (i = 0; i < KEYS_MAX; i++) { if (request_keys->keys_names[i] == NULL) break; @@ -1069,6 +1085,9 @@ login(struct connection *conn) response_keys = keys_new(); keys_add(response_keys, "AuthMethod", "CHAP"); if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { + if (conn->conn_target->t_alias != NULL) + keys_add(response_keys, + "TargetAlias", conn->conn_target->t_alias); rv = asprintf(&portal_group_tag, "%d", conn->conn_portal->p_portal_group->pg_tag); if (rv <= 0) @@ -1076,9 +1095,6 @@ login(struct connection *conn) keys_add(response_keys, "TargetPortalGroupTag", portal_group_tag); free(portal_group_tag); - if (conn->conn_target->t_alias != NULL) - keys_add(response_keys, - "TargetAlias", conn->conn_target->t_alias); } keys_save(response_keys, response); From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 08:25:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F3761F9; Wed, 17 Sep 2014 08:25:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 59AD6B69; Wed, 17 Sep 2014 08:25:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H8PnXg006014; Wed, 17 Sep 2014 08:25:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H8PnEx006013; Wed, 17 Sep 2014 08:25:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170825.s8H8PnEx006013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 08:25: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: r271704 - stable/10/usr.sbin/autofs 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 08:25:49 -0000 Author: trasz Date: Wed Sep 17 08:25:48 2014 New Revision: 271704 URL: http://svnweb.freebsd.org/changeset/base/271704 Log: MFC r271167: Make it possible to quote names in autofs maps using double quotes. Note that this is a workaround, not a proper solution. If you know lex well, and want to help - please let me know, I'll explain how it should work. PR: 192968 Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/token.l ============================================================================== --- stable/10/usr.sbin/autofs/token.l Wed Sep 17 07:55:23 2014 (r271703) +++ stable/10/usr.sbin/autofs/token.l Wed Sep 17 08:25:48 2014 (r271704) @@ -48,6 +48,7 @@ extern int yylex(void); %option noyywrap %% +\"[^"]+\" { yytext++; yytext[strlen(yytext) - 1] = '\0'; return STR; }; [a-zA-Z0-9\.\+-_/\:\[\]$&{}]+ { return STR; } #.*\n { lineno++; return NEWLINE; }; \\\n { lineno++; }; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 08:47:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42B2C9B5; Wed, 17 Sep 2014 08:47:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 14785DA8; Wed, 17 Sep 2014 08:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H8lwJL015782; Wed, 17 Sep 2014 08:47:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H8lwR7015781; Wed, 17 Sep 2014 08:47:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170847.s8H8lwR7015781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 08:47: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: r271706 - stable/10/usr.sbin/iscsid 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 08:47:59 -0000 Author: trasz Date: Wed Sep 17 08:47:58 2014 New Revision: 271706 URL: http://svnweb.freebsd.org/changeset/base/271706 Log: MFC r271437: Don't blindly assume the target agreed to transition to Full Feature Phase; if we got a Login Response PDU without the "T" bit set, try again with an empty request. This fixes interoperability with COMSTAR. Reviewed by: mav Tested by: mav Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Wed Sep 17 08:28:50 2014 (r271705) +++ stable/10/usr.sbin/iscsid/login.c Wed Sep 17 08:47:58 2014 (r271706) @@ -574,7 +574,7 @@ login_negotiate(struct connection *conn) struct pdu *request, *response; struct keys *request_keys, *response_keys; struct iscsi_bhs_login_response *bhslr; - int i; + int i, nrequests = 0; log_debugx("beginning operational parameter negotiation"); request = login_new_request(conn, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); @@ -628,19 +628,41 @@ login_negotiate(struct connection *conn) response_keys->keys_names[i], response_keys->keys_values[i]); } - bhslr = (struct iscsi_bhs_login_response *)response->pdu_bhs; - if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) - log_warnx("received final login response " - "without the \"T\" flag"); - else if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE) + keys_delete(response_keys); + response_keys = NULL; + + for (;;) { + bhslr = (struct iscsi_bhs_login_response *)response->pdu_bhs; + if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) != 0) + break; + + nrequests++; + if (nrequests > 5) { + log_warnx("received login response " + "without the \"T\" flag too many times; giving up"); + break; + } + + log_debugx("received login response " + "without the \"T\" flag; sending another request"); + + pdu_delete(response); + + request = login_new_request(conn, + BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + pdu_send(request); + pdu_delete(request); + + response = login_receive(conn); + } + + if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE) log_warnx("received final login response with wrong NSG 0x%x", login_nsg(response)); + pdu_delete(response); log_debugx("operational parameter negotiation done; " "transitioning to Full Feature phase"); - - keys_delete(response_keys); - pdu_delete(response); } static void From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 14:06:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC2D2314; Wed, 17 Sep 2014 14:06:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A6D4C1AC; Wed, 17 Sep 2014 14:06:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HE6LTH071462; Wed, 17 Sep 2014 14:06:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HE6LNu071461; Wed, 17 Sep 2014 14:06:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171406.s8HE6LNu071461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271707 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 14:06:21 -0000 Author: mav Date: Wed Sep 17 14:06:21 2014 New Revision: 271707 URL: http://svnweb.freebsd.org/changeset/base/271707 Log: MFC r271604, r271616: Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses. This change fixes transient performance drops in some of my benchmarks, vanishing as soon as I am trying to collect any stats from the scheduler. It looks like reordered access to those variables sometimes caused loss of IPI_PREEMPT, that delayed thread execution until some later interrupt. Approved by: re (marius) Modified: stable/10/sys/kern/sched_ule.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Wed Sep 17 08:47:58 2014 (r271706) +++ stable/10/sys/kern/sched_ule.c Wed Sep 17 14:06:21 2014 (r271707) @@ -1037,6 +1037,14 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + + /* + * Make sure that tdq_load updated before calling this function + * is globally visible before we read tdq_cpu_idle. Idle thread + * accesses both of them without locks, and the order is important. + */ + mb(); + if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2645,6 +2653,12 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + /* + * Make sure that tdq_cpu_idle update is globally visible + * before cpu_idle() read tdq_load. The order is important + * to avoid race with tdq_notify. + */ + mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 14:07:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53535454; Wed, 17 Sep 2014 14:07:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3E3691C5; Wed, 17 Sep 2014 14:07:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HE7fAI071683; Wed, 17 Sep 2014 14:07:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HE7f1N071682; Wed, 17 Sep 2014 14:07:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171407.s8HE7f1N071682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271708 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 14:07:41 -0000 Author: mav Date: Wed Sep 17 14:07:40 2014 New Revision: 271708 URL: http://svnweb.freebsd.org/changeset/base/271708 Log: MFC r271604, r271616: Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses. This change fixes transient performance drops in some of my benchmarks, vanishing as soon as I am trying to collect any stats from the scheduler. It looks like reordered access to those variables sometimes caused loss of IPI_PREEMPT, that delayed thread execution until some later interrupt. Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Wed Sep 17 14:06:21 2014 (r271707) +++ stable/9/sys/kern/sched_ule.c Wed Sep 17 14:07:40 2014 (r271708) @@ -1006,6 +1006,14 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + + /* + * Make sure that tdq_load updated before calling this function + * is globally visible before we read tdq_cpu_idle. Idle thread + * accesses both of them without locks, and the order is important. + */ + mb(); + if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2607,6 +2615,12 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + /* + * Make sure that tdq_cpu_idle update is globally visible + * before cpu_idle() read tdq_load. The order is important + * to avoid race with tdq_notify. + */ + mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 14:17:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7731BA43; Wed, 17 Sep 2014 14:17:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5FA8A323; Wed, 17 Sep 2014 14:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HEHesr076804; Wed, 17 Sep 2014 14:17:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HEHe7B076803; Wed, 17 Sep 2014 14:17:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171417.s8HEHe7B076803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:17: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: r271709 - stable/10/sys/dev/ahci 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 14:17:40 -0000 Author: mav Date: Wed Sep 17 14:17:39 2014 New Revision: 271709 URL: http://svnweb.freebsd.org/changeset/base/271709 Log: MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA. This device reports RAID subclass, but appears to be AHCI compatible. Submitted by: Yuri Perejilin Approved by: re (gjb) Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed Sep 17 14:07:40 2014 (r271708) +++ stable/10/sys/dev/ahci/ahci.c Wed Sep 17 14:17:39 2014 (r271709) @@ -351,6 +351,7 @@ static struct { {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x3781105a, 0x00, "Promise TX8660", 0}, {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x11841039, 0x00, "SiS 966", 0}, From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 14:20:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9AFFBAF; Wed, 17 Sep 2014 14:20:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8A84D33D; Wed, 17 Sep 2014 14:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HEK4FN077242; Wed, 17 Sep 2014 14:20:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HEK4pr077241; Wed, 17 Sep 2014 14:20:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171420.s8HEK4pr077241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271710 - in stable/9/sys/dev: ahci usb/wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 14:20:04 -0000 Author: mav Date: Wed Sep 17 14:20:04 2014 New Revision: 271710 URL: http://svnweb.freebsd.org/changeset/base/271710 Log: MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA. This device reports RAID subclass, but appears to be AHCI compatible. Submitted by: Yuri Perejilin Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/forth/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/i386/gptboot/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/dev/run/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/usb/wlan/if_run.c (props changed) stable/9/sys/dev/usb/wlan/if_runreg.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) stable/9/sys/modules/svr4/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/netpfil/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Wed Sep 17 14:17:39 2014 (r271709) +++ stable/9/sys/dev/ahci/ahci.c Wed Sep 17 14:20:04 2014 (r271710) @@ -355,6 +355,7 @@ static struct { {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x3781105a, 0x00, "Promise TX8660", 0}, {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x11841039, 0x00, "SiS 966", 0}, From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 16:16:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5074A2D5 for ; Wed, 17 Sep 2014 16:16:43 +0000 (UTC) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C859F28A for ; Wed, 17 Sep 2014 16:16:42 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id n15so2140104lbi.20 for ; Wed, 17 Sep 2014 09:16:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=S3jgoj1n6OHmc1kiJi9FmvlC2MJaKSZmz48q9lQZ5N4=; b=e2FLkCAbmey5ALxsflt0uea65K/GAtfdC6Tx45cBWGVfOPf1de+Nr+E7ttVReLyiCJ +7EQJjH4maF/IYX8rQ1hgdNFjGp65GnsiKQfXBMpiEMfJUbaXky89mNLz36TcM3/oFW4 aB+7G38y+MzYaqt250Zt4KgtflbkKUn+kgjbqcpGkDweZ3K38AEzJ3HA5y4AFzEL+QMe nQQfSE/GedQI90yodb+p4XNmJEwpqcOgWNKWUdZfUHD01dN5G4VM2VJ+E6hUw+/ZPmJr R892gYToLAC6sqwVKAx+uX90bKln0G0jvyDuM50kvDiya1xIll4cEv5xVxCah89qaxcM i8rQ== X-Gm-Message-State: ALoCoQmhhTGabFKa7j40wAQ6lZyn2sScDR5G3Xq7HFMT9ggn7m+fZAPS0/U4g1W//NJTLv4ihQEY X-Received: by 10.152.4.194 with SMTP id m2mr32031214lam.63.1410970594908; Wed, 17 Sep 2014 09:16:34 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id t1sm6067118laz.28.2014.09.17.09.16.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 09:16:34 -0700 (PDT) Message-ID: <5419B3E1.1090703@freebsd.org> Date: Wed, 17 Sep 2014 20:16:33 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> In-Reply-To: <201409171406.s8HE6LNu071461@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 16:16:43 -0000 On 17.09.2014 18:06, Alexander Motin wrote: > + /* > + * Make sure that tdq_load updated before calling this function > + * is globally visible before we read tdq_cpu_idle. Idle thread > + * accesses both of them without locks, and the order is important. > + */ > + mb(); > + > if (TD_IS_IDLETHREAD(ctd)) { I don't understand this comment's first phrase with two verbs. Copy & paste result? I also don't see tdq_load access in this function. -- http://ache.vniz.net/ From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 16:46:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BEAE9D; Wed, 17 Sep 2014 16:46:24 +0000 (UTC) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8098A813; Wed, 17 Sep 2014 16:46:23 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ty20so2282248lab.35 for ; Wed, 17 Sep 2014 09:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5XSDHv3lQGfj7sLr0fvxRNxmhKW5UmZjnCMQKWswf7Q=; b=lvtfH2wvgfp2vXY+W/7nDi6CmpXdkf+Y0nHaN6HYT3Fvfd2+YDFXDz2VeAXeIC3ort RegSZFwczDCxBqfHsngufZH2SsvRXq1yVq3XWBTKHkWaAmNAKQ9wnU4hu0S7L5R/4TvM vQWlyoossiVhtbKPStZxBnF9JxBlJhXzpghvzX53yhxEvv8iJscwOH6wrfbDVVKO7sO2 HWjb44wbDME91hkcAZaDcsWe6Rak2Q/0+gKy97G+xdk9mIgzVrP9oNhT2D24kqxsi8w7 GhqRhVJR4THWWDXvAyI9ScarGDjze4M46PyYo79ofIm3kgjLI4XRw7cuDHSlgwjTmvgL aRTw== X-Received: by 10.152.1.137 with SMTP id 9mr20617479lam.85.1410972381397; Wed, 17 Sep 2014 09:46:21 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id ki7sm1828744lac.38.2014.09.17.09.46.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 09:46:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <5419BAD7.4000600@FreeBSD.org> Date: Wed, 17 Sep 2014 19:46:15 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> In-Reply-To: <5419B3E1.1090703@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 16:46:24 -0000 On 17.09.2014 19:16, Andrey Chernov wrote: > On 17.09.2014 18:06, Alexander Motin wrote: >> + /* >> + * Make sure that tdq_load updated before calling this function >> + * is globally visible before we read tdq_cpu_idle. Idle thread >> + * accesses both of them without locks, and the order is important. >> + */ >> + mb(); >> + >> if (TD_IS_IDLETHREAD(ctd)) { > > I don't understand this comment's first phrase with two verbs. Copy & > paste result? No, only possibly missing commas around "updated before calling this function". > I also don't see tdq_load access in this function. It is incremented by tdq_load_add(), called by tdq_add(), called by sched_add(), just before calling tdq_notify(). -- Alexander Motin From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 17:08:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26F7BB5E; Wed, 17 Sep 2014 17:08:12 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4BD9A58; Wed, 17 Sep 2014 17:08:11 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s8HH2gbr008670; Wed, 17 Sep 2014 12:08:10 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1peewq11dr-1; Wed, 17 Sep 2014 12:08:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 134CE403F5; Wed, 17 Sep 2014 12:08:10 -0500 (CDT) Message-ID: <5419BFF9.9080907@rice.edu> Date: Wed, 17 Sep 2014 12:08:09 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Alexander Motin , Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> In-Reply-To: <5419BAD7.4000600@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409170139 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 17:08:12 -0000 On 09/17/2014 11:46, Alexander Motin wrote: > On 17.09.2014 19:16, Andrey Chernov wrote: >> On 17.09.2014 18:06, Alexander Motin wrote: >>> + /* >>> + * Make sure that tdq_load updated before calling this function >>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>> + * accesses both of them without locks, and the order is important. >>> + */ >>> + mb(); >>> + >>> if (TD_IS_IDLETHREAD(ctd)) { >> I don't understand this comment's first phrase with two verbs. Copy & >> paste result? > No, only possibly missing commas around "updated before calling this > function". Commas alone don't fix the problem. I think what you're trying to say is: "Make sure that our caller's earlier update to tdq_load is globally visible before we read tdq_cpu_idle." >> I also don't see tdq_load access in this function. > It is incremented by tdq_load_add(), called by tdq_add(), called by > sched_add(), just before calling tdq_notify(). > From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 17:36:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AD37678; Wed, 17 Sep 2014 17:36:06 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05645D56; Wed, 17 Sep 2014 17:36:04 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ty20so2322636lab.23 for ; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9ACu5/zmUrhBxqMhiH5Tq6YY6IiFjkNJPgJbQP11U2U=; b=P67UntCIDeoiTY4fpL7iDP1koEPCwkB77A9BtYo7lPznXcCiQIzp6WlyhxRYv1Q98Y QGNgyehfcNSIiO/yUh+D/vvOa5SQLqUt7oWwfxajIWk6GjLt+jLheobmKyTWMuu1wplz N0ngCiL2Ck/Sfaz6HFPutEtrWjQ8hWE4iTbb9D9dH9WiAV2Tpro+tds8pxzSg4Z8wbOG lOAQKXg8kK/zPj5yjfp+lRaxmDll+ltwz6ZFI7QNZSaIxZbQdKvhpsfVc9QYyHFOMHKQ kC6U7jkksrmGntmEBeoe7bKMciN8G0S3d6sicPxlh0+EvJvy8Q4vVD7/WpyyKj5+8O6F EiIw== X-Received: by 10.112.199.197 with SMTP id jm5mr42824512lbc.19.1410975362729; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id vr9sm6366777lbb.36.2014.09.17.10.36.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 10:36:01 -0700 (PDT) Sender: Alexander Motin Message-ID: <5419C67F.90808@FreeBSD.org> Date: Wed, 17 Sep 2014 20:35:59 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alan Cox , Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> <5419BFF9.9080907@rice.edu> In-Reply-To: <5419BFF9.9080907@rice.edu> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 17:36:06 -0000 On 17.09.2014 20:08, Alan Cox wrote: > On 09/17/2014 11:46, Alexander Motin wrote: >> On 17.09.2014 19:16, Andrey Chernov wrote: >>> On 17.09.2014 18:06, Alexander Motin wrote: >>>> + /* >>>> + * Make sure that tdq_load updated before calling this function >>>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>>> + * accesses both of them without locks, and the order is important. >>>> + */ >>>> + mb(); >>>> + >>>> if (TD_IS_IDLETHREAD(ctd)) { >>> I don't understand this comment's first phrase with two verbs. Copy & >>> paste result? >> No, only possibly missing commas around "updated before calling this >> function". > > > Commas alone don't fix the problem. I think what you're trying to say is: > > "Make sure that our caller's earlier update to tdq_load is globally > visible before we read tdq_cpu_idle." Yes, that was my intention. Thank you. Please excuse my non-native English and correct it as you feel better. Andrey, would that reveal your questions? >>> I also don't see tdq_load access in this function. >> It is incremented by tdq_load_add(), called by tdq_add(), called by >> sched_add(), just before calling tdq_notify(). -- Alexander Motin From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 17:38:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D10CC94F for ; Wed, 17 Sep 2014 17:38:29 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5179CDA7 for ; Wed, 17 Sep 2014 17:38:28 +0000 (UTC) Received: by mail-lb0-f173.google.com with SMTP id w7so2316485lbi.4 for ; Wed, 17 Sep 2014 10:38:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=zkua6EMUhsBgXXmFXawiGTlmuq/Vibpu5iV51L7udMs=; b=egNRO2YoIGii0p47RRg0fWcrZHUIcXEZ7uxFFIQrabkdIKqtudPsF9J5SJ9kSnEiC6 3Wdp7+gHTGu4WhuJNwz0/x+Dqvaj/zw0fS7t2z1R3ApQOJLagCE33i/NqKB6Nn+iU4iY hwbT0ENuaq//rFdgVgi9VR4ScXtgMy0XQ+0STiJvFe7C/NruniPOH0UWPVVWpizSOVGQ RnqM7bRXY/MdzYkG+y50LxzkELuHM6x88YmyDpCPxDVcRr7cmrRLcQn2alfnCl9mXIPD 8Vhx7tFBn1ZZxOPJmMQ5zR9pVxld5fD8ahZx5X2JDIAb7wyB519luZ10PYZby+maGnVh PeTg== X-Gm-Message-State: ALoCoQn7ivX9xopB3vccsmLb6ltC3LoBsVjXq1XwbJsMLWSxaYxqr7fF4Usxv4sAtJtMEgLWXBfB X-Received: by 10.112.13.132 with SMTP id h4mr15849484lbc.45.1410975500870; Wed, 17 Sep 2014 10:38:20 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id bm4sm5867216lbc.22.2014.09.17.10.38.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 10:38:20 -0700 (PDT) Message-ID: <5419C70B.4010209@freebsd.org> Date: Wed, 17 Sep 2014 21:38:19 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Alexander Motin , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> <5419BFF9.9080907@rice.edu> <5419C67F.90808@FreeBSD.org> In-Reply-To: <5419C67F.90808@FreeBSD.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 17:38:29 -0000 On 17.09.2014 21:35, Alexander Motin wrote: > On 17.09.2014 20:08, Alan Cox wrote: >> On 09/17/2014 11:46, Alexander Motin wrote: >>> On 17.09.2014 19:16, Andrey Chernov wrote: >>>> On 17.09.2014 18:06, Alexander Motin wrote: >>>>> + /* >>>>> + * Make sure that tdq_load updated before calling this function >>>>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>>>> + * accesses both of them without locks, and the order is important. >>>>> + */ >>>>> + mb(); >>>>> + >>>>> if (TD_IS_IDLETHREAD(ctd)) { >>>> I don't understand this comment's first phrase with two verbs. Copy & >>>> paste result? >>> No, only possibly missing commas around "updated before calling this >>> function". >> >> >> Commas alone don't fix the problem. I think what you're trying to say is: >> >> "Make sure that our caller's earlier update to tdq_load is globally >> visible before we read tdq_cpu_idle." > > Yes, that was my intention. Thank you. Please excuse my non-native > English and correct it as you feel better. > > Andrey, would that reveal your questions? Sound nice for me, commit, please. > >>>> I also don't see tdq_load access in this function. >>> It is incremented by tdq_load_add(), called by tdq_add(), called by >>> sched_add(), just before calling tdq_notify(). > -- http://ache.vniz.net/ From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 18:17:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C9117FD; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 5D3E22CE; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIHJfG091640; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HIHJWF091639; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171817.s8HIHJWF091639@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 18:17: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: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 18:17:19 -0000 Author: jhb Date: Wed Sep 17 18:17:18 2014 New Revision: 271714 URL: http://svnweb.freebsd.org/changeset/base/271714 Log: MFC 270830: When anouncing link state changes on an 802.11 interface with a vap, announce the change on the vap's ifnet instead of the main ifnet. This matches the behavior of other wireless drivers in the tree and allows the default devd configuration to correctly start dhclient automatically after an ndis wireless device associates. Approved by: re (marius for 10) Modified: stable/10/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 17:43:32 2014 (r271713) +++ stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 18:17:18 2014 (r271714) @@ -1709,23 +1709,26 @@ ndis_ticktask(d, xsc) if (sc->ndis_link == 0 && sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) { sc->ndis_link = 1; - NDIS_UNLOCK(sc); if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ndis_getstate_80211(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, -1); - } - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_UP); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_UP); + } else + if_link_state_change(sc->ifp, LINK_STATE_UP); } if (sc->ndis_link == 1 && sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; - NDIS_UNLOCK(sc); - if ((sc->ndis_80211 != 0) && (vap != NULL)) + if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_DOWN); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN); + } else + if_link_state_change(sc->ifp, LINK_STATE_DOWN); } NDIS_UNLOCK(sc); From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 18:17:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB7467FE; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AC9092D1; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIHJtW091646; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HIHJR6091645; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171817.s8HIHJR6091645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 18:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 18:17:20 -0000 Author: jhb Date: Wed Sep 17 18:17:18 2014 New Revision: 271714 URL: http://svnweb.freebsd.org/changeset/base/271714 Log: MFC 270830: When anouncing link state changes on an 802.11 interface with a vap, announce the change on the vap's ifnet instead of the main ifnet. This matches the behavior of other wireless drivers in the tree and allows the default devd configuration to correctly start dhclient automatically after an ndis wireless device associates. Approved by: re (marius for 10) Modified: stable/9/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/9/sys/dev/if_ndis/if_ndis.c Wed Sep 17 17:43:32 2014 (r271713) +++ stable/9/sys/dev/if_ndis/if_ndis.c Wed Sep 17 18:17:18 2014 (r271714) @@ -1710,23 +1710,26 @@ ndis_ticktask(d, xsc) if (sc->ndis_link == 0 && sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) { sc->ndis_link = 1; - NDIS_UNLOCK(sc); if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ndis_getstate_80211(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, -1); - } - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_UP); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_UP); + } else + if_link_state_change(sc->ifp, LINK_STATE_UP); } if (sc->ndis_link == 1 && sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; - NDIS_UNLOCK(sc); - if ((sc->ndis_80211 != 0) && (vap != NULL)) + if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_DOWN); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN); + } else + if_link_state_change(sc->ifp, LINK_STATE_DOWN); } NDIS_UNLOCK(sc); From owner-svn-src-stable@FreeBSD.ORG Wed Sep 17 22:11:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8473A79D; Wed, 17 Sep 2014 22:11:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6F34E1000; Wed, 17 Sep 2014 22:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HMBLnT008318; Wed, 17 Sep 2014 22:11:21 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HMBKVW008309; Wed, 17 Sep 2014 22:11:20 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409172211.s8HMBKVW008309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Sep 2014 22:11: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: r271725 - stable/10/sys/dev/bxe 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 22:11:21 -0000 Author: davidcs Date: Wed Sep 17 22:11:20 2014 New Revision: 271725 URL: http://svnweb.freebsd.org/changeset/base/271725 Log: MFC r268854 Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. Approved by: re(gjb) Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_stats.c stable/10/sys/dev/bxe/ecore_reg.h stable/10/sys/dev/bxe/ecore_sp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe.c Wed Sep 17 22:11:20 2014 (r271725) @@ -11478,6 +11478,10 @@ bxe_process_kill(struct bxe_softc *sc, bxe_process_kill_chip_reset(sc, global); mb(); + /* clear errors in PGB */ + if (!CHIP_IS_E1(sc)) + REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); + /* Recover after reset: */ /* MCP */ if (global && bxe_reset_mcp_comp(sc, val)) { Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe.h Wed Sep 17 22:11:20 2014 (r271725) @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx } \ } while(0) +#ifdef ECORE_STOP_ON_ERROR + #define bxe_panic(sc, msg) \ do { \ panic msg; \ } while (0) +#else + +#define bxe_panic(sc, msg) \ + device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#endif + #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe_stats.c Wed Sep 17 22:11:20 2014 (r271725) @@ -1306,7 +1306,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { - bxe_panic(sc, ("storm stats not updated for 3 times\n")); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + } } return; } Modified: stable/10/sys/dev/bxe/ecore_reg.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_reg.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/ecore_reg.h Wed Sep 17 22:11:20 2014 (r271725) @@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$"); 0x942cUL #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ 0x9430UL +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ + 0x943CUL #define PGLUE_B_REG_PGLUE_B_INT_STS \ 0x9298UL #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ Modified: stable/10/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:11:20 2014 (r271725) @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #define ecore_sp_post(_sc, _a, _b, _c, _d) \ bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) +#ifdef ECORE_STOP_ON_ERROR + #define ECORE_DBG_BREAK_IF(exp) \ do { \ if (__predict_false(exp)) { \ @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m } \ } while (0) +#else + +#define ECORE_DBG_BREAK_IF(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG_ON(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + + +#endif /* #ifdef ECORE_STOP_ON_ERROR */ + #define ECORE_ERR(str, ...) \ BLOGE(sc, "ECORE: " str, ##__VA_ARGS__) From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 01:24:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D238B763; Thu, 18 Sep 2014 01:24:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BC543371; Thu, 18 Sep 2014 01:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I1Of6V098015; Thu, 18 Sep 2014 01:24:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I1OfP3098013; Thu, 18 Sep 2014 01:24:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409180124.s8I1OfP3098013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Sep 2014 01:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271729 - in stable/10/contrib/llvm: patches tools/clang/lib/CodeGen 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 01:24:42 -0000 Author: emaste Date: Thu Sep 18 01:24:40 2014 New Revision: 271729 URL: http://svnweb.freebsd.org/changeset/base/271729 Log: MFC Clang debuginfo crash fix r271432: Merge upstream Clang rev 205331 debuginfo crash fix: Debug info: fix a crash when emitting IndirectFieldDecls, which were previously not handled at all. rdar://problem/16348575 r271433: Add clang patch corresponding to r271432 Approved by: re Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff - copied unchanged from r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff (from r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Thu Sep 18 01:24:40 2014 (r271729, copy of r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff) @@ -0,0 +1,46 @@ +commit 96365aef99ec463375dfdaf6eb260823e0477b6a +Author: Adrian Prantl +Date: Tue Apr 1 17:52:06 2014 +0000 + + Debug info: fix a crash when emitting IndirectFieldDecls, which were + previously not handled at all. + rdar://problem/16348575 + + git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205331 91177308-0d34-0410-b5e6-96231b3b80d8 + +diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp +index 82db942..2556cf9 100644 +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp ++++ tools/clangb/lib/CodeGen/CGDebugInfo.cpp +@@ -1252,7 +1252,7 @@ CollectTemplateParams(const TemplateParameterList *TPList, + V = CGM.GetAddrOfFunction(FD); + // Member data pointers have special handling too to compute the fixed + // offset within the object. +- if (isa(D)) { ++ if (isa(D) || isa(D)) { + // These five lines (& possibly the above member function pointer + // handling) might be able to be refactored to use similar code in + // CodeGenModule::getMemberPointerConstant +diff --git a/test/CodeGenCXX/debug-info-indirect-field-decl.cpp b/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +new file mode 100644 +index 0000000..131ceba +--- /dev/null ++++ tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +@@ -0,0 +1,17 @@ ++// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s ++// ++// Test that indirect field decls are handled gracefully. ++// rdar://problem/16348575 ++// ++template class Foo { }; ++ ++struct Bar { ++ int i1; ++ // CHECK: [ DW_TAG_member ] [line [[@LINE+1]], size 32, align 32, offset 32] [from _ZTSN3BarUt_E] ++ union { ++ // CHECK: [ DW_TAG_member ] [i2] [line [[@LINE+1]], size 32, align 32, offset 0] [from int] ++ int i2; ++ }; ++}; ++ ++Foo the_foo; Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed Sep 17 22:49:29 2014 (r271728) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Thu Sep 18 01:24:40 2014 (r271729) @@ -1241,7 +1241,7 @@ CollectTemplateParams(const TemplatePara V = CGM.GetAddrOfFunction(FD); // Member data pointers have special handling too to compute the fixed // offset within the object. - if (isa(D)) { + if (isa(D) || isa(D)) { // These five lines (& possibly the above member function pointer // handling) might be able to be refactored to use similar code in // CodeGenModule::getMemberPointerConstant From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 03:02:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 383DE874; Thu, 18 Sep 2014 03:02:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1A04CE29; Thu, 18 Sep 2014 03:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I322l9044613; Thu, 18 Sep 2014 03:02:02 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I3215e044600; Thu, 18 Sep 2014 03:02:01 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409180302.s8I3215e044600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 18 Sep 2014 03:02:01 +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: r271734 - in stable/10: share/man/man4 usr.bin/iscsictl usr.sbin/ctld usr.sbin/iscsid 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 03:02:02 -0000 Author: allanjude (doc committer) Date: Thu Sep 18 03:02:00 2014 New Revision: 271734 URL: http://svnweb.freebsd.org/changeset/base/271734 Log: MFC r271445,r271446,r271560: Improve markup and language throughout the ctl.conf man page MFC r271543: Add the new iscsi(4) man page Cross reference it from iscsid(8) and iscsictl(8) Approved by: re (gjb), bcr (mentor) Added: stable/10/share/man/man4/iscsi.4 - copied unchanged from r271543, head/share/man/man4/iscsi.4 Modified: stable/10/share/man/man4/Makefile stable/10/usr.bin/iscsictl/iscsictl.8 stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/iscsid/iscsid.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/share/man/man4/Makefile Thu Sep 18 03:02:00 2014 (r271734) @@ -205,6 +205,7 @@ MAN= aac.4 \ ipw.4 \ ipwfw.4 \ isci.4 \ + iscsi.4 \ iscsi_initiator.4 \ isp.4 \ ispfw.4 \ Copied: stable/10/share/man/man4/iscsi.4 (from r271543, head/share/man/man4/iscsi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/iscsi.4 Thu Sep 18 03:02:00 2014 (r271734, copy of r271543, head/share/man/man4/iscsi.4) @@ -0,0 +1,111 @@ +.\" Copyright (c) 2014 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd September 11, 2014 +.Dt ISCSI 4 +.Os +.Sh NAME +.Nm iscsi +.Nd iSCSI initiator +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iscsi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iscsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides the kernel component of an iSCSI initiator. +The initiator is the iSCSI client, which connects to an iSCSI target, +providing local access to a remote block device. +The userland component is provided by +.Xr iscsid 8 +and both the kernel and userland are configured using +.Xr iscsictl 8 . +The +.Nm +subsystem is responsible for implementing the +.Qq Full Feature Phase +of the iSCSI protocol. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.iscsi.ping_timeout +The number of seconds to wait for the target to respond to a NOP-Out +PDU. +In the event that there is no response within that time the session gets +forcibly restarted. +.It Va kern.iscsi.iscsid_timeout +The number of seconds to wait for +.Xr ctld 8 +to establish a session. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.login_timeout +The number of seconds to wait for a login attempt to succeed. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.maxtags +The maximum number of outstanding IO requests. +.It Va kern.iscsi.fail_on_disconnection +Controls the behavior after an iSCSI connection has been dropped due to +network problems. +When set to 1, a dropped connection causes the iSCSI device nodes +to be destroyed. +After reconnecting, they will be created again. +By default, the device nodes are left intact. +While the connection is down all input/output operations are suspended, to be +retried after the connection is reestablished. +.El +.Sh SEE ALSO +.Xr iscsi.conf 5 , +.Xr iscsictl 8 , +.Xr iscsid 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +subsystem was developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2014 +.Dd September 12, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -171,6 +171,7 @@ Attach to target iqn.2012-06.com.example Disconnect all iSCSI sessions: .Dl Nm Fl Ra .Sh SEE ALSO +.Xr iscsi 4 , .Xr iscsi.conf 5 , .Xr iscsid 8 .Sh HISTORY @@ -181,6 +182,6 @@ command appeared in .Sh AUTHORS The .Nm -was developed by +utility was developed by .An Edward Tomasz Napierala Aq trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd September 11, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -46,179 +46,249 @@ The general syntax of the .Nm file is: .Bd -literal -offset indent -pidfile +.No pidfile Ar path -auth-group { - chap - ... +.No auth-group Ar name No { +.Dl chap Ar user Ar secret +.Dl ... } -portal-group { - listen
- listen-iser
- discovery-auth-group - ... +.No portal-group Ar name No { +.Dl listen Ar address +.Dl listen-iser Ar address +.Dl discovery-auth-group Ar name +.Dl ... } -target { - auth-group - portal-group - lun { - path - } - ... +.No target Ar name { +.Dl auth-group Ar name +.Dl portal-group Ar name +.Dl lun Ar number No { +.Dl path Ar path +.Dl } +.Dl ... } .Ed -.Ss global level -The following statements are available at the global level: +.Ss Global Context .Bl -tag -width indent -.It Ic auth-group Aq Ar name -Opens an auth-group section, defining an authentication group, +.It Ic auth-group Ar name +Create an +.Sy auth-group +configuration context, +defining a new auth-group, which can then be assigned to any number of targets. -.It Ic debug Aq Ar level -Specifies debug level. +.It Ic debug Ar level +The debug verbosity level. The default is 0. -.It Ic maxproc Aq Ar number -Specifies limit for concurrently running child processes handling +.It Ic maxproc Ar number +The limit for concurrently running child processes handling incoming connections. The default is 30. -Setting it to 0 disables the limit. -.It Ic pidfile Aq Ar path -Specifies path to pidfile. +A setting of 0 disables the limit. +.It Ic pidfile Ar path +The path to the pidfile. The default is .Pa /var/run/ctld.pid . -.It Ic portal-group Aq Ar name -Opens a portal-group section, defining a portal group, +.It Ic portal-group Ar name +Create a +.Sy portal-group +configuration context, which can then be assigned to any number of targets. -.It Ic target Aq Ar name -Opens a target configuration section. -.It Ic timeout Aq Ar seconds -Specifies timeout for login session, after which the connection +.It Ic target Ar name +Create a +.Sy target +configuration context, which can contain one or more +.Sy lun +contexts. +.It Ic timeout Ar seconds +The timeout for login sessions, after which the connection will be forcibly terminated. The default is 60. -Setting it to 0 disables the timeout. +A setting of 0 disables the timeout. .El -.Ss auth-group level -The following statements are available at the auth-group level: +.Ss auth-group Context .Bl -tag -width indent -.It Ic auth-type Ao Ar type Ac -Specifies authentication type. -Type can be either "none", "deny", "chap", or "chap-mutual". + +.It Ic auth-type Ar type +Sets the authentication type. +Type can be either +.Qq Ar none , +.Qq Ar deny , +.Qq Ar chap , +or +.Qq Ar chap-mutual . In most cases it is not necessary to set the type using this clause; -it is usually used to disable authentication for a given auth-group. -.It Ic chap Ao Ar user Ac Aq Ar secret -Specifies CHAP authentication credentials. -.It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret -Specifies mutual CHAP authentication credentials. -Note that for any auth-group, configuration may contain either chap, -or chap-mutual entries; it is an error to mix them. -.It Ic initiator-name Ao Ar initiator-name Ac -Specifies iSCSI initiator name. +it is usually used to disable authentication for a given +.Sy auth-group . +.It Ic chap Ar user Ar secret +A set of CHAP authentication credentials. +Note that for any +.Sy auth-group , +the configuration may only contain either +.Sy chap +or +.Sy chap-mutual +entries; it is an error to mix them. +.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret +A set of mutual CHAP authentication credentials. +Note that for any +.Sy auth-group , +the configuration may only contain either +.Sy chap +or +.Sy chap-mutual +entries; it is an error to mix them. +.It Ic initiator-name Ar initiator-name +An iSCSI initiator name. +Only initiators with a name matching one of the defined +names will be allowed to connect. If not defined, there will be no restrictions based on initiator name. -Otherwise, only initiators with names matching one of defined -ones will be allowed to connect. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address or network. +.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen +An iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by a literal slash and a prefix length. +Only initiators with an address matching one of the defined +addresses will be allowed to connect. If not defined, there will be no restrictions based on initiator address. -Otherwise, only initiators with addresses matching one of defined -ones will be allowed to connect. .El -.Ss portal-group level -The following statements are available at the portal-group level: +.Ss portal-group Context .Bl -tag -width indent -.It Ic discovery-auth-group Aq Ar name -Assigns previously defined authentication group to the portal group, +.It Ic discovery-auth-group Ar name +Assign a previously defined authentication group to the portal group, to be used for target discovery. By default, portal groups that do not specify their own auth settings, -using clauses such as "chap" or "initiator-name", are assigned -predefined auth-group "default", which denies discovery. -Another predefined auth-group, "no-authentication", may be used +using clauses such as +.Sy chap +or +.Sy initiator-name , +are assigned +predefined +.Sy auth-group +.Qq Ar default , +which denies discovery. +Another predefined +.Sy auth-group , +.Qq Ar no-authentication , +may be used to permit discovery without authentication. -.It Ic listen Aq Ar address -Specifies IPv4 or IPv6 address and port to listen on for incoming connections. -.It Ic listen-iser Aq Ar address -Specifies IPv4 or IPv6 address and port to listen on for incoming connections +.It Ic listen Ar address +An IPv4 or IPv6 address and port to listen on for incoming connections. +.It Ic listen-iser Ar address +An IPv4 or IPv6 address and port to listen on for incoming connections using iSER (iSCSI over RDMA) protocol. .El -.Ss target level: -The following statements are available at the target level: +.Ss target Context .Bl -tag -width indent -.It Ic alias Aq Ar text -Assigns human-readable description to the target. +.It Ic alias Ar text +Assign a human-readable description to the target. There is no default. -.It Ic auth-group Aq Ar name -Assigns previously defined authentication group to the target. +.It Ic auth-group Ar name +Assign a previously defined authentication group to the target. By default, targets that do not specify their own auth settings, -using clauses such as "chap" or "initiator-name", are assigned -predefined auth-group "default", which denies all access. -Another predefined auth-group, "no-authentication", may be used to permit access +using clauses such as +.Sy chap +or +.Sy initiator-name , +are assigned +predefined +.Sy auth-group +.Qq Ar default , +which denies all access. +Another predefined +.Sy auth-group , +.Qq Ar no-authentication , +may be used to permit access without authentication. -.It Ic auth-type Ao Ar type Ac -Specifies authentication type. -Type can be either "none", "deny", "chap", or "chap-mutual". +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic auth-type Ar type +Sets the authentication type. +Type can be either +.Qq Ar none , +.Qq Ar deny , +.Qq Ar chap , +or +.Qq Ar chap-mutual . In most cases it is not necessary to set the type using this clause; -it is usually used to disable authentication for a given target. -This clause is mutually exclusive with auth-group; one cannot use +it is usually used to disable authentication for a given +.Sy target . +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic chap Ao Ar user Ac Aq Ar secret -Specifies CHAP authentication credentials. -Note that targets must use either auth-group, or chap, -or chap-mutual clauses; it is a configuration error to mix them in one target. -.It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret -Specifies mutual CHAP authentication credentials. -Note that targets must use either auth-group, chap, or -chap-mutual clauses; it is a configuration error to mix them in one target. -.It Ic initiator-name Ao Ar initiator-name Ac -Specifies iSCSI initiator name. +.It Ic chap Ar user Ar secret +A set of CHAP authentication credentials. +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret +A set of mutual CHAP authentication credentials. +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic initiator-name Ar initiator-name +An iSCSI initiator name. +Only initiators with a name matching one of the defined +names will be allowed to connect. If not defined, there will be no restrictions based on initiator name. -Otherwise, only initiators with names matching one of defined -ones will be allowed to connect. -This clause is mutually exclusive with auth-group; one cannot use +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address. +.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen +An iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by a literal slash and a prefix length. +Only initiators with an address matching one of the defined +addresses will be allowed to connect. If not defined, there will be no restrictions based on initiator address. -Otherwise, only initiators with addresses matching one of defined -ones will be allowed to connect. -This clause is mutually exclusive with auth-group; one cannot use +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic portal-group Aq Ar name -Assigns previously defined portal group to the target. -Default portal group is "default", which makes the target available +.It Ic portal-group Ar name +Assign a previously defined portal group to the target. +The default portal group is +.Qq Ar default , +which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. -.It Ic lun Aq Ar number -Opens a lun configuration section, defining LUN exported by a target. +.It Ic lun Ar number +Create a +.Sy lun +configuration context, defining a LUN exported by the parent target. .El -.Ss lun level -The following statements are available at the lun level: +.Ss lun Context .Bl -tag -width indent -.It Ic backend Ao Ar block | Ar ramdisk Ac -Specifies the CTL backend to use for a given LUN. +.It Ic backend Ar block No | Ar ramdisk +The CTL backend to use for a given LUN. Valid choices are -.Dq block +.Qq Ar block and -.Dq ramdisk ; +.Qq Ar ramdisk ; block is used for LUNs backed by files or disk device nodes; ramdisk is a bitsink device, used mostly for testing. The default backend is block. -.It Ic blocksize Aq Ar size -Specifies blocksize visible to the initiator. +.It Ic blocksize Ar size +The blocksize visible to the initiator. The default blocksize is 512. -.It Ic device-id Aq Ar string -Specifies SCSI Device Identification string presented to the initiator. -.It Ic option Ao Ar name Ac Aq Ar value -Specifies CTL-specific options passed to the kernel. -.It Ic path Aq Ar path -Specifies path to file or device node used to back the LUN. -.It Ic serial Aq Ar string -Specifies SCSI serial number presented to the initiator. -.It Ic size Aq Ar size -Specifies LUN size, in bytes. +.It Ic device-id Ar string +The SCSI Device Identification string presented to the initiator. +.It Ic option Ar name Ar value +The CTL-specific options passed to the kernel. +All CTL-specific options are documented in the +.Sx OPTIONS +section of +.Xr ctladm 8 +.It Ic path Ar path +The path to the file or device node used to back the LUN. +.It Ic serial Ar string +The SCSI serial number presented to the initiator. +.It Ic size Ar size +The LUN size, in bytes. .El .Sh FILES .Bl -tag -width ".Pa /etc/ctl.conf" -compact Modified: stable/10/usr.sbin/iscsid/iscsid.8 ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.8 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.sbin/iscsid/iscsid.8 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd September 12, 2014 .Dt ISCSID 8 .Os .Sh NAME @@ -49,12 +49,13 @@ as well as performing SendTargets discov Upon startup, the .Nm daemon opens the iSCSI initiator device file and waits for kernel requests. -It doesn't use any configuration file; all the information it needs it gets -from the kernel. +.Nm +does not use any configuration files. +All needed information is supplied by the kernel. .Pp When the .Nm -damon is not running, already established iSCSI connections continue +daemon is not running, already established iSCSI connections continue to work. However, establishing new connections, or recovering existing ones in case of connection error, is not possible. @@ -99,6 +100,7 @@ The .Nm utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO +.Xr iscsi 4 , .Xr iscsictl 8 .Sh HISTORY The @@ -108,6 +110,6 @@ command appeared in .Sh AUTHORS The .Nm -was developed by +utility was developed by .An Edward Tomasz Napierala Aq trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 05:40:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 547B626F; Thu, 18 Sep 2014 05:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 25AAAD2A; Thu, 18 Sep 2014 05:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I5eYte015556; Thu, 18 Sep 2014 05:40:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I5eXYF015555; Thu, 18 Sep 2014 05:40:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180540.s8I5eXYF015555@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 05:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271737 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 05:40:34 -0000 Author: dim Date: Thu Sep 18 05:40:33 2014 New Revision: 271737 URL: http://svnweb.freebsd.org/changeset/base/271737 Log: MFC r271597: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 03:11:59 2014 (r271736) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 05:40:33 2014 (r271737) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 06:34:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A461C9B; Thu, 18 Sep 2014 06:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 EEF1B245; Thu, 18 Sep 2014 06:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6YRuv040480; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6YRvU040479; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180634.s8I6YRvU040479@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:34: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: r271739 - stable/10/contrib/llvm/lib/Target/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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 06:34:28 -0000 Author: dim Date: Thu Sep 18 06:34:27 2014 New Revision: 271739 URL: http://svnweb.freebsd.org/changeset/base/271739 Log: MFC r271597: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Approved by: re (marius) Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 05:43:19 2014 (r271738) +++ stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 06:34:27 2014 (r271739) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 06:40:54 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF17CEEE; Thu, 18 Sep 2014 06:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DA2EF34D; Thu, 18 Sep 2014 06:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6er6T043154; Thu, 18 Sep 2014 06:40:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6eriY043153; Thu, 18 Sep 2014 06:40:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180640.s8I6eriY043153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271740 - stable/8/share/mk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 06:40:54 -0000 Author: dim Date: Thu Sep 18 06:40:53 2014 New Revision: 271740 URL: http://svnweb.freebsd.org/changeset/base/271740 Log: MFC r257658 (modified to apply to stable/8): For C++ programs, don't emit any explicit dependency to libstdc++.a or libc++.a during the early build stages (bootstrap-tools, build-tools, cross-tools), since it is not possible to know in advance which C++ library is available on the host system. Instead, just use the bootstrap compiler's built-in default. This should eventually make it possible to build stable/9 on head, or on stable/10, which ship without libstdc++ by default. [Note: this should get the stable/8 tinderbox at least a bit further in buildworld.] Modified: stable/8/share/mk/bsd.prog.mk Modified: stable/8/share/mk/bsd.prog.mk ============================================================================== --- stable/8/share/mk/bsd.prog.mk Thu Sep 18 06:34:27 2014 (r271739) +++ stable/8/share/mk/bsd.prog.mk Thu Sep 18 06:40:53 2014 (r271740) @@ -134,7 +134,7 @@ _EXTRADEPEND: .endif .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} -.if defined(PROG_CXX) +.if defined(PROG_CXX) && !defined(BOOTSTRAPPING) echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 06:45:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15F301A5; Thu, 18 Sep 2014 06:45:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DB5CC389; Thu, 18 Sep 2014 06:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6jhNX045272; Thu, 18 Sep 2014 06:45:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6jhdh045271; Thu, 18 Sep 2014 06:45:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180645.s8I6jhdh045271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271741 - stable/8/share/mk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 06:45:44 -0000 Author: dim Date: Thu Sep 18 06:45:43 2014 New Revision: 271741 URL: http://svnweb.freebsd.org/changeset/base/271741 Log: Fixup mergeinfo after r271740. Modified: Directory Properties: stable/8/share/mk/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 06:47:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA4E3325; Thu, 18 Sep 2014 06:47:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A54F73A0; Thu, 18 Sep 2014 06:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6lm6r045553; Thu, 18 Sep 2014 06:47:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6lmDx045552; Thu, 18 Sep 2014 06:47:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180647.s8I6lmDx045552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r271742 - stable/7/share/mk X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 06:47:48 -0000 Author: dim Date: Thu Sep 18 06:47:48 2014 New Revision: 271742 URL: http://svnweb.freebsd.org/changeset/base/271742 Log: MFC r257658 (modified to apply to stable/7): For C++ programs, don't emit any explicit dependency to libstdc++.a or libc++.a during the early build stages (bootstrap-tools, build-tools, cross-tools), since it is not possible to know in advance which C++ library is available on the host system. Instead, just use the bootstrap compiler's built-in default. This should eventually make it possible to build stable/9 on head, or on stable/10, which ship without libstdc++ by default. [Note: this should get the stable/7 tinderbox at least a bit further in buildworld.] Modified: stable/7/share/mk/bsd.prog.mk Directory Properties: stable/7/share/mk/ (props changed) Modified: stable/7/share/mk/bsd.prog.mk ============================================================================== --- stable/7/share/mk/bsd.prog.mk Thu Sep 18 06:45:43 2014 (r271741) +++ stable/7/share/mk/bsd.prog.mk Thu Sep 18 06:47:48 2014 (r271742) @@ -126,7 +126,7 @@ _EXTRADEPEND: .endif .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} -.if defined(PROG_CXX) +.if defined(PROG_CXX) && !defined(BOOTSTRAPPING) echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 08:58:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D515D9B1; Thu, 18 Sep 2014 08:58:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BE49324B; Thu, 18 Sep 2014 08:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I8wOAl007001; Thu, 18 Sep 2014 08:58:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I8wNGo006992; Thu, 18 Sep 2014 08:58:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409180858.s8I8wNGo006992@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Sep 2014 08:58:23 +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: r271746 - in stable/10/sys: arm/conf netinet netinet6 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 08:58:25 -0000 Author: tuexen Date: Thu Sep 18 08:58:22 2014 New Revision: 271746 URL: http://svnweb.freebsd.org/changeset/base/271746 Log: MFC r270673: Announce SCTP support in the kern.features sysctl variables. MFC r270859: Enable SCTP support. It runs perfectly fine on a Wandboard quad. MFC r271204 with manual intervention: Fix the handling of sysctl variables when used with VIMAGE. While there do some cleanup of the code. MFC r271209: Fix a leak of an address, if the address is scheduled for removal and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC r271219: Use SYSCTL_PROC instead of SYSCTL_VNET_PROC. Suggested by: glebius@ MFC r271221: Use union sctp_sockstore instead of struct sockaddr_storage. This eliminates some warnings when building in userland. Thanks to Patrick Laimbock for reporting this issue. Remove also some unnecessary casts. There should be no functional change. MFC r271228: Address another warnings reported by Patrick Laimbock when compiling in userspace. While there, improve consistency. MFC r271230: Address warnings generated by the clang analyzer. Approved by: re (kib) Modified: stable/10/sys/arm/conf/IMX6 stable/10/sys/netinet/sctp_asconf.c stable/10/sys/netinet/sctp_constants.h stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_sysctl.c stable/10/sys/netinet/sctp_sysctl.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/arm/conf/IMX6 Thu Sep 18 08:58:22 2014 (r271746) @@ -25,7 +25,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -#options SCTP # Stream Control Transmission Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_asconf.c Thu Sep 18 08:58:22 2014 (r271746) @@ -148,7 +148,7 @@ sctp_process_asconf_add_ip(struct sockad { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -177,7 +177,7 @@ sctp_process_asconf_add_ip(struct sockad #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -186,7 +186,7 @@ sctp_process_asconf_add_ip(struct sockad return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -209,7 +209,7 @@ sctp_process_asconf_add_ip(struct sockad return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -302,7 +302,7 @@ sctp_process_asconf_delete_ip(struct soc struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -331,7 +331,7 @@ sctp_process_asconf_delete_ip(struct soc #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -340,7 +340,7 @@ sctp_process_asconf_delete_ip(struct soc return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -360,7 +360,7 @@ sctp_process_asconf_delete_ip(struct soc return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -437,7 +437,7 @@ sctp_process_asconf_set_primary(struct s struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -465,7 +465,7 @@ sctp_process_asconf_set_primary(struct s #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -474,7 +474,7 @@ sctp_process_asconf_set_primary(struct s return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -492,7 +492,7 @@ sctp_process_asconf_set_primary(struct s return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -1268,7 +1268,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sa; + sin6 = &ifa->address.sin6; aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1283,7 +1283,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1925,7 +1925,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* we skip unspecifed addresses */ return; @@ -1958,7 +1958,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * SCTP_IPV6_V6ONLY(inp6)) return; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* we skip unspecifed addresses */ return; @@ -2115,7 +2115,7 @@ sctp_asconf_iterator_stcb(struct sctp_in else continue; } - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* we skip unspecifed addresses */ continue; @@ -2149,7 +2149,7 @@ sctp_asconf_iterator_stcb(struct sctp_in SCTP_IPV6_V6ONLY(inp6)) continue; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* we skip unspecifed addresses */ continue; @@ -2466,7 +2466,7 @@ sctp_find_valid_localaddr(struct sctp_tc if (stcb->asoc.scope.ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + sin = &sctp_ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* skip unspecifed addresses */ continue; @@ -2500,7 +2500,7 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { continue; } - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* * we skip unspecifed @@ -2772,18 +2772,16 @@ sctp_process_initack_addresses(struct sc struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; + union sctp_sockstore store; #ifdef INET6 struct sctp_ipv6addr_param addr6_store; - struct sockaddr_in6 sin6; #endif #ifdef INET struct sctp_ipv4addr_param addr4_store; - struct sockaddr_in sin; #endif - struct sockaddr *sa; uint32_t vrf_id; SCTPDBG(SCTP_DEBUG_ASCONF2, "processing init-ack addresses\n"); @@ -2796,21 +2794,6 @@ sctp_process_initack_addresses(struct sc if ((offset + sizeof(struct sctp_paramhdr)) > length) { return; } - /* init the addresses */ -#ifdef INET6 - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_port = stcb->rport; -#endif - -#ifdef INET - bzero(&sin, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_len = sizeof(sin); - sin.sin_port = stcb->rport; -#endif - /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), @@ -2833,9 +2816,11 @@ sctp_process_initack_addresses(struct sc a6p == NULL) { return; } - memcpy(&sin6.sin6_addr, a6p->addr, - sizeof(struct in6_addr)); - sa = (struct sockaddr *)&sin6; + memset(&store, 0, sizeof(union sctp_sockstore)); + store.sin6.sin6_family = AF_INET6; + store.sin6.sin6_len = sizeof(struct sockaddr_in6); + store.sin6.sin6_port = stcb->rport; + memcpy(&store.sin6.sin6_addr, a6p->addr, sizeof(struct in6_addr)); break; } #endif @@ -2852,8 +2837,11 @@ sctp_process_initack_addresses(struct sc a4p == NULL) { return; } - sin.sin_addr.s_addr = a4p->addr; - sa = (struct sockaddr *)&sin; + memset(&store, 0, sizeof(union sctp_sockstore)); + store.sin.sin_family = AF_INET; + store.sin.sin_len = sizeof(struct sockaddr_in); + store.sin.sin_port = stcb->rport; + store.sin.sin_addr.s_addr = a4p->addr; break; } #endif @@ -2867,7 +2855,7 @@ sctp_process_initack_addresses(struct sc } else { vrf_id = SCTP_DEFAULT_VRFID; } - sctp_ifa = sctp_find_ifa_by_addr(sa, vrf_id, + sctp_ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id, SCTP_ADDR_NOT_LOCKED); if (sctp_ifa == NULL) { /* address doesn't exist anymore */ @@ -2878,7 +2866,7 @@ sctp_process_initack_addresses(struct sc SCTP_PCB_FLAGS_DO_ASCONF)) && stcb->asoc.asconf_supported) { /* queue an ASCONF DEL_IP_ADDRESS */ - status = sctp_asconf_queue_sa_delete(stcb, sa); + status = sctp_asconf_queue_sa_delete(stcb, &store.sa); /* * if queued ok, and in correct state, send * out the ASCONF. @@ -3125,7 +3113,7 @@ sctp_check_address_list_all(struct sctp_ switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + sin = &sctp_ifa->address.sin; if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, &sin->sin_addr) != 0) { continue; @@ -3139,7 +3127,7 @@ sctp_check_address_list_all(struct sctp_ #endif #ifdef INET6 case AF_INET6: - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + sin6 = &sctp_ifa->address.sin6; if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, &sin6->sin6_addr) != 0) { continue; Modified: stable/10/sys/netinet/sctp_constants.h ============================================================================== --- stable/10/sys/netinet/sctp_constants.h Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_constants.h Thu Sep 18 08:58:22 2014 (r271746) @@ -267,18 +267,9 @@ __FBSDID("$FreeBSD$"); /* how many addresses per assoc remote and local */ #define SCTP_SCALE_FOR_ADDR 2 -/* default AUTO_ASCONF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_AUTO_ASCONF 1 - /* default MULTIPLE_ASCONF mode enable(1)/disable(0) value (sysctl) */ #define SCTP_DEFAULT_MULTIPLE_ASCONFS 0 -/* default MOBILITY_BASE mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_BASE 0 - -/* default MOBILITY_FASTHANDOFF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_FASTHANDOFF 0 - /* * Theshold for rwnd updates, we have to read (sb_hiwat >> * SCTP_RWND_HIWAT_SHIFT) before we will look to see if we need to send a Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_input.c Thu Sep 18 08:58:22 2014 (r271746) @@ -562,21 +562,12 @@ static void sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sockaddr_storage store; + union sctp_sockstore store; struct sctp_nets *r_net, *f_net; struct timeval tv; int req_prim = 0; uint16_t old_error_counter; -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_heartbeat_chunk)) { /* Invalid length */ return; @@ -586,12 +577,11 @@ sctp_handle_heartbeat_ack(struct sctp_he #ifdef INET case AF_INET: if (cp->heartbeat.hb_info.addr_len == sizeof(struct sockaddr_in)) { - sin = (struct sockaddr_in *)&store; - sin->sin_family = cp->heartbeat.hb_info.addr_family; - sin->sin_len = cp->heartbeat.hb_info.addr_len; - sin->sin_port = stcb->rport; - memcpy(&sin->sin_addr, cp->heartbeat.hb_info.address, - sizeof(sin->sin_addr)); + store.sin.sin_family = cp->heartbeat.hb_info.addr_family; + store.sin.sin_len = cp->heartbeat.hb_info.addr_len; + store.sin.sin_port = stcb->rport; + memcpy(&store.sin.sin_addr, cp->heartbeat.hb_info.address, + sizeof(store.sin.sin_addr)); } else { return; } @@ -600,12 +590,10 @@ sctp_handle_heartbeat_ack(struct sctp_he #ifdef INET6 case AF_INET6: if (cp->heartbeat.hb_info.addr_len == sizeof(struct sockaddr_in6)) { - sin6 = (struct sockaddr_in6 *)&store; - sin6->sin6_family = cp->heartbeat.hb_info.addr_family; - sin6->sin6_len = cp->heartbeat.hb_info.addr_len; - sin6->sin6_port = stcb->rport; - memcpy(&sin6->sin6_addr, cp->heartbeat.hb_info.address, - sizeof(sin6->sin6_addr)); + store.sin6.sin6_family = cp->heartbeat.hb_info.addr_family; + store.sin6.sin6_len = cp->heartbeat.hb_info.addr_len; + store.sin6.sin6_port = stcb->rport; + memcpy(&store.sin6.sin6_addr, cp->heartbeat.hb_info.address, sizeof(struct in6_addr)); } else { return; } @@ -614,7 +602,7 @@ sctp_handle_heartbeat_ack(struct sctp_he default: return; } - r_net = sctp_findnet(stcb, (struct sockaddr *)&store); + r_net = sctp_findnet(stcb, &store.sa); if (r_net == NULL) { SCTPDBG(SCTP_DEBUG_INPUT1, "Huh? I can't find the address I sent it to, discard\n"); return; @@ -2030,22 +2018,13 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_tcb *stcb; struct sctp_init_chunk *init_cp, init_buf; struct sctp_init_ack_chunk *initack_cp, initack_buf; - struct sockaddr_storage sa_store; - struct sockaddr *initack_src = (struct sockaddr *)&sa_store; + union sctp_sockstore store; struct sctp_association *asoc; int init_offset, initack_offset, initack_limit; int retval; int error = 0; uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE]; -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -2269,23 +2248,20 @@ sctp_process_cookie_new(struct mbuf *m, #ifdef INET case SCTP_IPV4_ADDRESS: /* source addr is IPv4 */ - sin = (struct sockaddr_in *)initack_src; - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_addr.s_addr = cookie->laddress[0]; + memset(&store.sin, 0, sizeof(struct sockaddr_in)); + store.sin.sin_family = AF_INET; + store.sin.sin_len = sizeof(struct sockaddr_in); + store.sin.sin_addr.s_addr = cookie->laddress[0]; break; #endif #ifdef INET6 case SCTP_IPV6_ADDRESS: /* source addr is IPv6 */ - sin6 = (struct sockaddr_in6 *)initack_src; - memset(sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_scope_id = cookie->scope_id; - memcpy(&sin6->sin6_addr, cookie->laddress, - sizeof(sin6->sin6_addr)); + memset(&store.sin6, 0, sizeof(struct sockaddr_in6)); + store.sin6.sin6_family = AF_INET6; + store.sin6.sin6_len = sizeof(struct sockaddr_in6); + store.sin6.sin6_scope_id = cookie->scope_id; + memcpy(&store.sin6.sin6_addr, cookie->laddress, sizeof(struct in6_addr)); break; #endif default: @@ -2366,7 +2342,7 @@ sctp_process_cookie_new(struct mbuf *m, sctp_check_address_list(stcb, m, initack_offset + sizeof(struct sctp_init_ack_chunk), initack_limit - (initack_offset + sizeof(struct sctp_init_ack_chunk)), - initack_src, cookie->local_scope, cookie->site_scope, + &store.sa, cookie->local_scope, cookie->site_scope, cookie->ipv4_scope, cookie->loopback_scope); @@ -2906,9 +2882,9 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie_ack: handling COOKIE-ACK\n"); - if (stcb == NULL) + if ((stcb == NULL) || (net == NULL)) { return; - + } asoc = &stcb->asoc; sctp_stop_all_cookie_timers(stcb); Modified: stable/10/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 08:58:22 2014 (r271746) @@ -152,16 +152,10 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define V_system_base_info VNET(system_base_info) #define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m #define SCTP_BASE_STATS V_system_base_info.sctpstat -#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat) -#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m) +#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m +#define SCTP_BASE_SYSCTL(__m) V_system_base_info.sctpsysctl.__m #define SCTP_BASE_VAR(__m) V_system_base_info.__m -/* - * - */ -#define USER_ADDR_NULL (NULL) /* FIX ME: temp */ - #define SCTP_PRINTF(params...) printf(params) #if defined(SCTP_DEBUG) #define SCTPDBG(level, params...) \ @@ -175,9 +169,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define SCTPDBG_ADDR(level, addr) \ { \ do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ - sctp_print_address(addr); \ - } \ + if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ + sctp_print_address(addr); \ + } \ } while (0); \ } #else Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_output.c Thu Sep 18 08:58:22 2014 (r271746) @@ -1881,7 +1881,7 @@ sctp_is_address_in_scope(struct sctp_ifa if (scope->ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sin; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* not in scope , unspecified */ return (0); @@ -1912,7 +1912,7 @@ sctp_is_address_in_scope(struct sctp_ifa return (0); } /* ok to use deprecated addresses? */ - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* skip unspecifed addresses */ return (0); @@ -1987,7 +1987,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct sctp_ipv4addr_param *ipv4p; struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sin; + sin = &ifa->address.sin; ipv4p = (struct sctp_ipv4addr_param *)parmh; parmh->param_type = htons(SCTP_IPV4_ADDRESS); parmh->param_length = htons(plen); @@ -2002,7 +2002,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct sctp_ipv6addr_param *ipv6p; struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; ipv6p = (struct sctp_ipv6addr_param *)parmh; parmh->param_type = htons(SCTP_IPV6_ADDRESS); parmh->param_length = htons(plen); @@ -5921,8 +5921,8 @@ do_a_abort: parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); - ph->param_length = htons(sizeof(struct sctp_paramhdr)); - chunk_len += sizeof(struct sctp_paramhdr); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; } /* And now tell the peer which extensions we support */ num_ext = 0; @@ -13552,7 +13552,7 @@ sctp_v4src_match_nexthop(struct sctp_ifa } ifa = (struct ifaddr *)sifa->ifa; mask = (struct sockaddr_in *)(ifa->ifa_netmask); - sin = (struct sockaddr_in *)&sifa->address.sin; + sin = &sifa->address.sin; srcnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: src address is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &sifa->address.sa); Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 08:58:22 2014 (r271746) @@ -625,7 +625,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifap->address.sin; + sin = &sctp_ifap->address.sin; if (SCTP_IFN_IS_IFT_LOOP(sctp_ifap->ifn_p) || (IN4_ISLOOPBACK_ADDRESS(&sin->sin_addr))) { sctp_ifap->src_is_loop = 1; @@ -645,7 +645,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo /* ok to use deprecated addresses? */ struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sctp_ifap->address.sin6; + sin6 = &sctp_ifap->address.sin6; if (SCTP_IFN_IS_IFT_LOOP(sctp_ifap->ifn_p) || (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))) { sctp_ifap->src_is_loop = 1; @@ -974,7 +974,7 @@ sctp_does_stcb_own_this_addr(struct sctp { struct sockaddr_in *sin, *rsin; - sin = (struct sockaddr_in *)&laddr->ifa->address.sin; + sin = &laddr->ifa->address.sin; rsin = (struct sockaddr_in *)to; if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { SCTP_IPI_ADDR_RUNLOCK(); @@ -988,7 +988,7 @@ sctp_does_stcb_own_this_addr(struct sctp { struct sockaddr_in6 *sin6, *rsin6; - sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; + sin6 = &laddr->ifa->address.sin6; rsin6 = (struct sockaddr_in6 *)to; if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { SCTP_IPI_ADDR_RUNLOCK(); @@ -2330,7 +2330,7 @@ sctp_findassociation_ep_asconf(struct mb struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { struct sctp_tcb *stcb; - struct sockaddr_storage remote_store; + union sctp_sockstore remote_store; struct sctp_paramhdr parm_buf, *phdr; int ptype; int zero_address = 0; @@ -2372,7 +2372,7 @@ sctp_findassociation_ep_asconf(struct mb __FUNCTION__); return (NULL); } - sin6 = (struct sockaddr_in6 *)&remote_store; + sin6 = &remote_store.sin6; sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = sh->src_port; @@ -2399,7 +2399,7 @@ sctp_findassociation_ep_asconf(struct mb __FUNCTION__); return (NULL); } - sin = (struct sockaddr_in *)&remote_store; + sin = &remote_store.sin; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = sh->src_port; @@ -2422,7 +2422,7 @@ sctp_findassociation_ep_asconf(struct mb } } else { stcb = sctp_findassociation_ep_addr(inp_p, - (struct sockaddr *)&remote_store, netp, + &remote_store.sa, netp, dst, NULL); } return (stcb); @@ -3130,31 +3130,21 @@ continue_anyway: * too (before adding). */ struct sctp_ifa *ifa; - struct sockaddr_storage store_sa; + union sctp_sockstore store; - memset(&store_sa, 0, sizeof(store_sa)); + memset(&store, 0, sizeof(store)); switch (addr->sa_family) { #ifdef INET case AF_INET: - { - struct sockaddr_in *sin; - - sin = (struct sockaddr_in *)&store_sa; - memcpy(sin, addr, sizeof(struct sockaddr_in)); - sin->sin_port = 0; - break; - } + memcpy(&store.sin, addr, sizeof(struct sockaddr_in)); + store.sin.sin_port = 0; + break; #endif #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 *sin6; - - sin6 = (struct sockaddr_in6 *)&store_sa; - memcpy(sin6, addr, sizeof(struct sockaddr_in6)); - sin6->sin6_port = 0; - break; - } + memcpy(&store.sin6, addr, sizeof(struct sockaddr_in6)); + store.sin6.sin6_port = 0; + break; #endif default: break; @@ -3172,7 +3162,7 @@ continue_anyway: * pass things in via the sctp_ifap argument * (Panda). */ - ifa = sctp_find_ifa_by_addr((struct sockaddr *)&store_sa, + ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id, SCTP_ADDR_NOT_LOCKED); } if (ifa == NULL) { @@ -5980,6 +5970,9 @@ sctp_pcb_finish(void) LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); SCTP_DECR_LADDR_COUNT(); + if (wi->action == SCTP_DEL_IP_ADDRESS) { + SCTP_FREE(wi->ifa, SCTP_M_IFA); + } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); } SCTP_WQ_ADDR_UNLOCK(); @@ -6134,7 +6127,6 @@ sctp_load_addresses_from_init(struct sct peer_supports_prsctp = 0; peer_supports_auth = 0; peer_supports_asconf = 0; - peer_supports_asconf = 0; peer_supports_reconfig = 0; peer_supports_nrsack = 0; peer_supports_pktdrop = 0; Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_sysctl.c Thu Sep 18 08:58:22 2014 (r271746) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +FEATURE(sctp, "Stream Control Transmission Protocol"); /* * sysctl tunable variables @@ -102,9 +105,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; - /* JRS - Variable for default congestion control module */ SCTP_BASE_SYSCTL(sctp_default_cc_module) = SCTPCTL_DEFAULT_CC_MODULE_DEFAULT; - /* RS - Variable for default stream scheduling module */ SCTP_BASE_SYSCTL(sctp_default_ss_module) = SCTPCTL_DEFAULT_SS_MODULE_DEFAULT; SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; @@ -127,7 +128,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; #if defined(SCTP_DEBUG) SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; -printf("debug = %d.\n", SCTP_BASE_SYSCTL(sctp_debug_on)); #endif #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; @@ -137,7 +137,7 @@ printf("debug = %d.\n", SCTP_BASE_SYSCTL /* It returns an upper limit. No filtering is done here */ static unsigned int -number_of_addresses(struct sctp_inpcb *inp) +sctp_sysctl_number_of_addresses(struct sctp_inpcb *inp) { unsigned int cnt; struct sctp_vrf *vrf; @@ -187,7 +187,7 @@ number_of_addresses(struct sctp_inpcb *i } static int -copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) +sctp_sysctl_copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) { struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; @@ -252,7 +252,7 @@ copy_out_local_addresses(struct sctp_inp if (ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + sin = &sctp_ifa->address.sin; if (sin->sin_addr.s_addr == 0) continue; if (prison_check_ip4(inp->ip_inp.inp.inp_cred, @@ -271,7 +271,7 @@ copy_out_local_addresses(struct sctp_inp if (ipv6_addr_legal) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) continue; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, @@ -353,7 +353,7 @@ copy_out_local_addresses(struct sctp_inp * sysctl functions */ static int -sctp_assoclist(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) { unsigned int number_of_endpoints; unsigned int number_of_local_addresses; @@ -375,14 +375,14 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) number_of_remote_addresses = 0; SCTP_INP_INFO_RLOCK(); - if (req->oldptr == USER_ADDR_NULL) { + if (req->oldptr == NULL) { LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); number_of_endpoints++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { number_of_associations++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { number_of_remote_addresses++; } @@ -399,7 +399,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) req->oldidx = (n + n / 8); return (0); } - if (req->newptr != USER_ADDR_NULL) { + if (req->newptr != NULL) { SCTP_INP_INFO_RUNLOCK(); SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); @@ -437,7 +437,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, NULL, req); + error = sctp_sysctl_copy_out_local_addresses(inp, NULL, req); if (error) { SCTP_INP_DECR_REF(inp); return (error); @@ -488,7 +488,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, stcb, req); + error = sctp_sysctl_copy_out_local_addresses(inp, stcb, req); if (error) { SCTP_INP_DECR_REF(inp); atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -556,196 +556,97 @@ skip: return (error); } - -#define RANGECHK(var, min, max) \ - if ((var) < (min)) { (var) = (min); } \ - else if ((var) > (max)) { (var) = (max); } - static int -sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_udp_tunneling(SYSCTL_HANDLER_ARGS) { int error; - uint32_t old_sctp_udp_tunneling_port; + uint32_t old, new; SCTP_INP_INFO_RLOCK(); - old_sctp_udp_tunneling_port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); + old = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); SCTP_INP_INFO_RUNLOCK(); - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), SCTPCTL_UDP_TUNNELING_PORT_MIN, SCTPCTL_UDP_TUNNELING_PORT_MAX); - if (old_sctp_udp_tunneling_port == SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - error = 0; - goto out; - } - SCTP_INP_INFO_WLOCK(); - if (old_sctp_udp_tunneling_port) { - sctp_over_udp_stop(); - } - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - if (sctp_over_udp_start()) { - SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = 0; + new = old; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_UDP_TUNNELING_PORT_MIN) || + (new > SCTPCTL_UDP_TUNNELING_PORT_MAX)) { + error = EINVAL; + } else { + SCTP_INP_INFO_WLOCK(); + SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = new; + if (old != 0) { + sctp_over_udp_stop(); } + if (new != 0) { + error = sctp_over_udp_start(); + } + SCTP_INP_INFO_WUNLOCK(); } - SCTP_INP_INFO_WUNLOCK(); } -out: return (error); } static int -sysctl_sctp_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_auth(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_split_point), SCTPCTL_MIN_SPLIT_POINT_MIN, SCTPCTL_MIN_SPLIT_POINT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_chunkscale), SCTPCTL_CHUNKSCALE_MIN, SCTPCTL_CHUNKSCALE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), SCTPCTL_DELAYED_SACK_TIME_MIN, SCTPCTL_DELAYED_SACK_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_sack_freq_default), SCTPCTL_SACK_FREQ_MIN, SCTPCTL_SACK_FREQ_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), SCTPCTL_SYS_RESOURCE_MIN, SCTPCTL_SYS_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), SCTPCTL_ASOC_RESOURCE_MIN, SCTPCTL_ASOC_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), SCTPCTL_HEARTBEAT_INTERVAL_MIN, SCTPCTL_HEARTBEAT_INTERVAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), SCTPCTL_PMTU_RAISE_TIME_MIN, SCTPCTL_PMTU_RAISE_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), SCTPCTL_SHUTDOWN_GUARD_TIME_MIN, SCTPCTL_SHUTDOWN_GUARD_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), SCTPCTL_SECRET_LIFETIME_MIN, SCTPCTL_SECRET_LIFETIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_max_default), SCTPCTL_RTO_MAX_MIN, SCTPCTL_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_min_default), SCTPCTL_RTO_MIN_MIN, SCTPCTL_RTO_MIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_initial_default), SCTPCTL_RTO_INITIAL_MIN, SCTPCTL_RTO_INITIAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rto_max_default), SCTPCTL_INIT_RTO_MAX_MIN, SCTPCTL_INIT_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), SCTPCTL_VALID_COOKIE_LIFE_MIN, SCTPCTL_VALID_COOKIE_LIFE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), SCTPCTL_INIT_RTX_MAX_MIN, SCTPCTL_INIT_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), SCTPCTL_ASSOC_RTX_MAX_MIN, SCTPCTL_ASSOC_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_do_drain), SCTPCTL_DO_SCTP_DRAIN_MIN, SCTPCTL_DO_SCTP_DRAIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hb_maxburst), SCTPCTL_HB_MAX_BURST_MIN, SCTPCTL_HB_MAX_BURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), SCTPCTL_ABORT_AT_LIMIT_MIN, SCTPCTL_ABORT_AT_LIMIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_data_order), SCTPCTL_STRICT_DATA_ORDER_MIN, SCTPCTL_STRICT_DATA_ORDER_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_residual), SCTPCTL_MIN_RESIDUAL_MIN, SCTPCTL_MIN_RESIDUAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_retran_chunk), SCTPCTL_MAX_RETRAN_CHUNK_MIN, SCTPCTL_MAX_RETRAN_CHUNK_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_ss_module), SCTPCTL_DEFAULT_SS_MODULE_MIN, SCTPCTL_DEFAULT_SS_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_steady_step), SCTPCTL_RTTVAR_STEADYS_MIN, SCTPCTL_RTTVAR_STEADYS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_diag_info_code), SCTPCTL_DIAG_INFO_CODE_MIN, SCTPCTL_DIAG_INFO_CODE_MAX); - -#ifdef SCTP_DEBUG - RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); -#endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); -#endif + new = SCTP_BASE_SYSCTL(sctp_auth_disable); + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_AUTH_DISABLE_MIN) || + (new > SCTPCTL_AUTH_DISABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { + error = EINVAL; + } else { + SCTP_BASE_SYSCTL(sctp_auth_disable) = new; + } } return (error); } static int -sysctl_sctp_auth_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_asconf(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - if (SCTP_BASE_SYSCTL(sctp_auth_disable) < SCTPCTL_AUTH_DISABLE_MIN) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MIN; - } - if (SCTP_BASE_SYSCTL(sctp_auth_disable) > SCTPCTL_AUTH_DISABLE_MAX) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MAX; - } - if ((SCTP_BASE_SYSCTL(sctp_auth_disable) == 1) && - (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) { - /* - * You can't disable AUTH with disabling ASCONF - * first - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 09:21:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E3F1C0; Thu, 18 Sep 2014 09:21:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1DC79758; Thu, 18 Sep 2014 09:21:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9LTe8020496; Thu, 18 Sep 2014 09:21:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9LTkU020495; Thu, 18 Sep 2014 09:21:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409180921.s8I9LTkU020495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 09:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271748 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 09:21:30 -0000 Author: mav Date: Thu Sep 18 09:21:29 2014 New Revision: 271748 URL: http://svnweb.freebsd.org/changeset/base/271748 Log: MFC r271644: Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. Submitted by: Sean Fagan Approved by: re (kib) Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu Sep 18 09:13:20 2014 (r271747) +++ stable/10/sys/cam/scsi/scsi_da.c Thu Sep 18 09:21:29 2014 (r271748) @@ -547,6 +547,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * PNY USB 3.0 Flash Drives + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16 + }, + { + /* * PNY USB Flash keys * PR: usb/75578, usb/72344, usb/65436 */ From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 09:22:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA39F319; Thu, 18 Sep 2014 09:22:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 95308766; Thu, 18 Sep 2014 09:22:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9MbVa020732; Thu, 18 Sep 2014 09:22:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9MbgX020731; Thu, 18 Sep 2014 09:22:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409180922.s8I9MbgX020731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 09:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271749 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 09:22:37 -0000 Author: mav Date: Thu Sep 18 09:22:37 2014 New Revision: 271749 URL: http://svnweb.freebsd.org/changeset/base/271749 Log: MFC r271644: Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. Submitted by: Sean Fagan Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Sep 18 09:21:29 2014 (r271748) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Sep 18 09:22:37 2014 (r271749) @@ -548,6 +548,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * PNY USB 3.0 Flash Drives + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16 + }, + { + /* * PNY USB Flash keys * PR: usb/75578, usb/72344, usb/65436 */ From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 09:49:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D64BDAA4; Thu, 18 Sep 2014 09:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BDF2F9AE; Thu, 18 Sep 2014 09:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9np81031025; Thu, 18 Sep 2014 09:49:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9nnbE031005; Thu, 18 Sep 2014 09:49:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409180949.s8I9nnbE031005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Sep 2014 09:49: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: r271750 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 09:49:52 -0000 Author: tuexen Date: Thu Sep 18 09:49:49 2014 New Revision: 271750 URL: http://svnweb.freebsd.org/changeset/base/271750 Log: MFC r271643: Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC r271665: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC r271670: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC r271672: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC r271673: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC r271674: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. Approved by: re (kib) Modified: stable/10/sys/netinet/sctp_auth.c stable/10/sys/netinet/sctp_auth.h stable/10/sys/netinet/sctp_cc_functions.c stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_structs.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_auth.c ============================================================================== --- stable/10/sys/netinet/sctp_auth.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_auth.c Thu Sep 18 09:49:49 2014 (r271750) @@ -631,7 +631,7 @@ sctp_copy_skeylist(const struct sctp_key sctp_hmaclist_t * -sctp_alloc_hmaclist(uint8_t num_hmacs) +sctp_alloc_hmaclist(uint16_t num_hmacs) { sctp_hmaclist_t *new_list; int alloc_size; @@ -1438,8 +1438,8 @@ sctp_auth_get_cookie_params(struct sctp_ p_random = (struct sctp_auth_random *)phdr; random_len = plen - sizeof(*p_random); } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: stable/10/sys/netinet/sctp_auth.h ============================================================================== --- stable/10/sys/netinet/sctp_auth.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_auth.h Thu Sep 18 09:49:49 2014 (r271750) @@ -154,7 +154,7 @@ sctp_auth_key_release(struct sctp_tcb *s /* hmac list handling */ -extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint8_t num_hmacs); +extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); extern void sctp_free_hmaclist(sctp_hmaclist_t * list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); Modified: stable/10/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/10/sys/netinet/sctp_cc_functions.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_cc_functions.c Thu Sep 18 09:49:49 2014 (r271750) @@ -1130,12 +1130,9 @@ sctp_cwnd_update_after_packet_dropped(st uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt; unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT in msd for this calc */ - rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1144,10 +1141,11 @@ sctp_cwnd_update_after_packet_dropped(st * adjust the on-queue if our flight is more it could be that the * router has not yet gotten data "in-flight" to it */ - if (*on_queue < net->flight_size) + if (*on_queue < net->flight_size) { *on_queue = net->flight_size; - /* calculate the available space */ - bw_avail = (*bottle_bw * rtt) / 1000; + } + /* rtt is measured in micro seconds, bottle_bw in bytes per second */ + bw_avail = (uint32_t) (((uint64_t) (*bottle_bw) * net->rtt) / (uint64_t) 1000000); if (bw_avail > *bottle_bw) { /* * Cap the growth to no more than the bottle neck. This can @@ -1167,7 +1165,6 @@ sctp_cwnd_update_after_packet_dropped(st int seg_inflight, seg_onqueue, my_portion; net->partial_bytes_acked = 0; - /* how much are we over queue size? */ incr = *on_queue - bw_avail; if (stcb->asoc.seen_a_sack_this_pkt) { Modified: stable/10/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 09:49:49 2014 (r271750) @@ -322,7 +322,7 @@ typedef struct callout sctp_os_timer_t; /* MTU */ /*************************/ #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu -#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0) +#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((uint32_t)((rt != NULL) ? rt->rt_mtu : 0)) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_output.c Thu Sep 18 09:49:49 2014 (r271750) @@ -11301,7 +11301,7 @@ sctp_send_hb(struct sctp_tcb *stcb, stru hb->heartbeat.hb_info.time_value_1 = now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ - hb->heartbeat.hb_info.addr_family = net->ro._l_addr.sa.sa_family; + hb->heartbeat.hb_info.addr_family = (uint8_t) net->ro._l_addr.sa.sa_family; hb->heartbeat.hb_info.addr_len = net->ro._l_addr.sa.sa_len; if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { /* Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 09:49:49 2014 (r271750) @@ -6513,8 +6513,8 @@ sctp_load_addresses_from_init(struct sct } got_random = 1; } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: stable/10/sys/netinet/sctp_structs.h ============================================================================== --- stable/10/sys/netinet/sctp_structs.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_structs.h Thu Sep 18 09:49:49 2014 (r271750) @@ -418,8 +418,8 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { - uint16_t id; - uint16_t can_take_data; + uint8_t id; + uint8_t can_take_data; }; Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_usrreq.c Thu Sep 18 09:49:49 2014 (r271750) @@ -4208,12 +4208,13 @@ sctp_setopt(struct socket *so, int optna uint32_t i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize); - if (optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) { + if ((optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) || + (shmac->shmac_number_of_idents > 0xffff)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - hmaclist = sctp_alloc_hmaclist(shmac->shmac_number_of_idents); + hmaclist = sctp_alloc_hmaclist((uint16_t) shmac->shmac_number_of_idents); if (hmaclist == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM); error = ENOMEM; Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctputil.c Thu Sep 18 09:49:49 2014 (r271750) @@ -2403,8 +2403,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + (uint64_t) now.tv_usec; - /* computer rtt in ms */ - rtt = net->rtt / 1000; + /* compute rtt in ms */ + rtt = (int32_t) (net->rtt / 1000); if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) { /* * Tell the CC module that a new update has just occurred From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 11:52:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8279B69; Thu, 18 Sep 2014 11:52:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C2C5883B; Thu, 18 Sep 2014 11:52:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IBqSNS090895; Thu, 18 Sep 2014 11:52:28 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IBqSNA090894; Thu, 18 Sep 2014 11:52:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409181152.s8IBqSNA090894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Sep 2014 11:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271755 - stable/10/usr.sbin/ctld 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 11:52:29 -0000 Author: trasz Date: Thu Sep 18 11:52:28 2014 New Revision: 271755 URL: http://svnweb.freebsd.org/changeset/base/271755 Log: MFC r271571: Fix two small nits in ctl.conf(5). Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 10:46:51 2014 (r271754) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 11:52:28 2014 (r271755) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2014 +.Dd September 14, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -93,6 +93,7 @@ The default is Create a .Sy portal-group configuration context, +defining a new portal-group, which can then be assigned to any number of targets. .It Ic target Ar name Create a @@ -282,7 +283,7 @@ The CTL-specific options passed to the k All CTL-specific options are documented in the .Sx OPTIONS section of -.Xr ctladm 8 +.Xr ctladm 8 . .It Ic path Ar path The path to the file or device node used to back the LUN. .It Ic serial Ar string From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 13:53:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F552EB4; Thu, 18 Sep 2014 13:53:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 29E8E8F2; Thu, 18 Sep 2014 13:53:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDreRv049571; Thu, 18 Sep 2014 13:53:40 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDre2A049570; Thu, 18 Sep 2014 13:53:40 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181353.s8IDre2A049570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 13:53: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: r271760 - stable/10/usr.sbin/unbound/local-setup 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 13:53:40 -0000 Author: des Date: Thu Sep 18 13:53:39 2014 New Revision: 271760 URL: http://svnweb.freebsd.org/changeset/base/271760 Log: MFH (r271255): fix parsing of ipv6 nameserver lines Approved by: re (kib) Modified: stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Sep 18 13:39:47 2014 (r271759) +++ stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Sep 18 13:53:39 2014 (r271760) @@ -178,7 +178,7 @@ gen_forward_conf() { echo "forward-zone:" echo " name: ." for forwarder ; do - if expr "${forwarder}" : "^[0-9:.]\{1,\}$" >/dev/null ; then + if expr "${forwarder}" : "^[0-9A-Fa-f:.]\{1,\}$" >/dev/null ; then echo " forward-addr: ${forwarder}" else echo " forward-host: ${forwarder}" From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:27:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4438D7BF; Thu, 18 Sep 2014 14:27:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1575ECBE; Thu, 18 Sep 2014 14:27:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IERbQe064972; Thu, 18 Sep 2014 14:27:37 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IERb33064971; Thu, 18 Sep 2014 14:27:37 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181427.s8IERb33064971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:27: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: r271766 - stable/10/lib/libpam/modules/pam_login_access 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:27:38 -0000 Author: des Date: Thu Sep 18 14:27:37 2014 New Revision: 271766 URL: http://svnweb.freebsd.org/changeset/base/271766 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. Approved by: re (gjb) PR: 83099 Modified: stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:16:14 2014 (r271765) +++ stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:27:37 2014 (r271766) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:31:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D28C59E1; Thu, 18 Sep 2014 14:31:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A335FCF1; Thu, 18 Sep 2014 14:31:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEVImi068893; Thu, 18 Sep 2014 14:31:18 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEVI4C068892; Thu, 18 Sep 2014 14:31:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181431.s8IEVI4C068892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271767 - stable/9/lib/libpam/modules/pam_login_access X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:31:18 -0000 Author: des Date: Thu Sep 18 14:31:18 2014 New Revision: 271767 URL: http://svnweb.freebsd.org/changeset/base/271767 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. PR: 83099 Modified: stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:27:37 2014 (r271766) +++ stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:18 2014 (r271767) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:31:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6E63B26; Thu, 18 Sep 2014 14:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 97CCACFA; Thu, 18 Sep 2014 14:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEVSCf068971; Thu, 18 Sep 2014 14:31:28 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEVS85068970; Thu, 18 Sep 2014 14:31:28 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181431.s8IEVS85068970@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271768 - stable/8/lib/libpam/modules/pam_login_access X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:31:28 -0000 Author: des Date: Thu Sep 18 14:31:28 2014 New Revision: 271768 URL: http://svnweb.freebsd.org/changeset/base/271768 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. PR: 83099 Modified: stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/8/lib/libpam/ (props changed) Modified: stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:18 2014 (r271767) +++ stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:28 2014 (r271768) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:38:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CECBF56; Thu, 18 Sep 2014 14:38:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1320EDDC; Thu, 18 Sep 2014 14:38:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEcLip070878; Thu, 18 Sep 2014 14:38:21 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEcITk070853; Thu, 18 Sep 2014 14:38:18 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409181438.s8IEcITk070853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 14:38:18 +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: r271769 - in stable/10/sys: dev/drm2 dev/fb dev/vt dev/vt/hw/efifb dev/vt/hw/fb dev/vt/hw/vga kern powerpc/ps3 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:38:21 -0000 Author: dumbbell Date: Thu Sep 18 14:38:18 2014 New Revision: 271769 URL: http://svnweb.freebsd.org/changeset/base/271769 Log: vt(4): Merge several bug fixes and improvements SVN revisions in this MFC: 269779 270705 270706 271180 271250 271253 271682 271684 Detailed commit list: r269779: fbd: Fix a bug where vt_fb_attach() success would be considered a failure vt_fb_attach() currently always returns 0, but it could return a code defined in errno.h. However, it doesn't return a CN_* code. So checking its return value against CN_DEAD (which is 0) is incorrect, and in this case, a success becomes a failure. The consequence was unimportant, because the caller (drm_fb_helper.c) would only log an error message in this case. The console would still work. Approved by: nwhitehorn r270705: vt(4): Add cngrab() and cnungrab() callbacks They are used when a panic occurs or when entering a DDB session for instance. cngrab() forces a vt-switch to the console window, no matter if the original window is another terminal or an X session. However, cnungrab() doesn't vt-switch back to the original window currently. r270706: drm: Don't "taskqueue" vt-switch if under DDB/panic situation If DDB is active, we can't use a taskqueue thread to switch away from the X window, because this thread can't run. Reviewed by: ray@ Approved by: ray@ r271180: vt_vga: vd_setpixel_t and vd_drawrect_t are noop in text mode r271250: vt(4): Change the terminal and buffer sizes, even without a font This fixes a bug where scroll lock would not work for tty #0 when using vt_vga's textmode. The reason was that this window is created with a static 256x100 buffer, larger than the real size of 80x25. Now, in vt_change_font() and vt_compute_drawable_area(), we still perform operations even of the window has no font loaded (this is the case in textmode here vw->vw_font == NULL). One of these operation resizes the buffer accordingly. In vt_compute_drawable_area(), we take the terminal size as is (ie. 80x25) for the drawable area. The font argument to vt_set_border() is removed (it was never used) and the code now uses the computed drawable area instead of re-doing its own calculation. Reported by: Harald Schmalzbauer Tested by: Harald Schmalzbauer r271253: pause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active This fixes a panic in the i915 driver when one uses debug.kdb.enter=1 under vt(4). PR: 193269 Reported by: emaste@ Submitted by: avg@ r271682: vt(4): Fix a LOR which occurs during a call to vt_upgrade() Reported by: kib@ Review: https://reviews.freebsd.org/D785 Reviewed by: ray@ Approved by: ray@ r271684: vt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative Review: https://reviews.freebsd.org/D789 Reviewed by: nwhitehorn Approved by: nwhitehorn Approved by: re (gjb) Modified: stable/10/sys/dev/drm2/drm_fb_helper.c stable/10/sys/dev/fb/fbd.c stable/10/sys/dev/vt/hw/efifb/efifb.c stable/10/sys/dev/vt/hw/fb/vt_early_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.h stable/10/sys/dev/vt/hw/vga/vt_vga.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c stable/10/sys/kern/kern_synch.c stable/10/sys/kern/subr_terminal.c stable/10/sys/powerpc/ps3/ps3_syscons.c stable/10/sys/sys/terminal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 18 14:38:18 2014 (r271769) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #if defined(__FreeBSD__) + +#include + struct vt_kms_softc { struct drm_fb_helper *fb_helper; struct task fb_mode_task; @@ -65,7 +68,11 @@ vt_kms_postswitch(void *arg) struct vt_kms_softc *sc; sc = (struct vt_kms_softc *)arg; - taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task); + + if (!kdb_active && panicstr == NULL) + taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task); + else + drm_fb_helper_restore_fbdev_mode(sc->fb_helper); return (0); } Modified: stable/10/sys/dev/fb/fbd.c ============================================================================== --- stable/10/sys/dev/fb/fbd.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/fb/fbd.c Thu Sep 18 14:38:18 2014 (r271769) @@ -246,8 +246,9 @@ fbd_register(struct fb_info* info) return (err); if (first) { - if (vt_fb_attach(info) == CN_DEAD) - return (ENXIO); + err = vt_fb_attach(info); + if (err) + return (err); } return (0); Modified: stable/10/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- stable/10/sys/dev/vt/hw/efifb/efifb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/efifb/efifb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -62,6 +62,8 @@ static struct vt_driver vt_efifb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: stable/10/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -61,6 +61,8 @@ static struct vt_driver vt_fb_early_driv .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_priority = VD_PRIORITY_GENERIC, }; Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -static vd_drawrect_t vt_fb_drawrect; -static vd_setpixel_t vt_fb_setpixel; - static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, @@ -146,7 +143,7 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff return (EINVAL); } -static void +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { struct fb_info *info; @@ -181,7 +178,7 @@ vt_fb_setpixel(struct vt_device *vd, int } -static void +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, term_color_t color) { Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.h Thu Sep 18 14:38:18 2014 (r271769) @@ -40,6 +40,8 @@ vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitblt_text_t vt_fb_bitblt_text; vd_bitblt_bmp_t vt_fb_bitblt_bitmap; +vd_drawrect_t vt_fb_drawrect; +vd_setpixel_t vt_fb_setpixel; vd_postswitch_t vt_fb_postswitch; vd_fb_ioctl_t vt_fb_ioctl; vd_fb_mmap_t vt_fb_mmap; Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Sep 18 14:38:18 2014 (r271769) @@ -352,6 +352,9 @@ static void vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { + if (vd->vd_flags & VDF_TEXTMODE) + return; + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, 0x80 >> (x % 8)); } @@ -362,6 +365,9 @@ vga_drawrect(struct vt_device *vd, int x { int x, y; + if (vd->vd_flags & VDF_TEXTMODE) + return; + for (y = y1; y <= y2; y++) { if (fill || (y == y1) || (y == y2)) { for (x = x1; x <= x2; x++) Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/vt.h Thu Sep 18 14:38:18 2014 (r271769) @@ -256,6 +256,8 @@ struct vt_window { term_rect_t vw_draw_area; /* (?) Drawable area. */ unsigned int vw_number; /* (c) Window number. */ int vw_kbdmode; /* (?) Keyboard mode. */ + int vw_prev_kbdmode;/* (?) Previous mode. */ + int vw_grabbed; /* (?) Grab count. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ int vw_mouse_level;/* Mouse op mode. */ Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/vt_core.c Thu Sep 18 14:38:18 2014 (r271769) @@ -70,6 +70,9 @@ static tc_done_t vtterm_done; static tc_cnprobe_t vtterm_cnprobe; static tc_cngetc_t vtterm_cngetc; +static tc_cngrab_t vtterm_cngrab; +static tc_cnungrab_t vtterm_cnungrab; + static tc_opened_t vtterm_opened; static tc_ioctl_t vtterm_ioctl; static tc_mmap_t vtterm_mmap; @@ -86,6 +89,9 @@ const struct terminal_class vt_termclass .tc_cnprobe = vtterm_cnprobe, .tc_cngetc = vtterm_cngetc, + .tc_cngrab = vtterm_cngrab, + .tc_cnungrab = vtterm_cnungrab, + .tc_opened = vtterm_opened, .tc_ioctl = vtterm_ioctl, .tc_mmap = vtterm_mmap, @@ -188,6 +194,7 @@ static struct vt_window vt_conswindow = .vw_device = &vt_consdev, .vw_terminal = &vt_consterm, .vw_kbdmode = K_XLATE, + .vw_grabbed = 0, }; static struct terminal vt_consterm = { .tm_class = &vt_termclass, @@ -420,10 +427,16 @@ vt_compute_drawable_area(struct vt_windo struct vt_device *vd; struct vt_font *vf; - if (vw->vw_font == NULL) + vd = vw->vw_device; + + if (vw->vw_font == NULL) { + vw->vw_draw_area.tr_begin.tp_col = 0; + vw->vw_draw_area.tr_begin.tp_row = 0; + vw->vw_draw_area.tr_end.tp_col = vd->vd_width; + vw->vw_draw_area.tr_end.tp_row = vd->vd_height; return; + } - vd = vw->vw_device; vf = vw->vw_font; /* @@ -1211,6 +1224,64 @@ vtterm_cngetc(struct terminal *tm) } static void +vtterm_cngrab(struct terminal *tm) +{ + struct vt_device *vd; + struct vt_window *vw; + keyboard_t *kbd; + + vw = tm->tm_softc; + vd = vw->vw_device; + + if (!cold) + vt_window_switch(vw); + + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd == NULL) + return; + + if (vw->vw_grabbed++ > 0) + return; + + /* + * Make sure the keyboard is accessible even when the kbd device + * driver is disabled. + */ + kbdd_enable(kbd); + + /* We shall always use the keyboard in the XLATE mode here. */ + vw->vw_prev_kbdmode = vw->vw_kbdmode; + vw->vw_kbdmode = K_XLATE; + (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + + kbdd_poll(kbd, TRUE); +} + +static void +vtterm_cnungrab(struct terminal *tm) +{ + struct vt_device *vd; + struct vt_window *vw; + keyboard_t *kbd; + + vw = tm->tm_softc; + vd = vw->vw_device; + + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd == NULL) + return; + + if (--vw->vw_grabbed > 0) + return; + + kbdd_poll(kbd, FALSE); + + vw->vw_kbdmode = vw->vw_prev_kbdmode; + (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + kbdd_disable(kbd); +} + +static void vtterm_opened(struct terminal *tm, int opened) { struct vt_window *vw = tm->tm_softc; @@ -1228,30 +1299,40 @@ vtterm_opened(struct terminal *tm, int o } static int -vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) +vt_set_border(struct vt_window *vw, term_color_t c) { struct vt_device *vd = vw->vw_device; - int x, y, off_x, off_y; if (vd->vd_driver->vd_drawrect == NULL) return (ENOTSUP); - x = vd->vd_width - 1; - y = vd->vd_height - 1; - off_x = vw->vw_draw_area.tr_begin.tp_col; - off_y = vw->vw_draw_area.tr_begin.tp_row; - /* Top bar. */ - if (off_y > 0) - vd->vd_driver->vd_drawrect(vd, 0, 0, x, off_y - 1, 1, c); + if (vw->vw_draw_area.tr_begin.tp_row > 0) + vd->vd_driver->vd_drawrect(vd, + 0, 0, + vd->vd_width - 1, vw->vw_draw_area.tr_begin.tp_row - 1, + 1, c); + /* Left bar. */ - if (off_x > 0) - vd->vd_driver->vd_drawrect(vd, 0, off_y, off_x - 1, y - off_y, + if (vw->vw_draw_area.tr_begin.tp_col > 0) + vd->vd_driver->vd_drawrect(vd, + 0, 0, + vw->vw_draw_area.tr_begin.tp_col - 1, vd->vd_height - 1, + 1, c); + + /* Right bar. */ + if (vw->vw_draw_area.tr_end.tp_col < vd->vd_width) + vd->vd_driver->vd_drawrect(vd, + vw->vw_draw_area.tr_end.tp_col - 1, 0, + vd->vd_width - 1, vd->vd_height - 1, + 1, c); + + /* Bottom bar. */ + if (vw->vw_draw_area.tr_end.tp_row < vd->vd_height) + vd->vd_driver->vd_drawrect(vd, + 0, vw->vw_draw_area.tr_end.tp_row - 1, + vd->vd_width - 1, vd->vd_height - 1, 1, c); - /* Right bar. May be 1 pixel wider than necessary due to rounding. */ - vd->vd_driver->vd_drawrect(vd, x - off_x, off_y, x, y - off_y, 1, c); - /* Bottom bar. May be 1 mixel taller than necessary due to rounding. */ - vd->vd_driver->vd_drawrect(vd, 0, y - off_y, x, y, 1, c); return (0); } @@ -1283,11 +1364,6 @@ vt_change_font(struct vt_window *vw, str VT_UNLOCK(vd); return (EBUSY); } - if (vd->vd_flags & VDF_TEXTMODE) { - /* Our device doesn't need fonts. */ - VT_UNLOCK(vd); - return (ENOTTY); - } vw->vw_flags |= VWF_BUSY; VT_UNLOCK(vd); @@ -1302,7 +1378,7 @@ vt_change_font(struct vt_window *vw, str /* Actually apply the font to the current window. */ VT_LOCK(vd); - if (vw->vw_font != vf) { + if (vw->vw_font != vf && vw->vw_font != NULL && vf != NULL) { /* * In case vt_change_font called to update size we don't need * to update font link. @@ -1325,7 +1401,7 @@ vt_change_font(struct vt_window *vw, str /* Force a full redraw the next timer tick. */ if (vd->vd_curwindow == vw) { - vt_set_border(vw, vf, TC_BLACK); + vt_set_border(vw, TC_BLACK); vd->vd_flags |= VDF_INVALID; vt_resume_flush_timer(vw->vw_device, 0); } @@ -2247,7 +2323,6 @@ vt_allocate(struct vt_driver *drv, void main_vd->vd_driver->vd_name, drv->vd_name); } vd = main_vd; - VT_LOCK(vd); if (vd->vd_flags & VDF_ASYNC) { /* Stop vt_flush periodic task. */ @@ -2263,6 +2338,7 @@ vt_allocate(struct vt_driver *drv, void * Reset VDF_TEXTMODE flag, driver who require that flag (vt_vga) will * set it. */ + VT_LOCK(vd); vd->vd_flags &= ~VDF_TEXTMODE; vd->vd_driver = drv; Modified: stable/10/sys/kern/kern_synch.c ============================================================================== --- stable/10/sys/kern/kern_synch.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/kern/kern_synch.c Thu Sep 18 14:38:18 2014 (r271769) @@ -363,7 +363,7 @@ pause_sbt(const char *wmesg, sbintime_t if (sbt == 0) sbt = tick_sbt; - if (cold) { + if (cold || kdb_active) { /* * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s): Modified: stable/10/sys/kern/subr_terminal.c ============================================================================== --- stable/10/sys/kern/subr_terminal.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/kern/subr_terminal.c Thu Sep 18 14:38:18 2014 (r271769) @@ -476,13 +476,17 @@ termcn_cnregister(struct terminal *tm) static void termcn_cngrab(struct consdev *cp) { + struct terminal *tm = cp->cn_arg; + tm->tm_class->tc_cngrab(tm); } static void termcn_cnungrab(struct consdev *cp) { + struct terminal *tm = cp->cn_arg; + tm->tm_class->tc_cnungrab(tm); } static void Modified: stable/10/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- stable/10/sys/powerpc/ps3/ps3_syscons.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/powerpc/ps3/ps3_syscons.c Thu Sep 18 14:38:18 2014 (r271769) @@ -78,6 +78,8 @@ static struct vt_driver vt_ps3fb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: stable/10/sys/sys/terminal.h ============================================================================== --- stable/10/sys/sys/terminal.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/sys/terminal.h Thu Sep 18 14:38:18 2014 (r271769) @@ -155,6 +155,9 @@ typedef void tc_done_t(struct terminal * typedef void tc_cnprobe_t(struct terminal *tm, struct consdev *cd); typedef int tc_cngetc_t(struct terminal *tm); +typedef void tc_cngrab_t(struct terminal *tm); +typedef void tc_cnungrab_t(struct terminal *tm); + typedef void tc_opened_t(struct terminal *tm, int opened); typedef int tc_ioctl_t(struct terminal *tm, u_long cmd, caddr_t data, struct thread *td); @@ -175,6 +178,10 @@ struct terminal_class { tc_cnprobe_t *tc_cnprobe; tc_cngetc_t *tc_cngetc; + /* DDB & panic handling. */ + tc_cngrab_t *tc_cngrab; + tc_cnungrab_t *tc_cnungrab; + /* Misc. */ tc_opened_t *tc_opened; tc_ioctl_t *tc_ioctl; From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:44:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2926789; Thu, 18 Sep 2014 14:44:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 82633ED1; Thu, 18 Sep 2014 14:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEimcd076283; Thu, 18 Sep 2014 14:44:48 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEimqv076281; Thu, 18 Sep 2014 14:44:48 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409181444.s8IEimqv076281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 18 Sep 2014 14:44:48 +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: r271773 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:44:48 -0000 Author: grehan Date: Thu Sep 18 14:44:47 2014 New Revision: 271773 URL: http://svnweb.freebsd.org/changeset/base/271773 Log: MFC tty fixes, r259549 and r259663 Keep tty_makedev as a function to preserve the KBI on 10-stable (it is a macro in CURRENT). The changes for this are direct commits to 10-stable. r259549 (glebius): - Rename tty_makedev() into tty_makedevf() and make it capable to fail and return error. - Use make_dev_p() in tty_makedevf() instead of make_dev_cred(). - Always pass MAKEDEV_CHECKNAME flag. - Optionally pass MAKEDEV_REF flag. - Provide macro for compatibility with old API. This fixes races with simultaneous creation and desctruction of ttys, and makes it possible to call tty_makedevf() from device cloners. A race in tty_watermarks() still exist, since the latter drops lock for M_WAITOK allocation. This will be addressed in separate commit. r259663 (glebius): Move list of ttys handling from the allocating procedures, to the device creation stage. A device creation can fail, and in that case an entry already on the list will be freed. KBI issue pointed out by: kib Reviewed by: kib (KBI addition) Approved by: re (kib) Modified: stable/10/sys/kern/tty.c stable/10/sys/sys/tty.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Thu Sep 18 14:43:23 2014 (r271772) +++ stable/10/sys/kern/tty.c Thu Sep 18 14:44:47 2014 (r271773) @@ -289,7 +289,7 @@ ttydev_open(struct cdev *dev, int oflags goto done; ttydisc_open(tp); - tty_watermarks(tp); + tty_watermarks(tp); /* XXXGL: drops lock */ } /* Wait for Carrier Detect. */ @@ -1007,11 +1007,6 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx); knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx); - sx_xlock(&tty_list_sx); - TAILQ_INSERT_TAIL(&tty_list, tp, t_list); - tty_list_count++; - sx_xunlock(&tty_list_sx); - return (tp); } @@ -1020,11 +1015,6 @@ tty_dealloc(void *arg) { struct tty *tp = arg; - sx_xlock(&tty_list_sx); - TAILQ_REMOVE(&tty_list, tp, t_list); - tty_list_count--; - sx_xunlock(&tty_list_sx); - /* Make sure we haven't leaked buffers. */ MPASS(ttyinq_getsize(&tp->t_inq) == 0); MPASS(ttyoutq_getsize(&tp->t_outq) == 0); @@ -1065,6 +1055,11 @@ tty_rel_free(struct tty *tp) tp->t_dev = NULL; tty_unlock(tp); + sx_xlock(&tty_list_sx); + TAILQ_REMOVE(&tty_list, tp, t_list); + tty_list_count--; + sx_xunlock(&tty_list_sx); + if (dev != NULL) destroy_dev_sched_cb(dev, tty_dealloc, tp); } @@ -1174,24 +1169,23 @@ SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTY * the user. */ -void -tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +static int +tty_vmakedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, va_list ap) { - va_list ap; - struct cdev *dev; + struct cdev *dev, *init, *lock, *cua, *cinit, *clock; const char *prefix = "tty"; char name[SPECNAMELEN - 3]; /* for "tty" and "cua". */ uid_t uid; gid_t gid; mode_t mode; + int error; /* Remove "tty" prefix from devices like PTY's. */ if (tp->t_flags & TF_NOPREFIX) prefix = ""; - va_start(ap, fmt); vsnrprintf(name, sizeof name, 32, fmt, ap); - va_end(ap); if (cred == NULL) { /* System device. */ @@ -1205,57 +1199,121 @@ tty_makedev(struct tty *tp, struct ucred mode = S_IRUSR|S_IWUSR|S_IWGRP; } + flags = flags & TTYMK_CLONING ? MAKEDEV_REF : 0; + flags |= MAKEDEV_CHECKNAME; + /* Master call-in device. */ - dev = make_dev_cred(&ttydev_cdevsw, 0, cred, - uid, gid, mode, "%s%s", prefix, name); + error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, + "%s%s", prefix, name); + if (error) + return (error); dev->si_drv1 = tp; wakeup(&dev->si_drv1); tp->t_dev = dev; + init = lock = cua = cinit = clock = NULL; + /* Slave call-in devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_INIT, cred, - uid, gid, mode, "%s%s.init", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_in; - - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_LOCK, cred, - uid, gid, mode, "%s%s.lock", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_in; + error = make_dev_p(flags, &init, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.init", prefix, name); + if (error) + goto fail; + dev_depends(dev, init); + dev2unit(init) = TTYUNIT_INIT; + init->si_drv1 = tp; + wakeup(&init->si_drv1); + init->si_drv2 = &tp->t_termios_init_in; + + error = make_dev_p(flags, &lock, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.lock", prefix, name); + if (error) + goto fail; + dev_depends(dev, lock); + dev2unit(lock) = TTYUNIT_LOCK; + lock->si_drv1 = tp; + wakeup(&lock->si_drv1); + lock->si_drv2 = &tp->t_termios_lock_in; } /* Call-out devices. */ if (tp->t_flags & TF_CALLOUT) { - dev = make_dev_cred(&ttydev_cdevsw, TTYUNIT_CALLOUT, cred, + error = make_dev_p(flags, &cua, &ttydev_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); + if (error) + goto fail; + dev_depends(dev, cua); + dev2unit(cua) = TTYUNIT_CALLOUT; + cua->si_drv1 = tp; + wakeup(&cua->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_INIT, cred, + error = make_dev_p(flags, &cinit, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_out; + if (error) + goto fail; + dev_depends(dev, cinit); + dev2unit(cinit) = TTYUNIT_CALLOUT | TTYUNIT_INIT; + cinit->si_drv1 = tp; + wakeup(&cinit->si_drv1); + cinit->si_drv2 = &tp->t_termios_init_out; - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_LOCK, cred, + error = make_dev_p(flags, &clock, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_out; + if (error) + goto fail; + dev_depends(dev, clock); + dev2unit(clock) = TTYUNIT_CALLOUT | TTYUNIT_LOCK; + clock->si_drv1 = tp; + wakeup(&clock->si_drv1); + clock->si_drv2 = &tp->t_termios_lock_out; } } + + sx_xlock(&tty_list_sx); + TAILQ_INSERT_TAIL(&tty_list, tp, t_list); + tty_list_count++; + sx_xunlock(&tty_list_sx); + + return (0); + +fail: + destroy_dev(dev); + if (init) + destroy_dev(init); + if (lock) + destroy_dev(lock); + if (cinit) + destroy_dev(cinit); + if (clock) + destroy_dev(clock); + + return (error); +} + +int +tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) +{ + va_list ap; + int error; + + va_start(ap, fmt); + error = tty_vmakedevf(tp, cred, flags, fmt, ap); + va_end(ap); + + return (error); +} + +void +tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void) tty_vmakedevf(tp, cred, 0, fmt, ap); + va_end(ap); } /* Modified: stable/10/sys/sys/tty.h ============================================================================== --- stable/10/sys/sys/tty.h Thu Sep 18 14:43:23 2014 (r271772) +++ stable/10/sys/sys/tty.h Thu Sep 18 14:44:47 2014 (r271773) @@ -173,6 +173,9 @@ void tty_rel_gone(struct tty *tp); /* Device node creation. */ void tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) __printflike(3, 4); +int tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) __printflike(4, 5); +#define TTYMK_CLONING 0x1 #define tty_makealias(tp,fmt,...) \ make_dev_alias((tp)->t_dev, fmt, ## __VA_ARGS__) From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:50:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A2E95; Thu, 18 Sep 2014 14:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6D4A7F31; Thu, 18 Sep 2014 14:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEopns078330; Thu, 18 Sep 2014 14:50:51 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEopbq078329; Thu, 18 Sep 2014 14:50:51 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409181450.s8IEopbq078329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 18 Sep 2014 14:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271776 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:50:51 -0000 Author: smh Date: Thu Sep 18 14:50:50 2014 New Revision: 271776 URL: http://svnweb.freebsd.org/changeset/base/271776 Log: MFC r271429: Persist vdev_resilver_txg changes to avoid panic caused by validation vs a vdev_resilver_txg value from a previous resilver. Approved by: re (glebius) Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 18 14:50:21 2014 (r271775) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 18 14:50:50 2014 (r271776) @@ -1951,12 +1951,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t /* * If the vdev was resilvering and no longer has any - * DTLs then reset its resilvering flag. + * DTLs then reset its resilvering flag and dirty + * the top level so that we persist the change. */ if (vd->vdev_resilver_txg != 0 && range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0 && - range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) + range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) { vd->vdev_resilver_txg = 0; + vdev_config_dirty(vd->vdev_top); + } mutex_exit(&vd->vdev_dtl_lock); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 14:53:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB2FF2A3; Thu, 18 Sep 2014 14:53:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 95A11FEB; Thu, 18 Sep 2014 14:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IErUvj081430; Thu, 18 Sep 2014 14:53:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IErUUi081429; Thu, 18 Sep 2014 14:53:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201409181453.s8IErUUi081429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 18 Sep 2014 14:53: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: r271777 - stable/10/usr.sbin/bsdinstall/scripts 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 14:53:30 -0000 Author: nwhitehorn Date: Thu Sep 18 14:53:30 2014 New Revision: 271777 URL: http://svnweb.freebsd.org/changeset/base/271777 Log: MFC r271552: Make the default choice for the chroot shell at the end be "No". This allows just pressing enter repeatedly to successfully install a reasonable system. Approved by: re (gjb) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Thu Sep 18 14:50:50 2014 (r271776) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Thu Sep 18 14:53:30 2014 (r271777) @@ -252,7 +252,8 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; the fi dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ - --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 + --default-button no --yesno \ + "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then clear mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 15:10:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 007E6CD7; Thu, 18 Sep 2014 15:10:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DCFB8254; Thu, 18 Sep 2014 15:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IFAN9I087810; Thu, 18 Sep 2014 15:10:23 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IFAMCa087803; Thu, 18 Sep 2014 15:10:22 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201409181510.s8IFAMCa087803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 18 Sep 2014 15:10: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: r271779 - in stable/10/lib/msun: . ld128 ld80 man src 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 15:10:24 -0000 Author: tijl Date: Thu Sep 18 15:10:22 2014 New Revision: 271779 URL: http://svnweb.freebsd.org/changeset/base/271779 Log: MFC r257770 r257818 r257823 r260066 r260067 r260089 r260145 r268587 r268588 r268589 r268590 r268593 r268597 r269758 r270845 r270847 r270893 r270932 r270947 r271147 Merge libm work by kargl, bde and das from the past few months. Besides optimisations and small bug fixes this includes new implementations for C99 functions expl, coshl, sinhl, tanhl, erfl and erfcl. Approved by: re (kib) Added: stable/10/lib/msun/ld128/k_expl.h - copied unchanged from r260066, head/lib/msun/ld128/k_expl.h stable/10/lib/msun/ld128/s_erfl.c - copied unchanged from r268593, head/lib/msun/ld128/s_erfl.c stable/10/lib/msun/ld80/k_expl.h - copied unchanged from r260066, head/lib/msun/ld80/k_expl.h stable/10/lib/msun/ld80/s_erfl.c - copied unchanged from r268593, head/lib/msun/ld80/s_erfl.c stable/10/lib/msun/src/e_coshl.c - copied, changed from r260067, head/lib/msun/src/e_coshl.c stable/10/lib/msun/src/e_sinhl.c - copied, changed from r260067, head/lib/msun/src/e_sinhl.c stable/10/lib/msun/src/s_tanhl.c - copied, changed from r260067, head/lib/msun/src/s_tanhl.c Modified: stable/10/lib/msun/Makefile stable/10/lib/msun/Symbol.map stable/10/lib/msun/ld128/s_expl.c stable/10/lib/msun/ld80/s_expl.c stable/10/lib/msun/man/cosh.3 stable/10/lib/msun/man/erf.3 stable/10/lib/msun/man/sinh.3 stable/10/lib/msun/man/tanh.3 stable/10/lib/msun/src/e_cosh.c stable/10/lib/msun/src/e_lgamma_r.c stable/10/lib/msun/src/e_lgammaf_r.c stable/10/lib/msun/src/e_pow.c stable/10/lib/msun/src/e_sinh.c stable/10/lib/msun/src/imprecise.c stable/10/lib/msun/src/math.h stable/10/lib/msun/src/s_erf.c stable/10/lib/msun/src/s_erff.c stable/10/lib/msun/src/s_round.c stable/10/lib/msun/src/s_roundf.c stable/10/lib/msun/src/s_roundl.c stable/10/lib/msun/src/s_tanh.c stable/10/lib/msun/src/s_tanhf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/Makefile ============================================================================== --- stable/10/lib/msun/Makefile Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/Makefile Thu Sep 18 15:10:22 2014 (r271779) @@ -72,7 +72,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c s_lround.c s_lroundf.c s_lroundl.c s_modff.c \ s_nan.c s_nearbyint.c s_nextafter.c s_nextafterf.c \ s_nexttowardf.c s_remquo.c s_remquof.c \ - s_rint.c s_rintf.c s_round.c s_roundf.c s_roundl.c \ + s_rint.c s_rintf.c s_round.c s_roundf.c \ s_scalbln.c s_scalbn.c s_scalbnf.c s_signbit.c \ s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c \ s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \ @@ -97,13 +97,14 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_ .if ${LDBL_PREC} != 53 # If long double != double use these; otherwise, we alias the double versions. COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ - e_fmodl.c e_hypotl.c e_remainderl.c e_sqrtl.c \ + e_coshl.c e_fmodl.c e_hypotl.c \ + e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ - s_csqrtl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ + s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_frexpl.c s_logbl.c s_logl.c s_nanl.c s_nextafterl.c \ - s_nexttoward.c s_remquol.c s_rintl.c s_scalbnl.c \ - s_sinl.c s_tanl.c s_truncl.c w_cabsl.c + s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c s_scalbnl.c \ + s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c .endif # C99 complex functions @@ -161,9 +162,9 @@ MLINKS+=cimag.3 cimagf.3 cimag.3 cimagl. cimag.3 creal.3 cimag.3 crealf.3 cimag.3 creall.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 MLINKS+=cos.3 cosf.3 cos.3 cosl.3 -MLINKS+=cosh.3 coshf.3 +MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 MLINKS+=csqrt.3 csqrtf.3 csqrt.3 csqrtl.3 -MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 +MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 erf.3 erfl.3 erf.3 erfcl.3 MLINKS+=exp.3 expm1.3 exp.3 expm1f.3 exp.3 expm1l.3 exp.3 pow.3 exp.3 powf.3 \ exp.3 exp2.3 exp.3 exp2f.3 exp.3 exp2l.3 exp.3 expf.3 exp.3 expl.3 MLINKS+=fabs.3 fabsf.3 fabs.3 fabsl.3 @@ -209,11 +210,11 @@ MLINKS+=round.3 roundf.3 round.3 roundl. MLINKS+=scalbn.3 scalbln.3 scalbn.3 scalblnf.3 scalbn.3 scalblnl.3 MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3 MLINKS+=sin.3 sinf.3 sin.3 sinl.3 -MLINKS+=sinh.3 sinhf.3 +MLINKS+=sinh.3 sinhf.3 sinh.3 sinhl.3 MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3 sqrt.3 sqrtf.3 \ sqrt.3 sqrtl.3 MLINKS+=tan.3 tanf.3 tan.3 tanl.3 -MLINKS+=tanh.3 tanhf.3 +MLINKS+=tanh.3 tanhf.3 tanh.3 tanhl.3 MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 .include Modified: stable/10/lib/msun/Symbol.map ============================================================================== --- stable/10/lib/msun/Symbol.map Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/Symbol.map Thu Sep 18 15:10:22 2014 (r271779) @@ -260,23 +260,23 @@ FBSD_1.3 { ccosf; ccosh; ccoshf; + coshl; ctan; ctanf; ctanh; ctanhf; + erfcl; + erfl; expl; expm1l; log10l; log1pl; log2l; logl; + sinhl; + tanhl; /* Implemented as weak aliases for imprecise versions */ - coshl; - erfcl; - erfl; lgammal; powl; - sinhl; - tanhl; tgammal; }; Copied: stable/10/lib/msun/ld128/k_expl.h (from r260066, head/lib/msun/ld128/k_expl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/ld128/k_expl.h Thu Sep 18 15:10:22 2014 (r271779, copy of r260066, head/lib/msun/ld128/k_expl.h) @@ -0,0 +1,328 @@ +/* from: FreeBSD: head/lib/msun/ld128/s_expl.c 251345 2013-06-03 20:09:22Z kargl */ + +/*- + * Copyright (c) 2009-2013 Steven G. Kargl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Optimized by Bruce D. Evans. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ld128 version of k_expl.h. See ../ld80/s_expl.c for most comments. + * + * See ../src/e_exp.c and ../src/k_exp.h for precision-independent comments + * about the secondary kernels. + */ + +#define INTERVALS 128 +#define LOG2_INTERVALS 7 +#define BIAS (LDBL_MAX_EXP - 1) + +static const double +/* + * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must + * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest + * bits zero so that multiplication of it by n is exact. + */ +INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */ +L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */ +static const long double +/* 0x1.62e42fefa39ef35793c768000000p-8 */ +L1 = 5.41521234812457272982212595914567508e-3L; + +/* + * XXX values in hex in comments have been lost (or were never present) + * from here. + */ +static const long double +/* + * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]: + * |exp(x) - p(x)| < 2**-124.9 + * (0.002708 is ln2/(2*INTERVALS) rounded up a little). + * + * XXX the coeffs aren't very carefully rounded, and I get 3.6 more bits. + */ +A2 = 0.5, +A3 = 1.66666666666666666666666666651085500e-1L, +A4 = 4.16666666666666666666666666425885320e-2L, +A5 = 8.33333333333333333334522877160175842e-3L, +A6 = 1.38888888888888888889971139751596836e-3L; + +static const double +A7 = 1.9841269841269470e-4, /* 0x1.a01a01a019f91p-13 */ +A8 = 2.4801587301585286e-5, /* 0x1.71de3ec75a967p-19 */ +A9 = 2.7557324277411235e-6, /* 0x1.71de3ec75a967p-19 */ +A10 = 2.7557333722375069e-7; /* 0x1.27e505ab56259p-22 */ + +static const struct { + /* + * hi must be rounded to at most 106 bits so that multiplication + * by r1 in expm1l() is exact, but it is rounded to 88 bits due to + * historical accidents. + * + * XXX it is wasteful to use long double for both hi and lo. ld128 + * exp2l() uses only float for lo (in a very differently organized + * table; ld80 exp2l() is different again. It uses 2 doubles in a + * table organized like this one. 1 double and 1 float would + * suffice). There are different packing/locality/alignment/caching + * problems with these methods. + * + * XXX C's bad %a format makes the bits unreadable. They happen + * to all line up for the hi values 1 before the point and 88 + * in 22 nybbles, but for the low values the nybbles are shifted + * randomly. + */ + long double hi; + long double lo; +} tbl[INTERVALS] = { + 0x1p0L, 0x0p0L, + 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, + 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, + 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L, + 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L, + 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L, + 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L, + 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L, + 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L, + 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L, + 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L, + 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L, + 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L, + 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L, + 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L, + 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L, + 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L, + 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L, + 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L, + 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L, + 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L, + 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L, + 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L, + 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L, + 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L, + 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L, + 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L, + 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L, + 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L, + 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L, + 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L, + 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L, + 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L, + 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L, + 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L, + 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L, + 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L, + 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L, + 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L, + 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L, + 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L, + 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L, + 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L, + 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L, + 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L, + 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L, + 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L, + 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L, + 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L, + 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L, + 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L, + 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L, + 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L, + 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L, + 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L, + 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L, + 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L, + 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L, + 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L, + 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L, + 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L, + 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L, + 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L, + 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L, + 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L, + 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L, + 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L, + 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L, + 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L, + 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L, + 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L, + 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L, + 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L, + 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L, + 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L, + 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L, + 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L, + 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L, + 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L, + 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L, + 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L, + 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L, + 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L, + 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L, + 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L, + 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L, + 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L, + 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L, + 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L, + 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L, + 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L, + 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L, + 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L, + 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L, + 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L, + 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L, + 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L, + 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L, + 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L, + 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L, + 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L, + 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L, + 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L, + 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L, + 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L, + 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L, + 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L, + 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L, + 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L, + 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L, + 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L, + 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L, + 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L, + 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L, + 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L, + 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L, + 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L, + 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L, + 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L, + 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L, + 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L, + 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L, + 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L, + 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L, + 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L, + 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L, + 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L, + 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L +}; + +/* + * Kernel for expl(x). x must be finite and not tiny or huge. + * "tiny" is anything that would make us underflow (|A6*x^6| < ~LDBL_MIN). + * "huge" is anything that would make fn*L1 inexact (|x| > ~2**17*ln2). + */ +static inline void +__k_expl(long double x, long double *hip, long double *lop, int *kp) +{ + long double q, r, r1, t; + double dr, fn, r2; + int n, n2; + + /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ + /* Use a specialized rint() to get fn. Assume round-to-nearest. */ + /* XXX assume no extra precision for the additions, as for trig fns. */ + /* XXX this set of comments is now quadruplicated. */ + /* XXX but see ../src/e_exp.c for a fix using double_t. */ + fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52; +#if defined(HAVE_EFFICIENT_IRINT) + n = irint(fn); +#else + n = (int)fn; +#endif + n2 = (unsigned)n % INTERVALS; + /* Depend on the sign bit being propagated: */ + *kp = n >> LOG2_INTERVALS; + r1 = x - fn * L1; + r2 = fn * -L2; + r = r1 + r2; + + /* Evaluate expl(endpoint[n2] + r1 + r2) = tbl[n2] * expl(r1 + r2). */ + dr = r; + q = r2 + r * r * (A2 + r * (A3 + r * (A4 + r * (A5 + r * (A6 + + dr * (A7 + dr * (A8 + dr * (A9 + dr * A10)))))))); + t = tbl[n2].lo + tbl[n2].hi; + *hip = tbl[n2].hi; + *lop = tbl[n2].lo + t * (q + r1); +} + +/* + * XXX: the rest of the functions are identical for ld80 and ld128. + * However, we should use scalbnl() for ld128, since long double + * multiplication is very slow on the only supported ld128 arch (sparc64). + */ + +static inline void +k_hexpl(long double x, long double *hip, long double *lop) +{ + float twopkm1; + int k; + + __k_expl(x, hip, lop, &k); + SET_FLOAT_WORD(twopkm1, 0x3f800000 + ((k - 1) << 23)); + *hip *= twopkm1; + *lop *= twopkm1; +} + +static inline long double +hexpl(long double x) +{ + long double hi, lo, twopkm2; + int k; + + twopkm2 = 1; + __k_expl(x, &hi, &lo, &k); + SET_LDBL_EXPSIGN(twopkm2, BIAS + k - 2); + return (lo + hi) * 2 * twopkm2; +} + +#ifdef _COMPLEX_H +/* + * See ../src/k_exp.c for details. + */ +static inline long double complex +__ldexp_cexpl(long double complex z, int expt) +{ + long double exp_x, hi, lo; + long double x, y, scale1, scale2; + int half_expt, k; + + x = creall(z); + y = cimagl(z); + __k_expl(x, &hi, &lo, &k); + + exp_x = (lo + hi) * 0x1p16382; + expt += k - 16382; + + scale1 = 1; + half_expt = expt / 2; + SET_LDBL_EXPSIGN(scale1, BIAS + half_expt); + scale2 = 1; + SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); + + return (cpackl(cos(y) * exp_x * scale1 * scale2, + sinl(y) * exp_x * scale1 * scale2)); +} +#endif /* _COMPLEX_H */ Copied: stable/10/lib/msun/ld128/s_erfl.c (from r268593, head/lib/msun/ld128/s_erfl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/ld128/s_erfl.c Thu Sep 18 15:10:22 2014 (r271779, copy of r268593, head/lib/msun/ld128/s_erfl.c) @@ -0,0 +1,329 @@ +/* @(#)s_erf.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * See s_erf.c for complete comments. + * + * Converted to long double by Steven G. Kargl. + */ +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +/* XXX Prevent compilers from erroneously constant folding these: */ +static const volatile long double tiny = 0x1p-10000L; + +static const double +half= 0.5, +one = 1, +two = 2; +/* + * In the domain [0, 2**-40], only the first term in the power series + * expansion of erf(x) is used. The magnitude of the first neglected + * terms is less than 2**-120. + */ +static const long double +efx = 1.28379167095512573896158903121545167e-01L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06fc3f */ +efx8 = 1.02703333676410059116927122497236133e+00L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06ff3f */ +/* + * Domain [0, 0.84375], range ~[-1.919e-38, 1.919e-38]: + * |(erf(x) - x)/x - pp(x)/qq(x)| < 2**-125.29 + */ +pp0 = 1.28379167095512573896158903121545167e-01L, /* 0x3ffc06eb, 0xa8214db6, 0x88d71d48, 0xa7f6bfec */ +pp1 = -3.14931554396568573802046931159683404e-01L, /* 0xbffd427d, 0x6ada7263, 0x547eb096, 0x95f37463 */ +pp2 = -5.27514920282183487103576956956725309e-02L, /* 0xbffab023, 0xe5a271e3, 0xb0e79b01, 0x2f7ac962 */ +pp3 = -1.13202828509005281355609495523452713e-02L, /* 0xbff872f1, 0x6a5023a1, 0xe08b3884, 0x326af20f */ +pp4 = -9.18626155872522453865998391206048506e-04L, /* 0xbff4e19f, 0xea5fb024, 0x43247a37, 0xe430b06c */ +pp5 = -7.87518862406176274922506447157284230e-05L, /* 0xbff14a4f, 0x31a85fe0, 0x7fff2204, 0x09c49b37 */ +pp6 = -3.42357944472240436548115331090560881e-06L, /* 0xbfeccb81, 0x4b43c336, 0xcd2eb6c2, 0x903f2d87 */ +pp7 = -1.37317432573890412634717890726745428e-07L, /* 0xbfe826e3, 0x0e915eb6, 0x42aee414, 0xf7e36805 */ +pp8 = -2.71115170113861755855049008732113726e-09L, /* 0xbfe2749e, 0x2b94fd00, 0xecb4d166, 0x0efb91f8 */ +pp9 = -3.37925756196555959454018189718117864e-11L, /* 0xbfdc293e, 0x1d9060cb, 0xd043204a, 0x314cd7f0 */ +qq1 = 4.76672625471551170489978555182449450e-01L, /* 0x3ffde81c, 0xde6531f0, 0x76803bee, 0x526e29e9 */ +qq2 = 1.06713144672281502058807525850732240e-01L, /* 0x3ffbb518, 0xd7a6bb74, 0xcd9bdd33, 0x7601eee5 */ +qq3 = 1.47747613127513761102189201923147490e-02L, /* 0x3ff8e423, 0xae527e18, 0xf12cb447, 0x723b4749 */ +qq4 = 1.39939377672028671891148770908874816e-03L, /* 0x3ff56ed7, 0xba055d84, 0xc21b45c4, 0x388d1812 */ +qq5 = 9.44302939359455241271983309378738276e-05L, /* 0x3ff18c11, 0xc18c99a4, 0x86d0fe09, 0x46387b4c */ +qq6 = 4.56199342312522842161301671745365650e-06L, /* 0x3fed3226, 0x73421d05, 0x08875300, 0x32fa1432 */ +qq7 = 1.53019260483764773845294600092361197e-07L, /* 0x3fe8489b, 0x3a63f627, 0x2b9ad2ce, 0x26516e57 */ +qq8 = 3.25542691121324805094777901250005508e-09L, /* 0x3fe2bf6c, 0x26d93a29, 0x9142be7c, 0x9f1dd043 */ +qq9 = 3.37405581964478060434410167262684979e-11L; /* 0x3fdc28c8, 0xfb8fa1be, 0x10e57eec, 0xaa19e49f */ + +static const long double +erx = 8.42700792949714894142232424201210961e-01L, /* 0x3ffeaf76, 0x7a741088, 0xb0000000, 0x00000000 */ +/* + * Domain [0.84375, 1.25], range ~[-2.521e-36, 2.523e-36]: + * |(erf(x) - erx) - pa(x)/qa(x)| < 2**-120.15 + */ +pa0 = -2.48010117891186017024438233323795897e-17L, /* 0xbfc7c97f, 0x77812279, 0x6c877f22, 0xef4bfb2e */ +pa1 = 4.15107497420594680894327969504526489e-01L, /* 0x3ffda911, 0xf096fbc2, 0x55662005, 0x2337fa64 */ +pa2 = -3.94180628087084846724448515851892609e-02L, /* 0xbffa42e9, 0xab54528c, 0xad529da1, 0x6efc2af3 */ +pa3 = 4.48897599625192107295954790681677462e-02L, /* 0x3ffa6fbc, 0xa65edba1, 0x0e4cbcea, 0x73ef9a31 */ +pa4 = 8.02069252143016600110972019232995528e-02L, /* 0x3ffb4887, 0x0e8b548e, 0x3230b417, 0x11b553b3 */ +pa5 = -1.02729816533435279443621120242391295e-02L, /* 0xbff850a0, 0x041de3ee, 0xd5bca6c9, 0x4ef5f9f2 */ +pa6 = 5.70777694530755634864821094419982095e-03L, /* 0x3ff77610, 0x9b501e10, 0x4c978382, 0x742df68f */ +pa7 = 1.22635150233075521018231779267077071e-03L, /* 0x3ff5417b, 0x0e623682, 0x60327da0, 0x96b9219e */ +pa8 = 5.36100234820204569428412542856666503e-04L, /* 0x3ff41912, 0x27ceb4c1, 0x1d3298ec, 0x84ced627 */ +pa9 = -1.97753571846365167177187858667583165e-04L, /* 0xbff29eb8, 0x23f5bcf3, 0x15c83c46, 0xe4fda98b */ +pa10 = 6.19333039900846970674794789568415105e-05L, /* 0x3ff103c4, 0x60f88e46, 0xc0c9fb02, 0x13cc7fc1 */ +pa11 = -5.40531400436645861492290270311751349e-06L, /* 0xbfed6abe, 0x9665f8a8, 0xdd0ad3ba, 0xe5dc0ee3 */ +qa1 = 9.05041313265490487793231810291907851e-01L, /* 0x3ffecf61, 0x93340222, 0xe9930620, 0xc4e61168 */ +qa2 = 6.79848064708886864767240880834868092e-01L, /* 0x3ffe5c15, 0x0ba858dc, 0xf7900ae9, 0xfea1e09a */ +qa3 = 4.04720609926471677581066689316516445e-01L, /* 0x3ffd9e6f, 0x145e9b00, 0x6d8c1749, 0xd2928623 */ +qa4 = 1.69183273898369996364661075664302225e-01L, /* 0x3ffc5a7c, 0xc2a363c1, 0xd6c19097, 0xef9b4063 */ +qa5 = 7.44476185988067992342479750486764248e-02L, /* 0x3ffb30ef, 0xfc7259ef, 0x1bcbb089, 0x686dd62d */ +qa6 = 2.02981172725892407200420389604788573e-02L, /* 0x3ff94c90, 0x7976cb0e, 0x21e1d36b, 0x0f09ca2b */ +qa7 = 6.94281866271607668268269403102277234e-03L, /* 0x3ff7c701, 0x2b193250, 0xc5d46ecc, 0x374843d8 */ +qa8 = 1.12952275469171559611651594706820034e-03L, /* 0x3ff52818, 0xfd2a7c06, 0xd13e38fd, 0xda4b34f5 */ +qa9 = 3.13736683241992737197226578597710179e-04L, /* 0x3ff348fa, 0x0cb48d18, 0x051f849b, 0x135ccf74 */ +qa10 = 1.17037675204033225470121134087771410e-05L, /* 0x3fee88b6, 0x98f47704, 0xa5d8f8f2, 0xc6422e11 */ +qa11 = 4.61312518293853991439362806880973592e-06L, /* 0x3fed3594, 0xe31db94f, 0x3592b693, 0xed4386b4 */ +qa12 = -1.02158572037456893687737553657431771e-06L; /* 0xbfeb123a, 0xd60d9b1e, 0x1f6fdeb9, 0x7dc8410a */ +/* + * Domain [1.25,2.85715], range ~[-2.922e-37,2.922e-37]: + * |log(x*erfc(x)) + x**2 + 0.5625 - ra(x)/sa(x)| < 2**-121.36 + */ +static const long double +ra0 = -9.86494292470069009555706994426014461e-03L, /* 0xbff84341, 0x239e8709, 0xe941b06a, 0xcb4b6ec5 */ +ra1 = -1.13580436992565640457579040117568870e+00L, /* 0xbfff22c4, 0x133f7c0d, 0x72d5e231, 0x2eb1ee3f */ +ra2 = -4.89744330295291950661185707066921755e+01L, /* 0xc00487cb, 0xa38b4fc2, 0xc136695b, 0xc1df8047 */ +ra3 = -1.10766149300215937173768072715352140e+03L, /* 0xc00914ea, 0x55e6beb3, 0xabc50e07, 0xb6e5664d */ +ra4 = -1.49991031232170934967642795601952100e+04L, /* 0xc00cd4b8, 0xd33243e6, 0xffbf6545, 0x3c57ef6e */ +ra5 = -1.29805749738318462882524181556996692e+05L, /* 0xc00ffb0d, 0xbfeed9b6, 0x5b2a3ff4, 0xe245bd3c */ +ra6 = -7.42828497044940065828871976644647850e+05L, /* 0xc0126ab5, 0x8fe7caca, 0x473352d9, 0xcd4e0c90 */ +ra7 = -2.85637299581890734287995171242421106e+06L, /* 0xc0145cad, 0xa7f76fe7, 0x3e358051, 0x1799f927 */ +ra8 = -7.40674797129824999383748865571026084e+06L, /* 0xc015c412, 0x6fe29c02, 0x298ad158, 0x7d24e45c */ +ra9 = -1.28653420911930973914078724204151759e+07L, /* 0xc016889e, 0x7c2eb0dc, 0x95d5863b, 0x0aa34dc3 */ +ra10 = -1.47198163599330179552932489109452638e+07L, /* 0xc016c136, 0x90b84923, 0xf9bcb497, 0x19bbd0f5 */ +ra11 = -1.07812992258382800318665248311522624e+07L, /* 0xc0164904, 0xe673a113, 0x35d7f079, 0xe13701f3 */ +ra12 = -4.83545565681708642630419905537756076e+06L, /* 0xc0152721, 0xfea094a8, 0x869eb39d, 0x413d6f13 */ +ra13 = -1.23956521201673964822976917356685286e+06L, /* 0xc0132ea0, 0xd3646baa, 0x2fe62b0d, 0xbae5ce85 */ +ra14 = -1.62289333553652417591275333240371812e+05L, /* 0xc0103cf8, 0xaab1e2d6, 0x4c25e014, 0x248d76ab */ +ra15 = -8.82890392601176969729168894389833110e+03L, /* 0xc00c13e7, 0x3b3d8f94, 0x6fbda6f6, 0xe7049a82 */ +ra16 = -1.22591866337261720023681535568334619e+02L, /* 0xc005ea5e, 0x12358891, 0xcfa712c5, 0x77f050d4 */ +sa1 = 6.44508918884710829371852723353794047e+01L, /* 0x400501cd, 0xb69a6c0f, 0x5716de14, 0x47161af6 */ +sa2 = 1.76118475473171481523704824327358534e+03L, /* 0x4009b84b, 0xd305829f, 0xc4c771b0, 0xbf1f7f9b */ +sa3 = 2.69448346969488374857087646131950188e+04L, /* 0x400da503, 0x56bacc05, 0x4fdba68d, 0x2cca27e6 */ +sa4 = 2.56826633369941456778326497384543763e+05L, /* 0x4010f59d, 0x51124428, 0x69c41de6, 0xbd0d5753 */ +sa5 = 1.60647413092257206847700054645905859e+06L, /* 0x40138834, 0xa2184244, 0x557a1bed, 0x68c9d556 */ +sa6 = 6.76963075165099718574753447122393797e+06L, /* 0x40159d2f, 0x7b01b0cc, 0x8bac9e95, 0x5d35d56e */ +sa7 = 1.94295690905361884290986932493647741e+07L, /* 0x40172878, 0xc1172d61, 0x3068501e, 0x2f3c71da */ +sa8 = 3.79774781017759149060839255547073541e+07L, /* 0x401821be, 0xc30d06fe, 0x410563d7, 0x032111fd */ +sa9 = 5.00659831846029484248302236457727397e+07L, /* 0x40187df9, 0x1f97a111, 0xc51d6ac2, 0x4b389793 */ +sa10 = 4.36486287620506484276130525941972541e+07L, /* 0x40184d03, 0x3a618ae0, 0x2a723357, 0xfa45c60a */ +sa11 = 2.43779678791333894255510508253951934e+07L, /* 0x401773fa, 0x6fe10ee2, 0xc467850d, 0xc6b7ff30 */ +sa12 = 8.30732360384443202039372372212966542e+06L, /* 0x4015fb09, 0xee6a5631, 0xdd98de7e, 0x8b00461a */ +sa13 = 1.60160846942050515734192397495105693e+06L, /* 0x40138704, 0x8782bf13, 0x5b8fb315, 0xa898abe5 */ +sa14 = 1.54255505242533291014555153757001825e+05L, /* 0x40102d47, 0xc0abc98e, 0x843c9490, 0xb4352440 */ +sa15 = 5.87949220002375547561467275493888824e+03L, /* 0x400b6f77, 0xe00d21d1, 0xec4d41e8, 0x2f8e1673 */ +sa16 = 4.97272976346793193860385983372237710e+01L; /* 0x40048dd1, 0x816c1b3f, 0x24f540a6, 0x4cfe03cc */ +/* + * Domain [2.85715,9], range ~[-7.886e-37,7.918e-37]: + * |log(x*erfc(x)) + x**2 + 0.5625 - rb(x)/sb(x)| < 2**-120 + */ +static const long double +rb0 = -9.86494292470008707171371994479162369e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e561, 0xf4469360 */ +rb1 = -1.57047326624110727986326503729442830L, /* 0xbfff920a, 0x8935bf73, 0x8803b894, 0x4656482d */ +rb2 = -1.03228196364885474342132255440317065e2L, /* 0xc0059ce9, 0xac4ed0ff, 0x2cff0ff7, 0x5e70d1ab */ +rb3 = -3.74000570653418227179358710865224376e3L, /* 0xc00ad380, 0x2ebf7835, 0xf6b07ed2, 0x861242f7 */ +rb4 = -8.35435477739098044190860390632813956e4L, /* 0xc00f4657, 0x8c3ae934, 0x3647d7b3, 0x80e76fb7 */ +rb5 = -1.21398672055223642118716640216747152e6L, /* 0xc0132862, 0x2b8761c8, 0x27d18c0f, 0x137c9463 */ +rb6 = -1.17669175877248796101665344873273970e7L, /* 0xc0166719, 0x0b2cea46, 0x81f14174, 0x11602ea5 */ +rb7 = -7.66108006086998253606773064264599615e7L, /* 0xc019243f, 0x3c26f4f0, 0x1cc05241, 0x3b953728 */ +rb8 = -3.32547117558141845968704725353130804e8L, /* 0xc01b3d24, 0x42d8ee26, 0x24ef6f3b, 0x604a8c65 */ +rb9 = -9.41561252426350696802167711221739746e8L, /* 0xc01cc0f8, 0xad23692a, 0x8ddb2310, 0xe9937145 */ +rb10 = -1.67157110805390944549427329626281063e9L, /* 0xc01d8e88, 0x9a903734, 0x09a55fa3, 0xd205c903 */ +rb11 = -1.74339631004410841337645931421427373e9L, /* 0xc01d9fa8, 0x77582d2a, 0xc183b8ab, 0x7e00cb05 */ +rb12 = -9.57655233596934915727573141357471703e8L, /* 0xc01cc8a5, 0x460cc685, 0xd0271fa0, 0x6a70e3da */ +rb13 = -2.26320062731339353035254704082495066e8L, /* 0xc01aafab, 0xd7d76721, 0xc9720e11, 0x6a8bd489 */ +rb14 = -1.42777302996263256686002973851837039e7L, /* 0xc016b3b8, 0xc499689f, 0x2b88d965, 0xc32414f9 */ +sb1 = 1.08512869705594540211033733976348506e2L, /* 0x4005b20d, 0x2db7528d, 0x00d20dcb, 0x858f6191 */ +sb2 = 5.02757713761390460534494530537572834e3L, /* 0x400b3a39, 0x3bf4a690, 0x3025d28d, 0xfd40a891 */ +sb3 = 1.31019107205412870059331647078328430e5L, /* 0x400fffcb, 0x1b71d05e, 0x3b28361d, 0x2a3c3690 */ +sb4 = 2.13021555152296846166736757455018030e6L, /* 0x40140409, 0x3c6984df, 0xc4491d7c, 0xb04aa08d */ +sb5 = 2.26649105281820861953868568619768286e7L, /* 0x401759d6, 0xce8736f0, 0xf28ad037, 0x2a901e0c */ +sb6 = 1.61071939490875921812318684143076081e8L, /* 0x401a3338, 0x686fb541, 0x6bd27d06, 0x4f95c9ac */ +sb7 = 7.66895673844301852676056750497991966e8L, /* 0x401c6daf, 0x31cec121, 0x54699126, 0x4bd9bf9e */ +sb8 = 2.41884450436101936436023058196042526e9L, /* 0x401e2059, 0x46b0b8d7, 0x87b64cbf, 0x78bc296d */ +sb9 = 4.92403055884071695093305291535107666e9L, /* 0x401f257e, 0xbe5ed739, 0x39e17346, 0xcadd2e55 */ +sb10 = 6.18627786365587486459633615573786416e9L, /* 0x401f70bb, 0x1be7a7e7, 0x6a45b5ae, 0x607c70f0 */ +sb11 = 4.45898013426501378097430226324743199e9L, /* 0x401f09c6, 0xa32643d7, 0xf1724620, 0x9ea46c32 */ +sb12 = 1.63006115763329848117160344854224975e9L, /* 0x401d84a3, 0x0996887f, 0x65a4f43b, 0x978c1d74 */ +sb13 = 2.39216717012421697446304015847567721e8L, /* 0x401ac845, 0x09a065c2, 0x30095da7, 0x9d72d6ae */ +sb14 = 7.84837329009278694937250358810225609e6L; /* 0x4015df06, 0xd5290e15, 0x63031fac, 0x4d9c894c */ +/* + * Domain [9,108], range ~[-5.324e-38,5.340e-38]: + * |log(x*erfc(x)) + x**2 + 0.5625 - r(x)/s(x)| < 2**-124 + */ +static const long double +rc0 = -9.86494292470008707171367567652935673e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e55b, 0x1aa10fd3 */ +rc1 = -1.26229447747315096406518846411562266L, /* 0xbfff4325, 0xbb1aab28, 0xda395cd9, 0xfb861c15 */ +rc2 = -6.13742634438922591780742637728666162e1L, /* 0xc004eafe, 0x7dd51cd8, 0x3c7c5928, 0x751e50cf */ +rc3 = -1.50455835478908280402912854338421517e3L, /* 0xc0097823, 0xbc15b9ab, 0x3d60745c, 0x523e80a5 */ +rc4 = -2.04415631865861549920184039902945685e4L, /* 0xc00d3f66, 0x40b3fc04, 0x5388f2ec, 0xb009e1f0 */ +rc5 = -1.57625662981714582753490610560037638e5L, /* 0xc01033dc, 0xd4dc95b6, 0xfd4da93b, 0xf355b4a9 */ +rc6 = -6.73473451616752528402917538033283794e5L, /* 0xc01248d8, 0x2e73a4f9, 0xcded49c5, 0xfa3bfeb7 */ +rc7 = -1.47433165421387483167186683764364857e6L, /* 0xc01367f1, 0xba77a8f7, 0xcfdd0dbb, 0x25d554b3 */ +rc8 = -1.38811981807868828563794929997744139e6L, /* 0xc01352e5, 0x7d16d9ad, 0xbbdcbf38, 0x38fbc5ea */ +rc9 = -3.59659700530831825640766479698155060e5L, /* 0xc0115f3a, 0xecd57f45, 0x21f8ad6c, 0x910a5958 */ +sc1 = 7.72730753022908298637508998072635696e1L, /* 0x40053517, 0xa10d52bc, 0xdabb55b6, 0xbd0328cd */ +sc2 = 2.36825757341694050500333261769082182e3L, /* 0x400a2808, 0x3e0a9b42, 0x82977842, 0x9c5de29e */ +sc3 = 3.72210540173034735352888847134073099e4L, /* 0x400e22ca, 0x1ba827ef, 0xac8390d7, 0x1fc39a41 */ +sc4 = 3.24136032646418336712461033591393412e5L, /* 0x40113c8a, 0x0216e100, 0xc59d1e44, 0xf0e68d9d */ +sc5 = 1.57836135851134393802505823370009175e6L, /* 0x40138157, 0x95bc7664, 0x17575961, 0xdbe58eeb */ +sc6 = 4.12881981392063738026679089714182355e6L, /* 0x4014f801, 0x9e82e8d2, 0xb8b3a70e, 0xfd84185d */ +sc7 = 5.24438427289213488410596395361544142e6L, /* 0x40154017, 0x81177109, 0x2aa6c3b0, 0x1f106625 */ +sc8 = 2.59909544563616121735963429710382149e6L, /* 0x40143d45, 0xbb90a9b1, 0x12bf9390, 0xa827a700 */ +sc9 = 2.80930665169282501639651995082335693e5L; /* 0x40111258, 0xaa92222e, 0xa97e3216, 0xa237fa6c */ + +long double +erfl(long double x) +{ + long double ax,R,S,P,Q,s,y,z,r; + uint64_t lx, llx; + int32_t i; + uint16_t hx; + + EXTRACT_LDBL128_WORDS(hx, lx, llx, x); + + if((hx & 0x7fff) == 0x7fff) { /* erfl(nan)=nan */ + i = (hx>>15)<<1; + return (1-i)+one/x; /* erfl(+-inf)=+-1 */ + } + + ax = fabsl(x); + if(ax < 0.84375) { + if(ax < 0x1p-40L) { + if(ax < 0x1p-16373L) + return (8*x+efx8*x)/8; /* avoid spurious underflow */ + return x + efx*x; + } + z = x*x; + r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+ + z*(pp8+z*pp9)))))))); + s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+ + z*(qq8+z*qq9)))))))); + y = r/s; + return x + x*y; + } + if(ax < 1.25) { + s = ax-one; + P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+ + s*(pa8+s*(pa9+s*(pa10+s*pa11)))))))))); + Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+ + s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12))))))))))); + if(x>=0) return (erx + P/Q); else return (-erx - P/Q); + } + if (ax >= 9) { /* inf>|x|>= 9 */ + if(x>=0) return (one-tiny); else return (tiny-one); + } + s = one/(ax*ax); + if(ax < 2.85715) { /* |x| < 2.85715 */ + R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+ + s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+ + s*(ra15+s*ra16))))))))))))))); + S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+ + s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+ + s*(sa15+s*sa16))))))))))))))); + } else { /* |x| >= 2.85715 */ + R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+ + s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+ + s*rb14))))))))))))); + S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+ + s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+ + s*sb14))))))))))))); + } + z = (float)ax; + r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S); + if(x>=0) return (one-r/ax); else return (r/ax-one); +} + +long double +erfcl(long double x) +{ + long double ax,R,S,P,Q,s,y,z,r; + uint64_t lx, llx; + uint16_t hx; + + EXTRACT_LDBL128_WORDS(hx, lx, llx, x); + + if((hx & 0x7fff) == 0x7fff) { /* erfcl(nan)=nan */ + /* erfcl(+-inf)=0,2 */ + return ((hx>>15)<<1)+one/x; + } + + ax = fabsl(x); + if(ax < 0.84375L) { + if(ax < 0x1p-34L) + return one-x; + z = x*x; + r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+ + z*(pp8+z*pp9)))))))); + s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+ + z*(qq8+z*qq9)))))))); + y = r/s; + if(ax < 0.25L) { /* x<1/4 */ + return one-(x+x*y); + } else { + r = x*y; + r += (x-half); + return half - r; + } + } + if(ax < 1.25L) { + s = ax-one; + P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+ + s*(pa8+s*(pa9+s*(pa10+s*pa11)))))))))); + Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+ + s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12))))))))))); + if(x>=0) { + z = one-erx; return z - P/Q; + } else { + z = erx+P/Q; return one+z; + } + } + + if(ax < 108) { /* |x| < 108 */ + s = one/(ax*ax); + if(ax < 2.85715) { /* |x| < 2.85715 */ + R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+ + s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+ + s*(ra15+s*ra16))))))))))))))); + S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+ + s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+ + s*(sa15+s*sa16))))))))))))))); + } else if(ax < 9) { + R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+ + s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+ + s*rb14))))))))))))); + S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+ + s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+ + s*sb14))))))))))))); + } else { + if(x < -9) return two-tiny; /* x < -9 */ + R=rc0+s*(rc1+s*(rc2+s*(rc3+s*(rc4+s*(rc5+s*(rc6+s*(rc7+ + s*(rc8+s*rc9)))))))); + S=one+s*(sc1+s*(sc2+s*(sc3+s*(sc4+s*(sc5+s*(sc6+s*(sc7+ + s*(sc8+s*sc9)))))))); + } + z = (float)ax; + r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S); + if(x>0) return r/ax; else return two-r/ax; + } else { + if(x>0) return tiny*tiny; else return two-tiny; + } +} Modified: stable/10/lib/msun/ld128/s_expl.c ============================================================================== --- stable/10/lib/msun/ld128/s_expl.c Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/ld128/s_expl.c Thu Sep 18 15:10:22 2014 (r271779) @@ -38,16 +38,15 @@ __FBSDID("$FreeBSD$"); #include "fpmath.h" #include "math.h" #include "math_private.h" +#include "k_expl.h" -#define INTERVALS 128 -#define LOG2_INTERVALS 7 -#define BIAS (LDBL_MAX_EXP - 1) +/* XXX Prevent compilers from erroneously constant folding these: */ +static const volatile long double +huge = 0x1p10000L, +tiny = 0x1p-10000L; static const long double -huge = 0x1p10000L, twom10000 = 0x1p-10000L; -/* XXX Prevent gcc from erroneously constant folding this: */ -static volatile const long double tiny = 0x1p-10000L; static const long double /* log(2**16384 - 0.5) rounded towards zero: */ @@ -56,184 +55,16 @@ o_threshold = 11356.5234062941439494919 /* log(2**(-16381-64-1)) rounded towards zero: */ u_threshold = -11433.462743336297878837243843452621503L; -static const double -/* - * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must - * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest - * bits zero so that multiplication of it by n is exact. - */ -INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */ -L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */ -static const long double -/* 0x1.62e42fefa39ef35793c768000000p-8 */ -L1 = 5.41521234812457272982212595914567508e-3L; - -static const long double -/* - * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]: - * |exp(x) - p(x)| < 2**-124.9 - * (0.002708 is ln2/(2*INTERVALS) rounded up a little). - */ -A2 = 0.5, -A3 = 1.66666666666666666666666666651085500e-1L, -A4 = 4.16666666666666666666666666425885320e-2L, -A5 = 8.33333333333333333334522877160175842e-3L, -A6 = 1.38888888888888888889971139751596836e-3L; - -static const double -A7 = 1.9841269841269471e-4, -A8 = 2.4801587301585284e-5, -A9 = 2.7557324277411234e-6, -A10 = 2.7557333722375072e-7; - -static const struct { - /* - * hi must be rounded to at most 106 bits so that multiplication - * by r1 in expm1l() is exact, but it is rounded to 88 bits due to - * historical accidents. - */ - long double hi; - long double lo; -} tbl[INTERVALS] = { - 0x1p0L, 0x0p0L, - 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, - 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, - 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L, - 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L, - 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L, - 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L, - 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L, - 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L, - 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L, - 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L, - 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L, - 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L, - 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L, - 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L, - 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L, - 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L, - 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L, - 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L, - 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L, - 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L, - 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L, - 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L, - 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L, - 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L, - 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L, - 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L, - 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L, - 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L, - 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L, - 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L, - 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L, - 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L, - 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L, - 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L, - 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L, - 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L, - 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L, - 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L, - 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L, - 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L, - 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L, - 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L, - 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L, - 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L, - 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L, - 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L, - 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L, - 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L, - 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L, - 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L, - 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L, - 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L, - 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L, - 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L, - 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L, - 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L, - 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L, - 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L, - 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L, - 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L, - 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L, - 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L, - 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L, - 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L, - 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L, - 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L, - 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L, - 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L, - 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L, - 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L, - 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L, - 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L, - 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L, - 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L, - 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L, - 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L, - 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L, - 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L, - 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L, - 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L, - 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L, - 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L, - 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L, - 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L, - 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L, - 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L, - 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L, - 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L, - 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L, - 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L, - 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L, - 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L, - 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L, - 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L, - 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L, - 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L, - 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L, - 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L, - 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L, - 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L, - 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L, - 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L, - 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L, - 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L, - 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L, - 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L, - 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L, - 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L, - 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L, - 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L, - 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L, - 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L, - 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L, - 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L, - 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L, - 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L, - 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L, - 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L, - 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L, - 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L, - 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L, - 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L, - 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L, - 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L, - 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L, - 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L, - 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L -}; - long double expl(long double x) { - union IEEEl2bits u, v; - long double q, r, r1, t, twopk, twopkp10000; - double dr, fn, r2; - int k, n, n2; + union IEEEl2bits u; + long double hi, lo, t, twopk; + int k; uint16_t hx, ix; + DOPRINT_START(&x); + /* Filter out exceptional cases. */ u.e = x; hx = u.xbits.expsign; @@ -241,60 +72,33 @@ expl(long double x) if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { if (hx & 0x8000) /* x is -Inf or -NaN */ - return (-1 / x); - return (x + x); /* x is +Inf or +NaN */ + RETURNP(-1 / x); + RETURNP(x + x); /* x is +Inf or +NaN */ } if (x > o_threshold) - return (huge * huge); + RETURNP(huge * huge); if (x < u_threshold) - return (tiny * tiny); + RETURNP(tiny * tiny); } else if (ix < BIAS - 114) { /* |x| < 0x1p-114 */ - return (1 + x); /* 1 with inexact iff x != 0 */ + RETURN2P(1, x); /* 1 with inexact iff x != 0 */ } ENTERI(); - /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ - /* Use a specialized rint() to get fn. Assume round-to-nearest. */ - /* XXX assume no extra precision for the additions, as for trig fns. */ - /* XXX this set of comments is now quadruplicated. */ - fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52; -#if defined(HAVE_EFFICIENT_IRINT) - n = irint(fn); -#else - n = (int)fn; -#endif - n2 = (unsigned)n % INTERVALS; - k = n >> LOG2_INTERVALS; - r1 = x - fn * L1; - r2 = fn * -L2; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 17:03:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29B4F2CC; Thu, 18 Sep 2014 17:03:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1446F762; Thu, 18 Sep 2014 17:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IH3qKD047503; Thu, 18 Sep 2014 17:03:52 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IH3qfU047502; Thu, 18 Sep 2014 17:03:52 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409181703.s8IH3qfU047502@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 18 Sep 2014 17:03:52 +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: r271790 - stable/10/usr.sbin/bsdinstall/scripts 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 17:03:53 -0000 Author: allanjude (doc committer) Date: Thu Sep 18 17:03:52 2014 New Revision: 271790 URL: http://svnweb.freebsd.org/changeset/base/271790 Log: MFC r271563: Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet PR: 193595 Approved by: re (gjb), nwhitehorn Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Sep 18 17:01:45 2014 (r271789) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Sep 18 17:03:52 2014 (r271790) @@ -293,6 +293,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -687,6 +688,48 @@ dialog_menu_layout() return $DIALOG_OK } +# dialog_uefi_prompt +# +# Confirm that the user wants to continue with the installation on a BIOS +# system when they have booted with UEFI +# +dialog_uefi_prompt() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" + + local height=8 width=50 prefix=" " + local plen=${#prefix} list= line= + local max_width=$(( $width - 3 - $plen )) + + local yes no defaultno extra_args format + if [ "$USE_XDIALOG" ]; then + yes=ok no=cancel defaultno=default-no + extra_args="--wrap --left" + format="$msg_uefi_not_supported" + else + yes=yes no=no defaultno=defaultno + extra_args="--cr-wrap" + format="$msg_uefi_not_supported" + fi + + # Add height for Xdialog(1) + [ "$USE_XDIALOG" ] && height=$(( $height + $height / 5 + 3 )) + + prompt=$( printf "$format" ) + f_dprintf "%s: UEFI prompt" "$0" + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --$yes-label "$msg_yes" \ + --$no-label "$msg_no" \ + $extra_args \ + --yesno "$prompt" $height $width +} + # zfs_create_diskpart $disk $index # # For each block device to be used in the zpool, rather than just create the @@ -1383,6 +1426,21 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSD f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # +# If the system was booted with UEFI, warn the user that FreeBSD can't do +# ZFS with UEFI yet +# +if f_interactive; then + bootmethod=$(sysctl -n machdep.bootmethod) + f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" + if [ "$bootmethod" != "BIOS" ]; then + dialog_uefi_prompt + retval=$? + f_dprintf "uefi_prompt=[%s]" "$retval" + [ $retval -eq $DIALOG_OK ] || f_die + fi +fi + +# # Loop over the main menu until we've accomplished what we came here to do # while :; do From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 17:15:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1632B90A; Thu, 18 Sep 2014 17:15:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 00E0C88A; Thu, 18 Sep 2014 17:15:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHFdEx052571; Thu, 18 Sep 2014 17:15:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHFc09052565; Thu, 18 Sep 2014 17:15:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409181715.s8IHFc09052565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 18 Sep 2014 17:15: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: r271791 - stable/10/release/arm 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 17:15:40 -0000 Author: gjb Date: Thu Sep 18 17:15:38 2014 New Revision: 271791 URL: http://svnweb.freebsd.org/changeset/base/271791 Log: MFC r271676, r271677, r271678: r271676: Catch up with Crochet changes to fix the BEAGLEBONE build. r271677: Catch up with Crochet changes to fix the WANDBOARD-QUAD build. r271678: Set a static revision of the Crochet checkout to avoid surprise build failures. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf stable/10/release/arm/ZEDBOARD.conf stable/10/release/arm/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/BEAGLEBONE.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="BEAGLEBONE" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/PANDABOARD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="PANDABOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/RPI-B.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,7 +25,7 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="RPI-B" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" UBOOTSRC="https://github.com/gonzoua/u-boot-pi" UBOOTBRANCH="trunk" UBOOTDIR="/tmp/crochet/u-boot-rpi" Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD-QUAD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="WANDBOARD-QUAD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/ZEDBOARD.conf ============================================================================== --- stable/10/release/arm/ZEDBOARD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/ZEDBOARD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -24,6 +24,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="ZEDBOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/release.sh ============================================================================== --- stable/10/release/arm/release.sh Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/release.sh Thu Sep 18 17:15:38 2014 (r271791) @@ -44,8 +44,8 @@ before_build() { case ${KERNEL} in BEAGLEBONE) WANT_UBOOT=1 - KNOWNHASH="4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e" - UBOOT_VERSION="u-boot-2013.04" + KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" + UBOOT_VERSION="u-boot-2014.04" ;; PANDABOARD) WANT_UBOOT=1 @@ -54,8 +54,8 @@ before_build() { ;; WANDBOARD-QUAD) WANT_UBOOT=1 - KNOWNHASH="0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55" - UBOOT_VERSION="u-boot-2013.10" + KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56" + UBOOT_VERSION="u-boot-2014.07" ;; *) # Fallthrough. From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 19:20:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43CEB799; Thu, 18 Sep 2014 19:20:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 2E00A7E0; Thu, 18 Sep 2014 19:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IJK9iL009559; Thu, 18 Sep 2014 19:20:09 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IJK90l009558; Thu, 18 Sep 2014 19:20:09 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409181920.s8IJK90l009558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 18 Sep 2014 19:20: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: r271800 - stable/10/sys/dev/nmdm 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 19:20:09 -0000 Author: grehan Date: Thu Sep 18 19:20:08 2014 New Revision: 271800 URL: http://svnweb.freebsd.org/changeset/base/271800 Log: MFC nmdm driver changes, r259550 and r271350 r259550 (glebius): Make nmdm(4) destroy devices when both sides of a pair are disconnected. This makes it possible to kldunload nmdm.ko when there are no users of it. r271350: Fix issue with nmdm and leading zeros in device name. The nmdm code enforces a number between the 'nmdm' and 'A|B' portions of the device name. This is then used as a unit number, and sprintf'd back into the tty name. If leading zeros were used in the name, the created device name is different than the string used for the clone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A). Since unit numbers are no longer required with the updated tty code, there seems to be no reason to force the string to be a number. The fix is to allow an arbitrary string between 'nmdm' and 'A|B', within the constraints of devfs names. This allows all existing user of numeric strings to continue to work, and also allows more meaningful names to be used, such as bhyve VM names. PR: 192281 Approved by: re (glebius) Modified: stable/10/sys/dev/nmdm/nmdm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nmdm/nmdm.c ============================================================================== --- stable/10/sys/dev/nmdm/nmdm.c Thu Sep 18 19:15:40 2014 (r271799) +++ stable/10/sys/dev/nmdm/nmdm.c Thu Sep 18 19:20:08 2014 (r271800) @@ -58,6 +58,8 @@ static tsw_inwakeup_t nmdm_outwakeup; static tsw_outwakeup_t nmdm_inwakeup; static tsw_param_t nmdm_param; static tsw_modem_t nmdm_modem; +static tsw_close_t nmdm_close; +static tsw_free_t nmdm_free; static struct ttydevsw nmdm_class = { .tsw_flags = TF_NOPREFIX, @@ -65,6 +67,8 @@ static struct ttydevsw nmdm_class = { .tsw_outwakeup = nmdm_outwakeup, .tsw_param = nmdm_param, .tsw_modem = nmdm_modem, + .tsw_close = nmdm_close, + .tsw_free = nmdm_free, }; static void nmdm_task_tty(void *, int); @@ -94,15 +98,83 @@ struct nmdmsoftc { static int nmdm_count = 0; -static struct nmdmsoftc * -nmdm_alloc(unsigned long unit) +static void +nmdm_close(struct tty *tp) +{ + struct nmdmpart *np; + struct nmdmpart *onp; + struct tty *otp; + + np = tty_softc(tp); + onp = np->np_other; + otp = onp->np_tty; + + /* If second part is opened, do not destroy ourselves. */ + if (tty_opened(otp)) + return; + + /* Shut down self. */ + tty_rel_gone(tp); + + /* Shut down second part. */ + tty_lock(tp); + onp = np->np_other; + if (onp == NULL) + return; + otp = onp->np_tty; + tty_rel_gone(otp); + tty_lock(tp); +} + +static void +nmdm_free(void *softc) +{ + struct nmdmpart *np = (struct nmdmpart *)softc; + struct nmdmsoftc *ns = np->np_pair; + + callout_drain(&np->np_callout); + taskqueue_drain(taskqueue_swi, &np->np_task); + + /* + * The function is called on both parts simultaneously. We serialize + * with help of ns_mtx. The first invocation should return and + * delegate freeing of resources to the second. + */ + mtx_lock(&ns->ns_mtx); + if (np->np_other != NULL) { + np->np_other->np_other = NULL; + mtx_unlock(&ns->ns_mtx); + return; + } + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + atomic_subtract_int(&nmdm_count, 1); +} + +static void +nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen, + struct cdev **dev) { struct nmdmsoftc *ns; struct tty *tp; + char *end; + int error; + char endc; - atomic_add_int(&nmdm_count, 1); + if (*dev != NULL) + return; + if (strncmp(name, "nmdm", 4) != 0) + return; + if (strlen(name) <= strlen("nmdmX")) + return; + + /* Device name must be "nmdm%s%c", where %c is 'A' or 'B'. */ + end = name + strlen(name) - 1; + endc = *end; + if (endc != 'A' && endc != 'B') + return; - ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK|M_ZERO); + ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK | M_ZERO); mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); /* Hook the pairs together. */ @@ -119,43 +191,38 @@ nmdm_alloc(unsigned long unit) /* Create device nodes. */ tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1, &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luA", unit); + *end = 'A'; + error = tty_makedevf(tp, NULL, endc == 'A' ? TTYMK_CLONING : 0, + "%s", name); + if (error) { + *end = endc; + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + return; + } tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2, &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luB", unit); - - return (ns); -} - -static void -nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen, - struct cdev **dev) -{ - unsigned long unit; - char *end; - struct nmdmsoftc *ns; - - if (*dev != NULL) - return; - if (strncmp(name, "nmdm", 4) != 0) - return; - - /* Device name must be "nmdm%lu%c", where %c is 'A' or 'B'. */ - name += 4; - unit = strtoul(name, &end, 10); - if (unit == ULONG_MAX || name == end) - return; - if ((end[0] != 'A' && end[0] != 'B') || end[1] != '\0') + *end = 'B'; + error = tty_makedevf(tp, NULL, endc == 'B' ? TTYMK_CLONING : 0, + "%s", name); + if (error) { + *end = endc; + mtx_lock(&ns->ns_mtx); + /* see nmdm_free() */ + ns->ns_part1.np_other = NULL; + atomic_add_int(&nmdm_count, 1); + tty_rel_gone(ns->ns_part1.np_tty); return; + } - /* XXX: pass privileges? */ - ns = nmdm_alloc(unit); - - if (end[0] == 'A') + if (endc == 'A') *dev = ns->ns_part1.np_tty->t_dev; else *dev = ns->ns_part2.np_tty->t_dev; + + *end = endc; + atomic_add_int(&nmdm_count, 1); } static void @@ -187,6 +254,10 @@ nmdm_task_tty(void *arg, int pending __u tp = np->np_tty; tty_lock(tp); + if (tty_gone(tp)) { + tty_unlock(tp); + return; + } otp = np->np_other->np_tty; KASSERT(otp != NULL, ("NULL otp in nmdmstart")); @@ -203,6 +274,12 @@ nmdm_task_tty(void *arg, int pending __u } } + /* This may happen when we are in detach process. */ + if (tty_gone(otp)) { + tty_unlock(otp); + return; + } + while (ttydisc_rint_poll(otp) > 0) { if (np->np_rate && !np->np_quota) break; From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 20:17:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3827756; Thu, 18 Sep 2014 20:17:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C4282DCB; Thu, 18 Sep 2014 20:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKHgIb038758; Thu, 18 Sep 2014 20:17:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKHgVQ038756; Thu, 18 Sep 2014 20:17:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182017.s8IKHgVQ038756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 20:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271809 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 20:17:43 -0000 Author: asomers Date: Thu Sep 18 20:17:42 2014 New Revision: 271809 URL: http://svnweb.freebsd.org/changeset/base/271809 Log: MFC 263779, except for the ATF test change. Correct ARP update handling when the routes for network interfaces are restricted to a single FIB in a multifib system. Restricting an interface's routes to the FIB to which it is assigned (by setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve: can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard coding it's lookup for existing routing entries to FIB 0. sys/netinet/in.c: When dealing with RTM_ADD (add route) requests for an interface, use the interface's assigned FIB instead of the default (FIB 0). sys/netinet/if_ether.c: In arpresolve(), enhance error message generated when an lla_lookup() fails so that the interface causing the error is visible in logs. PR: kern/167947 Modified: stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Thu Sep 18 20:17:27 2014 (r271808) +++ stable/9/sys/netinet/if_ether.c Thu Sep 18 20:17:42 2014 (r271809) @@ -326,8 +326,8 @@ retry: if (la == NULL) { if (flags & LLE_CREATE) log(LOG_DEBUG, - "arpresolve: can't allocate llinfo for %s\n", - inet_ntoa(SIN(dst)->sin_addr)); + "arpresolve: can't allocate llinfo for %s on %s\n", + inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); m_freem(m); return (EINVAL); } Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 20:17:27 2014 (r271808) +++ stable/9/sys/netinet/in.c Thu Sep 18 20:17:42 2014 (r271809) @@ -1366,8 +1366,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1 should take a const param */ - rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); + /* XXX rtalloc1_fib should take a const param */ + rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, + ifp->if_fib); if (rt == NULL) return (EINVAL); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 20:32:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5932266A; Thu, 18 Sep 2014 20:32:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 3F95DFA9; Thu, 18 Sep 2014 20:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKWhsb048198; Thu, 18 Sep 2014 20:32:43 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKWfjk048187; Thu, 18 Sep 2014 20:32:41 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409182032.s8IKWfjk048187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 20:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271816 - in stable/10/sys: dev/drm2 dev/drm2/i915 modules/drm2/i915kms 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 20:32:43 -0000 Author: dumbbell Date: Thu Sep 18 20:32:40 2014 New Revision: 271816 URL: http://svnweb.freebsd.org/changeset/base/271816 Log: drm/i915: Add HW context support This feature is required by Mesa 9.2+. Without this, a GL application crashes with the following message: # glxinfo name of display: :0.0 Gen6+ requires Kernel 3.6 or later. Assertion failed: (ctx->Version > 0), function handle_first_current, file ../../src/mesa/main/context.c, line 1498. Abort (core dumped) Now, Mesa 10.2.4 and 10.3-rc3 works fine: # glxinfo name of display: :0 display: :0 screen: 0 direct rendering: Yes ... OpenGL renderer string: Mesa DRI Intel(R) 965GM OpenGL version string: 2.1 Mesa 10.2.4 ... The code was imported from Linux 3.8.13. This an MFC of r271705. Approved by: re (glebius) Reviewed by: kib@ Tested by: kwm@, danfe@, Henry Hu, Lundberg, Johannes , Johannes Dieterich , Lutz Bichler , Relnotes: yes Added: stable/10/sys/dev/drm2/i915/i915_gem_context.c - copied unchanged from r271705, head/sys/dev/drm2/i915/i915_gem_context.c Modified: stable/10/sys/dev/drm2/drm_gem_names.c stable/10/sys/dev/drm2/drm_gem_names.h stable/10/sys/dev/drm2/i915/i915_dma.c stable/10/sys/dev/drm2/i915/i915_drm.h stable/10/sys/dev/drm2/i915/i915_drv.c stable/10/sys/dev/drm2/i915/i915_drv.h stable/10/sys/dev/drm2/i915/i915_gem.c stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c stable/10/sys/dev/drm2/i915/i915_gem_gtt.c stable/10/sys/dev/drm2/i915/i915_irq.c stable/10/sys/dev/drm2/i915/i915_reg.h stable/10/sys/dev/drm2/i915/intel_ringbuffer.c stable/10/sys/dev/drm2/i915/intel_ringbuffer.h stable/10/sys/modules/drm2/i915kms/Makefile stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_gem_names.c ============================================================================== --- stable/10/sys/dev/drm2/drm_gem_names.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/drm_gem_names.c Thu Sep 18 20:32:40 2014 (r271816) @@ -127,6 +127,24 @@ drm_gem_find_name(struct drm_gem_names * return (arg.res); } +void * +drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name) +{ + struct drm_gem_name *n; + void *res; + + mtx_lock(&names->lock); + LIST_FOREACH(n, gem_name_hash_index(names, name), link) { + if (n->name == name) { + res = n->ptr; + mtx_unlock(&names->lock); + return (res); + } + } + mtx_unlock(&names->lock); + return (NULL); +} + int drm_gem_name_create(struct drm_gem_names *names, void *p, uint32_t *name) { Modified: stable/10/sys/dev/drm2/drm_gem_names.h ============================================================================== --- stable/10/sys/dev/drm2/drm_gem_names.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/drm_gem_names.h Thu Sep 18 20:32:40 2014 (r271816) @@ -54,6 +54,7 @@ struct drm_gem_names { void drm_gem_names_init(struct drm_gem_names *names); void drm_gem_names_fini(struct drm_gem_names *names); uint32_t drm_gem_find_name(struct drm_gem_names *names, void *ptr); +void *drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name); void *drm_gem_name_ref(struct drm_gem_names *names, uint32_t name, void (*ref)(void *)); int drm_gem_name_create(struct drm_gem_names *names, void *obj, uint32_t *name); Modified: stable/10/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_dma.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_dma.c Thu Sep 18 20:32:40 2014 (r271816) @@ -1357,6 +1357,7 @@ i915_driver_unload_int(struct drm_device DRM_LOCK(dev); i915_gem_free_all_phys_object(dev); i915_gem_cleanup_ringbuffer(dev); + i915_gem_context_fini(dev); if (!locked) DRM_UNLOCK(dev); i915_gem_cleanup_aliasing_ppgtt(dev); @@ -1413,6 +1414,8 @@ i915_driver_open(struct drm_device *dev, INIT_LIST_HEAD(&i915_file_priv->mm.request_list); file_priv->driver_priv = i915_file_priv; + drm_gem_names_init(&i915_file_priv->context_idr); + return (0); } @@ -1437,6 +1440,7 @@ i915_driver_lastclose(struct drm_device void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) { + i915_gem_context_close(dev, file_priv); i915_gem_release(dev, file_priv); } @@ -1491,6 +1495,8 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_SET_SPRITE_COLORKEY, intel_sprite_set_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_GET_SPRITE_COLORKEY, intel_sprite_get_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_CREATE, i915_gem_context_create_ioctl, DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_DESTROY, i915_gem_context_destroy_ioctl, DRM_UNLOCKED), }; #ifdef COMPAT_FREEBSD32 Modified: stable/10/sys/dev/drm2/i915/i915_drm.h ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drm.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drm.h Thu Sep 18 20:32:40 2014 (r271816) @@ -204,6 +204,8 @@ typedef struct drm_i915_sarea { #define DRM_I915_GEM_EXECBUFFER2 0x29 #define DRM_I915_GET_SPRITE_COLORKEY 0x2a #define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define DRM_I915_GEM_CONTEXT_CREATE 0x2d +#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -248,6 +250,8 @@ typedef struct drm_i915_sarea { #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) +#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) /* Asynchronous page flipping: */ @@ -702,7 +706,7 @@ struct drm_i915_gem_exec_object2 { #define EXEC_OBJECT_NEEDS_FENCE (1<<0) uint64_t flags; - uint64_t rsvd1; + uint64_t rsvd1; /* now used for context info */ uint64_t rsvd2; }; @@ -746,6 +750,12 @@ struct drm_i915_gem_execbuffer2 { /** Resets the SO write offset registers for transform feedback on gen7. */ #define I915_EXEC_GEN7_SOL_RESET (1<<8) +#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) +#define i915_execbuffer2_set_context_id(eb2, context) \ + (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK +#define i915_execbuffer2_get_context_id(eb2) \ + ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) + struct drm_i915_gem_pin { /** Handle of the buffer to be pinned. */ uint32_t handle; @@ -968,4 +978,15 @@ struct drm_intel_sprite_colorkey { uint32_t flags; }; +struct drm_i915_gem_context_create { + /* output: id of new context*/ + uint32_t ctx_id; + uint32_t pad; +}; + +struct drm_i915_gem_context_destroy { + uint32_t ctx_id; + uint32_t pad; +}; + #endif /* _I915_DRM_H_ */ Modified: stable/10/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drv.c Thu Sep 18 20:32:40 2014 (r271816) @@ -612,7 +612,7 @@ __gen6_gt_wait_for_fifo(struct drm_i915_ } static int -i8xx_do_reset(struct drm_device *dev, u8 flags) +i8xx_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int onems; @@ -657,7 +657,7 @@ i965_reset_complete(struct drm_device *d } static int -i965_do_reset(struct drm_device *dev, u8 flags) +i965_do_reset(struct drm_device *dev) { u8 gdrst; @@ -667,28 +667,30 @@ i965_do_reset(struct drm_device *dev, u8 * triggers the reset; when done, the hardware will clear it. */ gdrst = pci_read_config(dev->device, I965_GDRST, 1); - pci_write_config(dev->device, I965_GDRST, gdrst | flags | 0x1, 1); + pci_write_config(dev->device, I965_GDRST, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE, 1); return (_intel_wait_for(dev, i965_reset_complete(dev), 500, 1, "915rst")); } static int -ironlake_do_reset(struct drm_device *dev, u8 flags) +ironlake_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; u32 gdrst; dev_priv = dev->dev_private; gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); - I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | flags | 0x1); + I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); return (_intel_wait_for(dev, (I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1) != 0, 500, 1, "915rst")); } static int -gen6_do_reset(struct drm_device *dev, u8 flags) +gen6_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; int ret; @@ -726,8 +728,43 @@ gen6_do_reset(struct drm_device *dev, u8 return (ret); } +int intel_gpu_reset(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret = -ENODEV; + + switch (INTEL_INFO(dev)->gen) { + case 7: + case 6: + ret = gen6_do_reset(dev); + break; + case 5: + ret = ironlake_do_reset(dev); + break; + case 4: + ret = i965_do_reset(dev); + break; + case 2: + ret = i8xx_do_reset(dev); + break; + } + + /* Also reset the gpu hangman. */ + if (dev_priv->stop_rings) { + DRM_DEBUG("Simulated gpu hang, resetting stop_rings\n"); + dev_priv->stop_rings = 0; + if (ret == -ENODEV) { + DRM_ERROR("Reset not implemented, but ignoring " + "error for simulated gpu hangs\n"); + ret = 0; + } + } + + return ret; +} + int -i915_reset(struct drm_device *dev, u8 flags) +i915_reset(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev->dev_private; /* @@ -748,23 +785,9 @@ i915_reset(struct drm_device *dev, u8 fl ret = -ENODEV; if (time_second - dev_priv->last_gpu_reset < 5) { DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); - } else { - switch (INTEL_INFO(dev)->gen) { - case 7: - case 6: - ret = gen6_do_reset(dev, flags); - break; - case 5: - ret = ironlake_do_reset(dev, flags); - break; - case 4: - ret = i965_do_reset(dev, flags); - break; - case 2: - ret = i8xx_do_reset(dev, flags); - break; - } - } + } else + ret = intel_gpu_reset(dev); + dev_priv->last_gpu_reset = time_second; if (ret) { DRM_ERROR("Failed to reset chip.\n"); @@ -784,6 +807,7 @@ i915_reset(struct drm_device *dev, u8 fl if (HAS_BLT(dev)) dev_priv->rings[BCS].init(&dev_priv->rings[BCS]); + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); drm_irq_uninstall(dev); Modified: stable/10/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drv.h Thu Sep 18 20:32:40 2014 (r271816) @@ -174,6 +174,17 @@ struct i915_hw_ppgtt { vm_paddr_t scratch_page_dma_addr; }; + +/* This must match up with the value previously used for execbuf2.rsvd1. */ +#define DEFAULT_CONTEXT_ID 0 +struct i915_hw_context { + uint32_t id; + bool is_initialized; + struct drm_i915_file_private *file_priv; + struct intel_ring_buffer *ring; + struct drm_i915_gem_object *obj; +}; + enum no_fbc_reason { FBC_NO_OUTPUT, /* no outputs enabled to compress */ FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */ @@ -700,6 +711,8 @@ typedef struct drm_i915_private { enum no_fbc_reason no_fbc_reason; + unsigned int stop_rings; + unsigned long cfb_size; unsigned int cfb_fb; int cfb_plane; @@ -723,8 +736,16 @@ typedef struct drm_i915_private { struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; + + bool hw_contexts_disabled; + uint32_t hw_context_size; } drm_i915_private_t; +/* Iterate over initialised rings */ +#define for_each_ring(ring__, dev_priv__, i__) \ + for ((i__) = 0; (i__) < I915_NUM_RINGS; (i__)++) \ + if (((ring__) = &(dev_priv__)->rings[(i__)]), intel_ring_initialized((ring__))) + enum hdmi_force_audio { HDMI_AUDIO_OFF_DVI = -2, /* no aux data for HDMI-DVI converter */ HDMI_AUDIO_OFF, /* force turn off HDMI audio */ @@ -832,6 +853,7 @@ struct drm_i915_gem_object { unsigned int cache_level:2; unsigned int has_aliasing_ppgtt_mapping:1; + unsigned int has_global_gtt_mapping:1; vm_page_t *pages; @@ -927,6 +949,7 @@ struct drm_i915_file_private { struct list_head request_list; struct mtx lck; } mm; + struct drm_gem_names context_idr; }; struct drm_i915_error_state { @@ -1026,7 +1049,8 @@ extern int i915_enable_hangcheck; const struct intel_device_info *i915_get_device_id(int device); -int i915_reset(struct drm_device *dev, u8 flags); +extern int intel_gpu_reset(struct drm_device *dev); +int i915_reset(struct drm_device *dev); /* i915_debug.c */ int i915_sysctl_init(struct drm_device *dev, struct sysctl_ctx_list *ctx, @@ -1205,6 +1229,17 @@ void i915_gem_release(struct drm_device int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, enum i915_cache_level cache_level); +/* i915_gem_context.c */ +void i915_gem_context_init(struct drm_device *dev); +void i915_gem_context_fini(struct drm_device *dev); +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, int to_id); +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); + void i915_gem_free_all_phys_object(struct drm_device *dev); void i915_gem_detach_phys_object(struct drm_device *dev, struct drm_i915_gem_object *obj); @@ -1443,6 +1478,7 @@ __i915_write(64, 64) #define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) +#define HAS_HW_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 6) #define HAS_ALIASING_PPGTT(dev) (INTEL_INFO(dev)->gen >=6) #define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay) Modified: stable/10/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem.c Thu Sep 18 20:32:40 2014 (r271816) @@ -477,6 +477,7 @@ i915_gem_init_hw(struct drm_device *dev) } dev_priv->next_seqno = 1; + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); return (0); @@ -2584,11 +2585,16 @@ int i915_gpu_idle(struct drm_device *dev, bool do_retire) { drm_i915_private_t *dev_priv = dev->dev_private; + struct intel_ring_buffer *ring; int ret, i; /* Flush everything onto the inactive list. */ - for (i = 0; i < I915_NUM_RINGS; i++) { - ret = i915_ring_idle(&dev_priv->rings[i], do_retire); + for_each_ring(ring, dev_priv, i) { + ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID); + if (ret) + return ret; + + ret = i915_ring_idle(ring, do_retire); if (ret) return ret; } Copied: stable/10/sys/dev/drm2/i915/i915_gem_context.c (from r271705, head/sys/dev/drm2/i915/i915_gem_context.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/drm2/i915/i915_gem_context.c Thu Sep 18 20:32:40 2014 (r271816, copy of r271705, head/sys/dev/drm2/i915/i915_gem_context.c) @@ -0,0 +1,549 @@ +/* + * Copyright © 2011-2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Ben Widawsky + * + */ + +/* + * This file implements HW context support. On gen5+ a HW context consists of an + * opaque GPU object which is referenced at times of context saves and restores. + * With RC6 enabled, the context is also referenced as the GPU enters and exists + * from RC6 (GPU has it's own internal power context, except on gen5). Though + * something like a context does exist for the media ring, the code only + * supports contexts for the render ring. + * + * In software, there is a distinction between contexts created by the user, + * and the default HW context. The default HW context is used by GPU clients + * that do not request setup of their own hardware context. The default + * context's state is never restored to help prevent programming errors. This + * would happen if a client ran and piggy-backed off another clients GPU state. + * The default context only exists to give the GPU some offset to load as the + * current to invoke a save of the context we actually care about. In fact, the + * code could likely be constructed, albeit in a more complicated fashion, to + * never use the default context, though that limits the driver's ability to + * swap out, and/or destroy other contexts. + * + * All other contexts are created as a request by the GPU client. These contexts + * store GPU state, and thus allow GPU clients to not re-emit state (and + * potentially query certain state) at any time. The kernel driver makes + * certain that the appropriate commands are inserted. + * + * The context life cycle is semi-complicated in that context BOs may live + * longer than the context itself because of the way the hardware, and object + * tracking works. Below is a very crude representation of the state machine + * describing the context life. + * refcount pincount active + * S0: initial state 0 0 0 + * S1: context created 1 0 0 + * S2: context is currently running 2 1 X + * S3: GPU referenced, but not current 2 0 1 + * S4: context is current, but destroyed 1 1 0 + * S5: like S3, but destroyed 1 0 1 + * + * The most common (but not all) transitions: + * S0->S1: client creates a context + * S1->S2: client submits execbuf with context + * S2->S3: other clients submits execbuf with context + * S3->S1: context object was retired + * S3->S2: clients submits another execbuf + * S2->S4: context destroy called with current context + * S3->S5->S0: destroy path + * S4->S5->S0: destroy path on current context + * + * There are two confusing terms used above: + * The "current context" means the context which is currently running on the + * GPU. The GPU has loaded it's state already and has stored away the gtt + * offset of the BO. The GPU is not actively referencing the data at this + * offset, but it will on the next context switch. The only way to avoid this + * is to do a GPU reset. + * + * An "active context' is one which was previously the "current context" and is + * on the active list waiting for the next context switch to occur. Until this + * happens, the object must remain at the same gtt offset. It is therefore + * possible to destroy a context, but it is still active. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "i915_drv.h" + +/* This is a HW constraint. The value below is the largest known requirement + * I've seen in a spec to date, and that was a workaround for a non-shipping + * part. It should be safe to decrease this, but it's more future proof as is. + */ +#define CONTEXT_ALIGN (64<<10) + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); +static int do_switch(struct i915_hw_context *to); + +static int get_context_size(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; + u32 reg; + + switch (INTEL_INFO(dev)->gen) { + case 6: + reg = I915_READ(CXT_SIZE); + ret = GEN6_CXT_TOTAL_SIZE(reg) * 64; + break; + case 7: + reg = I915_READ(GEN7_CXT_SIZE); +#ifdef FREEBSD_WIP + if (IS_HASWELL(dev)) + ret = HSW_CXT_TOTAL_SIZE(reg) * 64; + else +#endif + ret = GEN7_CXT_TOTAL_SIZE(reg) * 64; + break; + default: + panic("i915_gem_context: Unsupported Intel GPU generation %d", + INTEL_INFO(dev)->gen); + } + + return ret; +} + +static void do_destroy(struct i915_hw_context *ctx) +{ +#if defined(INVARIANTS) + struct drm_device *dev = ctx->obj->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; +#endif + + if (ctx->file_priv) + drm_gem_names_remove(&ctx->file_priv->context_idr, ctx->id); + else + KASSERT(ctx == dev_priv->rings[RCS].default_context, + ("i915_gem_context: ctx != default_context")); + + drm_gem_object_unreference(&ctx->obj->base); + free(ctx, DRM_I915_GEM); +} + +static int +create_hw_context(struct drm_device *dev, + struct drm_i915_file_private *file_priv, + struct i915_hw_context **ret_ctx) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct i915_hw_context *ctx; + int ret, id; + + ctx = malloc(sizeof(*ctx), DRM_I915_GEM, M_NOWAIT | M_ZERO); + if (ctx == NULL) + return (-ENOMEM); + + ctx->obj = i915_gem_alloc_object(dev, dev_priv->hw_context_size); + if (ctx->obj == NULL) { + free(ctx, DRM_I915_GEM); + DRM_DEBUG_DRIVER("Context object allocated failed\n"); + return (-ENOMEM); + } + + if (INTEL_INFO(dev)->gen >= 7) { + ret = i915_gem_object_set_cache_level(ctx->obj, + I915_CACHE_LLC_MLC); + if (ret) + goto err_out; + } + + /* The ring associated with the context object is handled by the normal + * object tracking code. We give an initial ring value simple to pass an + * assertion in the context switch code. + */ + ctx->ring = &dev_priv->rings[RCS]; + + /* Default context will never have a file_priv */ + if (file_priv == NULL) { + *ret_ctx = ctx; + return (0); + } + + ctx->file_priv = file_priv; + +again: + id = 0; + ret = drm_gem_name_create(&file_priv->context_idr, ctx, &id); + if (ret == 0) + ctx->id = id; + + if (ret == -EAGAIN) + goto again; + else if (ret) + goto err_out; + + *ret_ctx = ctx; + return (0); + +err_out: + do_destroy(ctx); + return (ret); +} + +static inline bool is_default_context(struct i915_hw_context *ctx) +{ + return (ctx == ctx->ring->default_context); +} + +/** + * The default context needs to exist per ring that uses contexts. It stores the + * context state of the GPU for applications that don't utilize HW contexts, as + * well as an idle case. + */ +static int create_default_context(struct drm_i915_private *dev_priv) +{ + struct i915_hw_context *ctx; + int ret; + + DRM_LOCK_ASSERT(dev_priv->dev); + + ret = create_hw_context(dev_priv->dev, NULL, &ctx); + if (ret != 0) + return (ret); + + /* We may need to do things with the shrinker which require us to + * immediately switch back to the default context. This can cause a + * problem as pinning the default context also requires GTT space which + * may not be available. To avoid this we always pin the + * default context. + */ + dev_priv->rings[RCS].default_context = ctx; + ret = i915_gem_object_pin(ctx->obj, CONTEXT_ALIGN, false); + if (ret) + goto err_destroy; + + ret = do_switch(ctx); + if (ret) + goto err_unpin; + + DRM_DEBUG_DRIVER("Default HW context loaded\n"); + return 0; + +err_unpin: + i915_gem_object_unpin(ctx->obj); +err_destroy: + do_destroy(ctx); + return ret; +} + +void i915_gem_context_init(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + uint32_t ctx_size; + + if (!HAS_HW_CONTEXTS(dev)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + /* If called from reset, or thaw... we've been here already */ + if (dev_priv->hw_contexts_disabled || + dev_priv->rings[RCS].default_context) + return; + + ctx_size = get_context_size(dev); + dev_priv->hw_context_size = get_context_size(dev); + dev_priv->hw_context_size = roundup(dev_priv->hw_context_size, 4096); + + if (ctx_size <= 0 || ctx_size > (1<<20)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + if (create_default_context(dev_priv)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + DRM_DEBUG_DRIVER("HW context support initialized\n"); +} + +void i915_gem_context_fini(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (dev_priv->hw_contexts_disabled) + return; + + /* The only known way to stop the gpu from accessing the hw context is + * to reset it. Do this as the very last operation to avoid confusing + * other code, leading to spurious errors. */ + intel_gpu_reset(dev); + + i915_gem_object_unpin(dev_priv->rings[RCS].default_context->obj); + + do_destroy(dev_priv->rings[RCS].default_context); +} + +static int context_idr_cleanup(uint32_t id, void *p, void *data) +{ + struct i915_hw_context *ctx = p; + + KASSERT(id != DEFAULT_CONTEXT_ID, ("i915_gem_context: id == DEFAULT_CONTEXT_ID in cleanup")); + + do_destroy(ctx); + + return 0; +} + +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) +{ + struct drm_i915_file_private *file_priv = file->driver_priv; + + //DRM_LOCK(dev); /* Called from preclose(), the lock is already owned. */ + drm_gem_names_foreach(&file_priv->context_idr, context_idr_cleanup, NULL); + drm_gem_names_fini(&file_priv->context_idr); + //DRM_UNLOCK(dev); +} + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) +{ + return (struct i915_hw_context *)drm_gem_find_ptr(&file_priv->context_idr, id); +} + +static inline int +mi_set_context(struct intel_ring_buffer *ring, + struct i915_hw_context *new_context, + u32 hw_flags) +{ + int ret; + + /* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB + * invalidation prior to MI_SET_CONTEXT. On GEN6 we don't set the value + * explicitly, so we rely on the value at ring init, stored in + * itlb_before_ctx_switch. + */ + if (IS_GEN6(ring->dev) && ring->itlb_before_ctx_switch) { + ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, 0); + if (ret) + return ret; + } + + ret = intel_ring_begin(ring, 6); + if (ret) + return ret; + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_emit(ring, MI_NOOP); + intel_ring_emit(ring, MI_SET_CONTEXT); + intel_ring_emit(ring, new_context->obj->gtt_offset | + MI_MM_SPACE_GTT | + MI_SAVE_EXT_STATE_EN | + MI_RESTORE_EXT_STATE_EN | + hw_flags); + /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */ + intel_ring_emit(ring, MI_NOOP); + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_advance(ring); + + return ret; +} + +static int do_switch(struct i915_hw_context *to) +{ + struct intel_ring_buffer *ring = to->ring; + struct drm_i915_gem_object *from_obj = ring->last_context_obj; + u32 hw_flags = 0; + int ret; + + KASSERT(!(from_obj != NULL && from_obj->pin_count == 0), + ("i915_gem_context: invalid \"from\" context")); + + if (from_obj == to->obj) + return 0; + + ret = i915_gem_object_pin(to->obj, CONTEXT_ALIGN, false); + if (ret) + return ret; + + /* Clear this page out of any CPU caches for coherent swap-in/out. Note + * that thanks to write = false in this call and us not setting any gpu + * write domains when putting a context object onto the active list + * (when switching away from it), this won't block. + * XXX: We need a real interface to do this instead of trickery. */ + ret = i915_gem_object_set_to_gtt_domain(to->obj, false); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + if (!to->obj->has_global_gtt_mapping) + i915_gem_gtt_bind_object(to->obj); + + if (!to->is_initialized || is_default_context(to)) + hw_flags |= MI_RESTORE_INHIBIT; + else if (from_obj == to->obj) /* not yet expected */ + hw_flags |= MI_FORCE_RESTORE; + + ret = mi_set_context(ring, to, hw_flags); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + /* The backing object for the context is done after switching to the + * *next* context. Therefore we cannot retire the previous context until + * the next context has already started running. In fact, the below code + * is a bit suboptimal because the retiring can occur simply after the + * MI_SET_CONTEXT instead of when the next seqno has completed. + */ + if (from_obj != NULL) { + from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + i915_gem_object_move_to_active(from_obj, ring, + i915_gem_next_request_seqno(ring)); + /* As long as MI_SET_CONTEXT is serializing, ie. it flushes the + * whole damn pipeline, we don't need to explicitly mark the + * object dirty. The only exception is that the context must be + * correct in case the object gets swapped out. Ideally we'd be + * able to defer doing this until we know the object would be + * swapped, but there is no way to do that yet. + */ + from_obj->dirty = 1; + KASSERT(from_obj->ring == ring, ("i915_gem_context: from_ring != ring")); + i915_gem_object_unpin(from_obj); + + drm_gem_object_unreference(&from_obj->base); + } + + drm_gem_object_reference(&to->obj->base); + ring->last_context_obj = to->obj; + to->is_initialized = true; + + return 0; +} + +/** + * i915_switch_context() - perform a GPU context switch. + * @ring: ring for which we'll execute the context switch + * @file_priv: file_priv associated with the context, may be NULL + * @id: context id number + * @seqno: sequence number by which the new context will be switched to + * @flags: + * + * The context life cycle is simple. The context refcount is incremented and + * decremented by 1 and create and destroy. If the context is in use by the GPU, + * it will have a refoucnt > 1. This allows us to destroy the context abstract + * object while letting the normal object tracking destroy the backing BO. + */ +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, + int to_id) +{ + struct drm_i915_private *dev_priv = ring->dev->dev_private; + struct i915_hw_context *to; + + if (dev_priv->hw_contexts_disabled) + return 0; + + if (ring != &dev_priv->rings[RCS]) + return 0; + + if (to_id == DEFAULT_CONTEXT_ID) { + to = ring->default_context; + } else { + if (file == NULL) + return -EINVAL; + + to = i915_gem_context_get(file->driver_priv, to_id); + if (to == NULL) + return -ENOENT; + } + + return do_switch(to); +} + +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_gem_context_create *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + if (dev_priv->hw_contexts_disabled) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ret = create_hw_context(dev, file_priv, &ctx); + DRM_UNLOCK(dev); + if (ret != 0) + return (ret); + + args->ctx_id = ctx->id; + DRM_DEBUG_DRIVER("HW context %d created\n", args->ctx_id); + + return 0; +} + +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_gem_context_destroy *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ctx = i915_gem_context_get(file_priv, args->ctx_id); + if (!ctx) { + DRM_UNLOCK(dev); + return -ENOENT; + } + + do_destroy(ctx); + + DRM_UNLOCK(dev); + + DRM_DEBUG_DRIVER("HW context %d destroyed\n", args->ctx_id); + return 0; +} Modified: stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c Thu Sep 18 20:32:40 2014 (r271816) @@ -1130,6 +1130,7 @@ i915_gem_do_execbuffer(struct drm_device struct drm_clip_rect *cliprects = NULL; struct intel_ring_buffer *ring; vm_page_t **relocs_ma; + u32 ctx_id = i915_execbuffer2_get_context_id(*args); u32 exec_start, exec_len; u32 seqno; u32 mask; @@ -1158,6 +1159,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[VCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; case I915_EXEC_BLT: if (!HAS_BLT(dev)) { @@ -1165,6 +1171,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[BCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; default: DRM_DEBUG("execbuf with unknown ring: %d\n", @@ -1306,6 +1317,10 @@ i915_gem_do_execbuffer(struct drm_device if (ret) goto err; + ret = i915_switch_context(ring, file, ctx_id); + if (ret) + goto err; + seqno = i915_gem_next_request_seqno(ring); for (i = 0; i < I915_NUM_RINGS - 1; i++) { if (seqno < ring->sync_seqno[i]) { @@ -1461,6 +1476,7 @@ i915_gem_execbuffer(struct drm_device *d exec2.num_cliprects = args->num_cliprects; exec2.cliprects_ptr = args->cliprects_ptr; exec2.flags = I915_EXEC_RENDER; + i915_execbuffer2_set_context_id(exec2, 0); ret = i915_gem_do_execbuffer(dev, data, file, &exec2, exec2_list); if (!ret) { Modified: stable/10/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 18 20:32:40 2014 (r271816) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 20:53:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0D5F20B; Thu, 18 Sep 2014 20:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DA2152E0; Thu, 18 Sep 2014 20:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKrbKA058673; Thu, 18 Sep 2014 20:53:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKrbBa058668; Thu, 18 Sep 2014 20:53:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182053.s8IKrbBa058668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 20:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271825 - in stable/9/sys: net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 20:53:38 -0000 Author: asomers Date: Thu Sep 18 20:53:36 2014 New Revision: 271825 URL: http://svnweb.freebsd.org/changeset/base/271825 Log: MFC r264887, except for the ATF test change. Also, ifa_switch_loopback_route doesn't exist in stable/9, so the relevant change to that function went into in_scrubprefix instead. Fix host and network routes for new interfaces when net.add_addr_allfibs=0 sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. PR: kern/187549 Modified: stable/9/sys/net/if.c stable/9/sys/net/route.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/net/if.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1479,7 +1479,7 @@ ifa_add_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + error = rtrequest1_fib(RTM_ADD, &info, &rt, ifa->ifa_ifp->if_fib); if (error == 0 && rt != NULL) { RT_LOCK(rt); @@ -1511,7 +1511,7 @@ ifa_del_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + error = rtrequest1_fib(RTM_DELETE, &info, NULL, ifa->ifa_ifp->if_fib); if (error != 0) log(LOG_INFO, "ifa_del_loopback_route: deletion failed\n"); Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/net/route.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1527,7 +1527,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int } if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { - startfib = endfib = curthread->td_proc->p_fibnum; + startfib = endfib = ifa->ifa_ifp->if_fib; } else { startfib = 0; endfib = rt_numfibs - 1; Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/netinet/in.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1069,7 +1069,7 @@ in_scrubprefix(struct in_ifaddr *target, bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; - rtalloc_ign_fib(&ia_ro, 0, 0); + rtalloc_ign_fib(&ia_ro, 0, fibnum); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { RT_LOCK(ia_ro.ro_rt); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 21:48:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3EF37FD; Thu, 18 Sep 2014 21:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C338AA32; Thu, 18 Sep 2014 21:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILm62J084428; Thu, 18 Sep 2014 21:48:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILm6il084424; Thu, 18 Sep 2014 21:48:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182148.s8ILm6il084424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 21:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271840 - in stable/9/sys: net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 21:48:07 -0000 Author: asomers Date: Thu Sep 18 21:48:05 2014 New Revision: 271840 URL: http://svnweb.freebsd.org/changeset/base/271840 Log: MFC r264905 and r266860, except for the ATF parts. r266860 Fix unintended KBI change from r264905. Add _fib versions of ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior. sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum. sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise. r264905 Fix subnet and default routes on different FIBs on the same subnet. These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address. sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument. sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments. sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib. sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553. PR: kern/187550 PR: kern/187552 Modified: stable/9/sys/net/if.c stable/9/sys/net/if_var.h stable/9/sys/net/route.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/if.c Thu Sep 18 21:48:05 2014 (r271840) @@ -1628,7 +1628,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr) +ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1637,6 +1637,8 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -1656,12 +1658,19 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithdstaddr(struct sockaddr *addr) +{ + + return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS)); +} + /* * Find an interface on a specific network. If many, choice * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1681,12 +1690,14 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses - * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_RLOCK() that kept it stable - * when we move onto the next interface. + * in this address family and the requested fib. Maintain a reference + * on ifa_maybe once we find one, as we release the IF_ADDR_RLOCK() that + * kept it stable when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1768,6 +1779,13 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +{ + + return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS)); +} + /* * Find an interface address specific to an interface best matching * a given address. Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/if_var.h Thu Sep 18 21:48:05 2014 (r271840) @@ -940,7 +940,9 @@ struct ifaddr *ifa_ifwithaddr(struct soc int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); +struct ifaddr *ifa_ifwithdstaddr_fib(struct sockaddr *, int); struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet_fib(struct sockaddr *, int, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/route.c Thu Sep 18 21:48:05 2014 (r271840) @@ -553,7 +553,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { + if ((ifa = ifa_ifwithnet_fib(gateway, 0, fibnum)) == NULL) { error = ENETUNREACH; goto out; } @@ -710,7 +710,7 @@ ifa_ifwithroute_fib(int flags, struct so */ ifa = NULL; if (flags & RTF_HOST) - ifa = ifa_ifwithdstaddr(dst); + ifa = ifa_ifwithdstaddr_fib(dst, fibnum); if (ifa == NULL) ifa = ifa_ifwithaddr(gateway); } else { @@ -719,10 +719,10 @@ ifa_ifwithroute_fib(int flags, struct so * or host, the gateway may still be on the * other end of a pt to pt link. */ - ifa = ifa_ifwithdstaddr(gateway); + ifa = ifa_ifwithdstaddr_fib(gateway, fibnum); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway, 0); + ifa = ifa_ifwithnet_fib(gateway, 0, fibnum); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -836,7 +836,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { + (ifa = ifa_ifwithnet_fib(ifpaddr, 0, fibnum)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/netinet/in.c Thu Sep 18 21:48:05 2014 (r271840) @@ -968,7 +968,7 @@ in_addprefix(struct in_ifaddr *target, i { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error, fibnum; + int error; if ((flags & RTF_HOST) != 0) { prefix = target->ia_dstaddr.sin_addr; @@ -979,9 +979,8 @@ in_addprefix(struct in_ifaddr *target, i prefix.s_addr &= mask.s_addr; } - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - IN_IFADDR_RLOCK(); + /* Look for an existing address with the same prefix, mask, and fib */ TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { p = ia->ia_dstaddr.sin_addr; @@ -997,6 +996,8 @@ in_addprefix(struct in_ifaddr *target, i mask.s_addr != m.s_addr) continue; } + if (target->ia_ifp->if_fib != ia->ia_ifp->if_fib) + continue; /* * If we got a matching prefix route inserted by other @@ -1017,6 +1018,10 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); return (0); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 22:12:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB186EB7; Thu, 18 Sep 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9C6B1CB3; Thu, 18 Sep 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMCqwi097876; Thu, 18 Sep 2014 22:12:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMCqNw097875; Thu, 18 Sep 2014 22:12:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182212.s8IMCqNw097875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 22:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271842 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 22:12:52 -0000 Author: asomers Date: Thu Sep 18 22:12:52 2014 New Revision: 271842 URL: http://svnweb.freebsd.org/changeset/base/271842 Log: MFC r265092, except for the ATF bits. Fix a panic when removing an IP address from an interface, if the same address exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. PR: kern/189089 Modified: stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 22:10:49 2014 (r271841) +++ stable/9/sys/netinet/in.c Thu Sep 18 22:12:52 2014 (r271842) @@ -1051,11 +1051,9 @@ in_scrubprefix(struct in_ifaddr *target, { struct in_ifaddr *ia; struct in_addr prefix, mask, p; - int error = 0, fibnum; + int error = 0; struct sockaddr_in prefix0, mask0; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1071,9 +1069,11 @@ in_scrubprefix(struct in_ifaddr *target, (target->ia_flags & IFA_RTSELF)) { struct route ia_ro; int freeit = 0; + int fibnum; bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; + fibnum = target->ia_ifp->if_fib; rtalloc_ign_fib(&ia_ro, 0, fibnum); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { @@ -1107,6 +1107,10 @@ in_scrubprefix(struct in_ifaddr *target, } if ((target->ia_flags & IFA_ROUTE) == 0) { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 22:16:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F5FC19C; Thu, 18 Sep 2014 22:16:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 D445ACDA; Thu, 18 Sep 2014 22:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMGK4l098594; Thu, 18 Sep 2014 22:16:20 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMGKw8098593; Thu, 18 Sep 2014 22:16:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409182216.s8IMGKw8098593@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 18 Sep 2014 22:16: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: r271843 - stable/10/usr.bin/mkimg 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 22:16:21 -0000 Author: marcel Date: Thu Sep 18 22:16:20 2014 New Revision: 271843 URL: http://svnweb.freebsd.org/changeset/base/271843 Log: Fix checksum calculation: 1. Iterate over all partitions counted in the label, which can be more than the number of partitions given to mkimg(1). 2. Start the checksum from the beginning of the label; not the beginning of the bootarea. Tested with bsdlabel(8). Approved by: re@ (rodrigc) Modified: stable/10/usr.bin/mkimg/bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:12:52 2014 (r271842) +++ stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:16:20 2014 (r271843) @@ -68,7 +68,7 @@ bsd_write(lba_t imgsz, void *bootcode) struct disklabel *d; struct partition *dp; struct part *part; - int error, n; + int bsdparts, error, n; uint16_t checksum; buf = malloc(BBSIZE); @@ -80,6 +80,9 @@ bsd_write(lba_t imgsz, void *bootcode) } else memset(buf, 0, BBSIZE); + bsdparts = nparts + 1; /* Account for c partition */ + if (bsdparts < MAXPARTITIONS) + bsdparts = MAXPARTITIONS; imgsz = (lba_t)ncyls * nheads * nsecs; error = image_set_size(imgsz); if (error) { @@ -97,7 +100,7 @@ bsd_write(lba_t imgsz, void *bootcode) le32enc(&d->d_secperunit, imgsz); le16enc(&d->d_rpm, 3600); le32enc(&d->d_magic2, DISKMAGIC); - le16enc(&d->d_npartitions, (8 > nparts + 1) ? 8 : nparts + 1); + le16enc(&d->d_npartitions, bsdparts); le32enc(&d->d_bbsize, BBSIZE); dp = &d->d_partitions[RAW_PART]; @@ -110,9 +113,9 @@ bsd_write(lba_t imgsz, void *bootcode) dp->p_fstype = ALIAS_TYPE2INT(part->type); } - dp = &d->d_partitions[nparts + 1]; + dp = &d->d_partitions[bsdparts]; checksum = 0; - for (p = buf; p < (u_char *)dp; p += 2) + for (p = (void *)d; p < (u_char *)dp; p += 2) checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 22:17:47 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 821062DC; Thu, 18 Sep 2014 22:17:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 6C734CEC; Thu, 18 Sep 2014 22:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMHl7H098905; Thu, 18 Sep 2014 22:17:47 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMHloQ098904; Thu, 18 Sep 2014 22:17:47 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409182217.s8IMHloQ098904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 18 Sep 2014 22:17: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: r271844 - stable/10/contrib/openbsm/bin/auditdistd 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 22:17:47 -0000 Author: pjd Date: Thu Sep 18 22:17:46 2014 New Revision: 271844 URL: http://svnweb.freebsd.org/changeset/base/271844 Log: MFC r271577: Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg Approved by: re (gjb) Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.c Thu Sep 18 22:16:20 2014 (r271843) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.c Thu Sep 18 22:17:46 2014 (r271844) @@ -228,6 +228,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); From owner-svn-src-stable@FreeBSD.ORG Thu Sep 18 22:27:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6C47770; Thu, 18 Sep 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 96CB4DD3; Thu, 18 Sep 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMR2AA003623; Thu, 18 Sep 2014 22:27:02 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMR212003622; Thu, 18 Sep 2014 22:27:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409182227.s8IMR212003622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 18 Sep 2014 22:27: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: r271846 - stable/10/usr.bin/mkimg 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 22:27:02 -0000 Author: marcel Date: Thu Sep 18 22:27:02 2014 New Revision: 271846 URL: http://svnweb.freebsd.org/changeset/base/271846 Log: Be compatible with boot code that starts right after the disk label in the second sector by only clearing the amount of bytes needed for the disklabel in the second sector. Previously we were clearing exactly 1 sector worth of bytes and as such writing over boot code that may have been there. Since we do support more than 8 partitions, make sure to set all fields in d_partitions. For the first 8 partitions this is unneeded, but for partitioons 9 and up this compensates for the fact that we don't clear an entire sector anymore. Obviously, one cannot use more than 8 partitions when using boot code that starts right after the disk label. Relevant GRNs: 107879 - Employ unused bytes after the disklabel in the second sector. 189500 - Revert the part of change 107879 that employs the unused bytes after the disklabel in the 2nd sector for boot code. Obtained from: Juniper Networks, Inc. Approved by: re@ (gjb) Modified: stable/10/usr.bin/mkimg/bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:22:14 2014 (r271845) +++ stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:27:02 2014 (r271846) @@ -76,7 +76,7 @@ bsd_write(lba_t imgsz, void *bootcode) return (ENOMEM); if (bootcode != NULL) { memcpy(buf, bootcode, BBSIZE); - memset(buf + secsz, 0, secsz); + memset(buf + secsz, 0, sizeof(struct disklabel)); } else memset(buf, 0, BBSIZE); @@ -110,7 +110,10 @@ bsd_write(lba_t imgsz, void *bootcode) dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); le32enc(&dp->p_offset, part->block); + le32enc(&dp->p_fsize, 0); dp->p_fstype = ALIAS_TYPE2INT(part->type); + dp->p_frag = 0; + le16enc(&dp->p_cpg, 0); } dp = &d->d_partitions[bsdparts]; From owner-svn-src-stable@FreeBSD.ORG Fri Sep 19 00:03:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A01DCCEE; Fri, 19 Sep 2014 00:03:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8B85C9D1; Fri, 19 Sep 2014 00:03:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J03PoR050345; Fri, 19 Sep 2014 00:03:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J03Ph6050344; Fri, 19 Sep 2014 00:03:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409190003.s8J03Ph6050344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 19 Sep 2014 00:03:25 +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: r271848 - stable/10/sys/conf 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2014 00:03:25 -0000 Author: gjb Date: Fri Sep 19 00:03:25 2014 New Revision: 271848 URL: http://svnweb.freebsd.org/changeset/base/271848 Log: Update stable/10 to -BETA2 as part of the 10.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Sep 18 22:34:52 2014 (r271847) +++ stable/10/sys/conf/newvers.sh Fri Sep 19 00:03:25 2014 (r271848) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="BETA1" +BRANCH="BETA2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable@FreeBSD.ORG Fri Sep 19 14:48:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 448DBD91; Fri, 19 Sep 2014 14:48:57 +0000 (UTC) Received: from mail-in-05.arcor-online.net (mail-in-05.arcor-online.net [151.189.21.45]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx.arcor.de", Issuer "Thawte SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED47CCF7; Fri, 19 Sep 2014 14:48:56 +0000 (UTC) Received: from mail-in-03-z2.arcor-online.net (mail-in-03-z2.arcor-online.net [151.189.8.15]) by mx.arcor.de (Postfix) with ESMTP id DD105E3C88; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) Received: from mail-in-05.arcor-online.net (mail-in-05.arcor-online.net [151.189.21.45]) by mail-in-03-z2.arcor-online.net (Postfix) with ESMTP id D61C0562E91; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) X-Greylist: Passed host: 188.105.81.235 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-05.arcor-online.net 9C41EE3C88 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 Received: from lorvorc.mips.inka.de (dslb-188-105-081-235.188.105.pools.vodafone-ip.de [188.105.81.235]) by mail-in-05.arcor-online.net (Postfix) with ESMTPS id 9C41EE3C88; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.9/8.14.7) with ESMTP id s8JEmlnV052801; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.14.9/8.14.9/Submit) id s8JEmjlb052798; Fri, 19 Sep 2014 16:48:45 +0200 (CEST) (envelope-from naddy) From: Christian Weisgerber Message-Id: <201409191448.s8JEmjlb052798@lorvorc.mips.inka.de> To: jhay@meraka.org.za (John Hay) Subject: Re: svn commit: r269800 - stable/10/sbin/ping6 In-Reply-To: <20140915181126.GA22013@zibbi.meraka.csir.co.za> References: <53e8688f.2851.32479e23@svn.freebsd.org> <20140915181126.GA22013@zibbi.meraka.csir.co.za> Date: Fri, 19 Sep 2014 16:48:36 +0200 User-Agent: slrn/1.0.1 (FreeBSD) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, delphij@FreeBSD.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2014 14:48:57 -0000 In list.freebsd.svn.src.all, you wrote: > I have just upgraded one of my boxes to 10-stable and found one of my > scripts just hangs. I traced it to this change in ping6. If you do > "ping6 -c 3 ", ping6 will hang until you > ^C it. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193176 -- Christian "naddy" Weisgerber naddy@mips.inka.de From owner-svn-src-stable@FreeBSD.ORG Fri Sep 19 21:30:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA2FA405; Fri, 19 Sep 2014 21:30:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 A4788D6F; Fri, 19 Sep 2014 21:30:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JLUkif054183; Fri, 19 Sep 2014 21:30:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JLUjvo054179; Fri, 19 Sep 2014 21:30:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409192130.s8JLUjvo054179@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 19 Sep 2014 21:30: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: r271880 - in stable/10/sys/boot: amd64/efi efi/libefi i386/libi386 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2014 21:30:46 -0000 Author: emaste Date: Fri Sep 19 21:30:45 2014 New Revision: 271880 URL: http://svnweb.freebsd.org/changeset/base/271880 Log: MFC r271475 by ambrisko: Add support for serial and null console to UEFI boot loader. Approved by: re Modified: stable/10/sys/boot/amd64/efi/bootinfo.c stable/10/sys/boot/amd64/efi/conf.c stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/i386/libi386/comconsole.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 21:30:45 2014 (r271880) @@ -60,6 +60,7 @@ bi_getboothowto(char *kargs) { const char *sw; char *opts; + char *console; int howto, i; howto = 0; @@ -70,6 +71,14 @@ bi_getboothowto(char *kargs) howto |= howto_names[i].mask; } + console = getenv("console"); + if (console != NULL) { + if (strcmp(console, "comconsole") == 0) + howto |= RB_SERIAL; + if (strcmp(console, "nullconsole") == 0) + howto |= RB_MUTE; + } + /* Parse kargs */ if (kargs == NULL) return (howto); Modified: stable/10/sys/boot/amd64/efi/conf.c ============================================================================== --- stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 21:30:45 2014 (r271880) @@ -62,8 +62,12 @@ struct file_format *file_formats[] = { }; extern struct console efi_console; +extern struct console comconsole; +extern struct console nullconsole; struct console *consoles[] = { &efi_console, + &comconsole, + &nullconsole, NULL }; Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 21:30:45 2014 (r271880) @@ -5,6 +5,8 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.PATH: ${.CURDIR}/../../i386/libi386 +SRCS+= nullconsole.c comconsole.c .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC @@ -16,6 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common +CFLAGS+= -DNO_PCI + # Suppress warning from clang for FreeBSD %b and %D formats CFLAGS+= -fformat-extensions Modified: stable/10/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 21:30:45 2014 (r271880) @@ -214,6 +214,9 @@ comc_port_set(struct env_var *ev, int fl static uint32_t comc_parse_pcidev(const char *string) { +#ifdef NO_PCI + return (0); +#else char *p, *p1; uint8_t bus, dev, func, bar; uint32_t locator; @@ -247,11 +250,15 @@ comc_parse_pcidev(const char *string) locator = (bar << 16) | biospci_locator(bus, dev, func); return (locator); +#endif } static int comc_pcidev_handle(uint32_t locator) { +#ifdef NO_PCI + return (CMD_ERROR); +#else char intbuf[64]; uint32_t port; @@ -275,6 +282,7 @@ comc_pcidev_handle(uint32_t locator) comc_locator = locator; return (CMD_OK); +#endif } static int From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 07:59:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53B6C38B; Sat, 20 Sep 2014 07:59:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 24A47B98; Sat, 20 Sep 2014 07:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K7xZap046684; Sat, 20 Sep 2014 07:59:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K7xZEm046683; Sat, 20 Sep 2014 07:59:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200759.s8K7xZEm046683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 07:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271896 - stable/10/sys/dev/usb/serial 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 07:59:35 -0000 Author: hselasky Date: Sat Sep 20 07:59:34 2014 New Revision: 271896 URL: http://svnweb.freebsd.org/changeset/base/271896 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Approved by: re, gjb Modified: stable/10/sys/dev/usb/serial/u3g.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Sat Sep 20 06:34:34 2014 (r271895) +++ stable/10/sys/dev/usb/serial/u3g.c Sat Sep 20 07:59:34 2014 (r271896) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -153,6 +155,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -1012,14 +1015,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 08:01:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 226954F3; Sat, 20 Sep 2014 08:01:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E7AD0C2C; Sat, 20 Sep 2014 08:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K81oJf048719; Sat, 20 Sep 2014 08:01:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K81o3P048718; Sat, 20 Sep 2014 08:01:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200801.s8K81o3P048718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 08:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271897 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 08:01:51 -0000 Author: hselasky Date: Sat Sep 20 08:01:50 2014 New Revision: 271897 URL: http://svnweb.freebsd.org/changeset/base/271897 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Modified: stable/9/sys/dev/usb/serial/u3g.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Sat Sep 20 07:59:34 2014 (r271896) +++ stable/9/sys/dev/usb/serial/u3g.c Sat Sep 20 08:01:50 2014 (r271897) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -153,6 +155,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -1013,14 +1016,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 08:03:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADBD632; Sat, 20 Sep 2014 08:03:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AB87BC35; Sat, 20 Sep 2014 08:03:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K83FhU050893; Sat, 20 Sep 2014 08:03:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K83FLk050892; Sat, 20 Sep 2014 08:03:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200803.s8K83FLk050892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271898 - stable/8/sys/dev/usb/serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 08:03:16 -0000 Author: hselasky Date: Sat Sep 20 08:03:15 2014 New Revision: 271898 URL: http://svnweb.freebsd.org/changeset/base/271898 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Modified: stable/8/sys/dev/usb/serial/u3g.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sat Sep 20 08:01:50 2014 (r271897) +++ stable/8/sys/dev/usb/serial/u3g.c Sat Sep 20 08:03:15 2014 (r271898) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -151,6 +153,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -987,14 +990,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 12:59:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B195CF8A; Sat, 20 Sep 2014 12:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 826708B2; Sat, 20 Sep 2014 12:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KCxSBL085721; Sat, 20 Sep 2014 12:59:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KCxSs1085720; Sat, 20 Sep 2014 12:59:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409201259.s8KCxSs1085720@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 20 Sep 2014 12:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271902 - stable/9/usr.bin/pathchk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 12:59:28 -0000 Author: jilles Date: Sat Sep 20 12:59:28 2014 New Revision: 271902 URL: http://svnweb.freebsd.org/changeset/base/271902 Log: MFC r256800: pathchk: Ensure bytes >= 128 are considered non-portable characters. This was not broken on architectures such as ARM where char is unsigned. Also, remove the first non-portable character from the output. POSIX does not require this, and printing the first byte may yield an invalid byte sequence with UTF-8. PR: 165988 Reported by: Nicolas Rachinsky Relnotes: yes Modified: stable/9/usr.bin/pathchk/pathchk.c Directory Properties: stable/9/usr.bin/pathchk/ (props changed) Modified: stable/9/usr.bin/pathchk/pathchk.c ============================================================================== --- stable/9/usr.bin/pathchk/pathchk.c Sat Sep 20 09:18:58 2014 (r271901) +++ stable/9/usr.bin/pathchk/pathchk.c Sat Sep 20 12:59:28 2014 (r271902) @@ -98,7 +98,7 @@ check(const char *path) { struct stat sb; long complen, namemax, pathmax, svnamemax; - int badch, last; + int last; char *end, *p, *pathd; if ((pathd = strdup(path)) == NULL) @@ -142,9 +142,9 @@ check(const char *path) goto bad; } - if (pflag && (badch = portable(p)) >= 0) { + if (pflag && !portable(p)) { warnx("%s: %s: component contains non-portable " - "character `%c'", path, p, badch); + "character", path, p); goto bad; } @@ -183,8 +183,7 @@ bad: free(pathd); } /* - * Check whether a path component contains only portable characters. Return - * the first non-portable character found. + * Check whether a path component contains only portable characters. */ static int portable(const char *path) @@ -197,7 +196,7 @@ portable(const char *path) s = strspn(path, charset); if (path[s] != '\0') - return (path[s]); + return (0); - return (-1); + return (1); } From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 13:46:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EEE4B23; Sat, 20 Sep 2014 13:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 69CC0CA8; Sat, 20 Sep 2014 13:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KDkH1k009166; Sat, 20 Sep 2014 13:46:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KDkHCs009165; Sat, 20 Sep 2014 13:46:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409201346.s8KDkHCs009165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Sep 2014 13:46: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: r271903 - 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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 13:46:17 -0000 Author: mav Date: Sat Sep 20 13:46:16 2014 New Revision: 271903 URL: http://svnweb.freebsd.org/changeset/base/271903 Log: MFC r271700: Fix typo in defined ROD types in r269497. Approved by: re (gjb) Modified: stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sat Sep 20 12:59:28 2014 (r271902) +++ stable/10/sys/cam/scsi/scsi_all.h Sat Sep 20 13:46:16 2014 (r271903) @@ -1608,11 +1608,11 @@ struct scsi_token { uint8_t type[4]; #define ROD_TYPE_INTERNAL 0x00000000 -#define ROD_TYPE_AUR 0x00001000 -#define ROD_TYPE_PIT_DEF 0x00080000 -#define ROD_TYPE_PIT_VULN 0x00080001 -#define ROD_TYPE_PIT_PERS 0x00080002 -#define ROD_TYPE_PIT_ANY 0x0008FFFF +#define ROD_TYPE_AUR 0x00010000 +#define ROD_TYPE_PIT_DEF 0x00800000 +#define ROD_TYPE_PIT_VULN 0x00800001 +#define ROD_TYPE_PIT_PERS 0x00800002 +#define ROD_TYPE_PIT_ANY 0x0080FFFF #define ROD_TYPE_BLOCK_ZERO 0xFFFF0001 uint8_t reserved[2]; uint8_t length[2]; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 13:48:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D013AC81; Sat, 20 Sep 2014 13:48:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 BB154CBF; Sat, 20 Sep 2014 13:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KDmqBe009530; Sat, 20 Sep 2014 13:48:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KDmqBs009529; Sat, 20 Sep 2014 13:48:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409201348.s8KDmqBs009529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Sep 2014 13:48:52 +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: r271904 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 13:48:52 -0000 Author: mav Date: Sat Sep 20 13:48:52 2014 New Revision: 271904 URL: http://svnweb.freebsd.org/changeset/base/271904 Log: MFC r271702: Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as Identification Descriptor. Approved by: re (gjb) Modified: stable/10/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Sat Sep 20 13:46:16 2014 (r271903) +++ stable/10/sys/cam/ctl/ctl_tpc.c Sat Sep 20 13:48:52 2014 (r271904) @@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, st { static int id = 0; struct scsi_vpd_id_descriptor *idd = NULL; + struct scsi_ec_cscd_id *cscd; int targid_len; scsi_ulto4b(ROD_TYPE_AUR, token->type); @@ -1824,8 +1825,12 @@ tpc_create_token(struct ctl_lun *lun, st idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *) lun->lun_devid->data, lun->lun_devid->len, scsi_devid_is_lun_eui64); - if (idd != NULL) - memcpy(&token->body[8], idd, 4 + idd->length); + if (idd != NULL) { + cscd = (struct scsi_ec_cscd_id *)&token->body[8]; + cscd->type_code = EC_CSCD_ID; + cscd->luidt_pdt = T_DIRECT; + memcpy(&cscd->codeset, idd, 4 + idd->length); + } scsi_u64to8b(0, &token->body[40]); scsi_u64to8b(len, &token->body[48]); if (port->target_devid) { From owner-svn-src-stable@FreeBSD.ORG Sat Sep 20 14:24:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3598F88C; Sat, 20 Sep 2014 14:24:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 14D98A6; Sat, 20 Sep 2014 14:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KEOmve028023; Sat, 20 Sep 2014 14:24:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KEOmXZ028021; Sat, 20 Sep 2014 14:24:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409201424.s8KEOmXZ028021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Sep 2014 14:24:48 +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: r271905 - in stable/10/sys: amd64/amd64 i386/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@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2014 14:24:49 -0000 Author: kib Date: Sat Sep 20 14:24:48 2014 New Revision: 271905 URL: http://svnweb.freebsd.org/changeset/base/271905 Log: MFC r271716: Presence of any VM_PROT bits in the permission argument on x86 implies that the entry is readable and valid. Approved by: re (gjb) Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Sep 20 13:48:52 2014 (r271904) +++ stable/10/sys/amd64/amd64/pmap.c Sat Sep 20 14:24:48 2014 (r271905) @@ -3845,7 +3845,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Sat Sep 20 13:48:52 2014 (r271904) +++ stable/10/sys/i386/i386/pmap.c Sat Sep 20 14:24:48 2014 (r271905) @@ -3161,7 +3161,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; }