From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:05:46 2013 Return-Path: Delivered-To: svn-src-all@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 851C6410 for ; Sun, 15 Dec 2013 03:05:46 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB6CA1276 for ; Sun, 15 Dec 2013 03:05:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBF35ZoN036666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 15 Dec 2013 07:05:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBF35Z7x036665; Sun, 15 Dec 2013 07:05:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 15 Dec 2013 07:05:35 +0400 From: Gleb Smirnoff To: Anton Yuzhaninov Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe Message-ID: <20131215030535.GC29088@glebius.int.ru> References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> <52A76BBE.5030903@FreeBSD.org> <52A840D4.9020407@citrin.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52A840D4.9020407@citrin.ru> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:05:46 -0000 Anton, On Wed, Dec 11, 2013 at 02:39:16PM +0400, Anton Yuzhaninov wrote: A> On 12/10/13 23:30, Alexander Motin wrote: A> >> A> New Revision: 259150 A> >> A> URL: http://svnweb.freebsd.org/changeset/base/259150 A> >> A> A> >> A> Log: A> >> A> Print out the full PCIe link negotiation during dmesg. A> >> A> >> Shouldn't this be done with common code for all drivers A> >> on PCI bus(es)? A> >> A> >> This is definitely useful for all devices, not to cxgbe(4) only. A> > A> > Why not just read `pciconf -lc` output for that? A> A> 1. pciconf output is cryptic. At least units of measurement should be added. A> A> e. g. current output: A> A> cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link x4(x4) A> speed 5.0(5.0) ASPM disabled(L0s/L1) A> A> better to print like: A> A> cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link width x4(x4) A> speed 5.0 GT/s (5.0 GT/s) ASPM disabled(L0s/L1) A> A> 2. It is not obvious for system administrators, that pciconf should be used to A> inquire link speed. This feature is not documented in handbook or man pages. A> A> 3. I agree, that adding more noise to dmesg is not good, but if current A> bandwidth is not enough for optimal work of the device - error should be printed A> in dmesg. A> A> Example can be found in sys/dev/ixgbe/ixgbe.c A> A> if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && A> (hw->bus.speed == ixgbe_bus_speed_2500)) { A> device_printf(dev, "PCI-Express bandwidth available" A> " for this card\n is not sufficient for" A> " optimal performance.\n"); A> device_printf(dev, "For optimal performance a x8 " A> "PCIE, or x4 PCIE 2 slot is required.\n"); A> } A> A> 4. Similar speed check will be useful for many devices, not only for ixgbe or A> cxgbe and should be done in some generic way. I think, that if you submit patches, that implement above features, someone will take them and commit :) -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:20:02 2013 Return-Path: Delivered-To: svn-src-all@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 6432E557; Sun, 15 Dec 2013 03:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49D46130A; Sun, 15 Dec 2013 03:20:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF3K29T098175; Sun, 15 Dec 2013 03:20:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF3K1Lg098153; Sun, 15 Dec 2013 03:20:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312150320.rBF3K1Lg098153@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 03:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259402 - in releng/10.0/usr.sbin: bsdconfig/share bsdinstall bsdinstall/scripts X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:20:02 -0000 Author: gjb Date: Sun Dec 15 03:20:01 2013 New Revision: 259402 URL: http://svnweb.freebsd.org/changeset/base/259402 Log: MFC r259113, r259115, r259144, r259148: r259113 (dteske): Fix failed attempt to send pkg(8) stderr to /dev/null r259115 (dteske): Prevent truncating /tmp/bsdinstall_log each time we exec a module. r259144 (dteske): Fix a regression after successfully installing to encrypted ZFS root, the passphrase is not accepted and a message about "incorrect key" is displayed. r259148 (dteske): Fix a regression resulting in mountroot prompt after attempting to install to encrypted ZFS root (caused by a typo in a variable name -- ZFSBOOT_BOOT_FSNAME -> ZFSBOOT_BOOTFS_NAME). Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/usr.sbin/bsdconfig/share/common.subr releng/10.0/usr.sbin/bsdinstall/bsdinstall releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- releng/10.0/usr.sbin/bsdconfig/share/common.subr Sat Dec 14 22:43:30 2013 (r259401) +++ releng/10.0/usr.sbin/bsdconfig/share/common.subr Sun Dec 15 03:20:01 2013 (r259402) @@ -64,8 +64,8 @@ export UNAME_M="$(uname -m)" # Machine p export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) if [ ! "${PKG_ABI+set}" ]; then export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv | - awk '$1=="ABI"{print $3;exit}' 2> /dev/null + ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | + awk '$1=="ABI"{print $3;exit}' )" fi Modified: releng/10.0/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/bsdinstall Sat Dec 14 22:43:30 2013 (r259401) +++ releng/10.0/usr.sbin/bsdinstall/bsdinstall Sun Dec 15 03:20:01 2013 (r259402) @@ -33,6 +33,7 @@ # re-processing of flags (all children log to the parent's log file). # export DEBUG_SELF_INITIALIZE= +export DEBUG_INITIALIZE_FILE= BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 Modified: releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Sat Dec 14 22:43:30 2013 (r259401) +++ releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Sun Dec 15 03:20:01 2013 (r259402) @@ -1190,7 +1190,7 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOT_FSNAME"' \ + '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE f_dprintf "$funcname: disks=[%s]" "$disks" for disk in $disks; do @@ -1203,7 +1203,7 @@ zfs_create_boot() return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart"' \ + '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:22:00 2013 Return-Path: Delivered-To: svn-src-all@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 44D3269A; Sun, 15 Dec 2013 03:22:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 319C0135B; Sun, 15 Dec 2013 03:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF3M0DO000853; Sun, 15 Dec 2013 03:22:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF3M0O6000811; Sun, 15 Dec 2013 03:22:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312150322.rBF3M0O6000811@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 03:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259403 - releng/10.0/release X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:22:00 -0000 Author: gjb Date: Sun Dec 15 03:21:59 2013 New Revision: 259403 URL: http://svnweb.freebsd.org/changeset/base/259403 Log: MFC r256430, r259400: r256430: Reduce disc1.iso image size by installing the userland with the WITHOUT_PROFILE=1 option set, trimming 56MB from the image. r259400: Reduce disc1.iso size by 74MB by removing lib32 libraries, sendmail, and atf. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/release/Makefile Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/release/Makefile ============================================================================== --- releng/10.0/release/Makefile Sun Dec 15 03:20:01 2013 (r259402) +++ releng/10.0/release/Makefile Sun Dec 15 03:21:59 2013 (r259403) @@ -137,7 +137,8 @@ system: packagesystem # Install system mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 + DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:31:37 2013 Return-Path: Delivered-To: svn-src-all@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 5974883B; Sun, 15 Dec 2013 03:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4602613D7; Sun, 15 Dec 2013 03:31:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF3VbaO004285; Sun, 15 Dec 2013 03:31:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF3VbX9004284; Sun, 15 Dec 2013 03:31:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312150331.rBF3VbX9004284@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 03:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259404 - releng/10.0/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:31:37 -0000 Author: gjb Date: Sun Dec 15 03:31:36 2013 New Revision: 259404 URL: http://svnweb.freebsd.org/changeset/base/259404 Log: Update releng/10.0 to -RC2 as part of the 10.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/sys/conf/newvers.sh Modified: releng/10.0/sys/conf/newvers.sh ============================================================================== --- releng/10.0/sys/conf/newvers.sh Sun Dec 15 03:21:59 2013 (r259403) +++ releng/10.0/sys/conf/newvers.sh Sun Dec 15 03:31:36 2013 (r259404) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="RC1" +BRANCH="RC2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:47:35 2013 Return-Path: Delivered-To: svn-src-all@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 8BF62B7C; Sun, 15 Dec 2013 03:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7399C14D2; Sun, 15 Dec 2013 03:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF3lZsl008393; Sun, 15 Dec 2013 03:47:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF3lWNJ008373; Sun, 15 Dec 2013 03:47:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312150347.rBF3lWNJ008373@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 15 Dec 2013 03:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259405 - in stable/10: contrib/gcc contrib/gcc/cp contrib/gcc/doc contrib/gcclibs/libcpp contrib/gcclibs/libcpp/include contrib/libstdc++/include/ext gnu/usr.bin/cc/cc_int gnu/usr.bin/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:47:35 -0000 Author: pfg Date: Sun Dec 15 03:47:31 2013 New Revision: 259405 URL: http://svnweb.freebsd.org/changeset/base/259405 Log: MFC rr258501, r258507; gcc: Bring updates from Google's enhanced gcc-4.2.1. Google released and enhanced version of gcc-4.2.1 plus their local patches for Android[1]. The patches are owned by Google and the license hasn't been changed from the original GPLv2. We are only bringing a subset of the available patches that may be helpful in FreeBSD, in other words, changes specific to android are not included. From the README.google file[1]. Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1: gcc/Makefile.in gcc/c-common.c gcc/c-common.h gcc/c-opts.c gcc/c-typeck.c gcc/cp/typeck.c gcc/doc/invoke.texi gcc/flags.h gcc/opts.c gcc/tree-flow.h gcc/tree-ssa-alias-warnings.c gcc/tree-ssa-alias.c Backport of -Wstrict-aliasing from mainline. Silvius Rus gcc/coverage.c: Patch coverage_checksum_string for PR 25351. Seongbae Park Not yet submitted to FSF. gcc/c-opts.c gcc/c-ppoutput.c gcc/c.opt gcc/doc/cppopts.texi libcpp/Makefile.in libcpp/directives-only.c libcpp/directives.c libcpp/files.c libcpp/include/cpplib.h libcpp/init.c libcpp/internal.h libcpp/macro.c Support for -fdirectives-only. Ollie Wild . Submitted to FSF but not yet approved. libstdc++-v3/include/ext/hashtable.h http://b/742065 http://b/629994 Reduce min size of hashtable for hash_map, hash_set from 53 to 5 libstdc++-v3/include/ext/hashtable.h http://b/629994 Do not iterate over buckets if hashtable is empty. gcc/common.opt gcc/doc/invoke.texi gcc/flags.h gcc/gimplify.c gcc/opts.c Add Saito's patch for -finstrument-functions-exclude-* options. gcc/common.opt gcc/doc/invoke.texi gcc/final.c gcc/flags.h gcc/opts.c gcc/testsuite/gcc.dg/Wframe-larger-than.c Add a new flag -Wframe-larger-than- which enables a new warning when a frame size of a function is larger than specified. This patch hasn't been integrated into gcc mainline yet. gcc/tree-vrp.c Add a hack to avoid using ivopts information for pointers starting at constant values. Reference: [1] https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/ Obtained from: Google Inc. Added: stable/10/contrib/gcc/tree-ssa-alias-warnings.c - copied unchanged from r258501, head/contrib/gcc/tree-ssa-alias-warnings.c stable/10/contrib/gcclibs/libcpp/directives-only.c - copied unchanged from r258501, head/contrib/gcclibs/libcpp/directives-only.c Modified: stable/10/contrib/gcc/c-common.c stable/10/contrib/gcc/c-common.h stable/10/contrib/gcc/c-opts.c stable/10/contrib/gcc/c-ppoutput.c stable/10/contrib/gcc/c-typeck.c stable/10/contrib/gcc/c.opt stable/10/contrib/gcc/common.opt stable/10/contrib/gcc/coverage.c stable/10/contrib/gcc/cp/typeck.c stable/10/contrib/gcc/doc/cppopts.texi stable/10/contrib/gcc/doc/invoke.texi stable/10/contrib/gcc/final.c stable/10/contrib/gcc/flags.h stable/10/contrib/gcc/gimplify.c stable/10/contrib/gcc/opts.c stable/10/contrib/gcc/tree-flow.h stable/10/contrib/gcc/tree-ssa-alias.c stable/10/contrib/gcc/tree-vrp.c stable/10/contrib/gcclibs/libcpp/Makefile.in stable/10/contrib/gcclibs/libcpp/directives.c stable/10/contrib/gcclibs/libcpp/files.c stable/10/contrib/gcclibs/libcpp/include/cpplib.h stable/10/contrib/gcclibs/libcpp/init.c stable/10/contrib/gcclibs/libcpp/internal.h stable/10/contrib/gcclibs/libcpp/macro.c stable/10/contrib/libstdc++/include/ext/hashtable.h stable/10/gnu/usr.bin/cc/cc_int/Makefile stable/10/gnu/usr.bin/cc/libcpp/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/c-common.c ============================================================================== --- stable/10/contrib/gcc/c-common.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c-common.c Sun Dec 15 03:47:31 2013 (r259405) @@ -983,35 +983,67 @@ unsigned_conversion_warning (tree result strict aliasing mode is in effect. OTYPE is the original TREE_TYPE of EXPR, and TYPE the type we're casting to. */ -void +bool strict_aliasing_warning (tree otype, tree type, tree expr) { - if (flag_strict_aliasing && warn_strict_aliasing - && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype) - && TREE_CODE (expr) == ADDR_EXPR + if (!(flag_strict_aliasing && POINTER_TYPE_P (type) + && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type)))) + return false; + + if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR && (DECL_P (TREE_OPERAND (expr, 0)) - || handled_component_p (TREE_OPERAND (expr, 0))) - && !VOID_TYPE_P (TREE_TYPE (type))) + || handled_component_p (TREE_OPERAND (expr, 0)))) { /* Casting the address of an object to non void pointer. Warn if the cast breaks type based aliasing. */ - if (!COMPLETE_TYPE_P (TREE_TYPE (type))) - warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " - "might break strict-aliasing rules"); + if (!COMPLETE_TYPE_P (TREE_TYPE (type)) && warn_strict_aliasing == 2) + { + warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " + "might break strict-aliasing rules"); + return true; + } else { - HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); + /* warn_strict_aliasing >= 3. This includes the default (3). + Only warn if the cast is dereferenced immediately. */ + HOST_WIDE_INT set1 = + get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); if (!alias_sets_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer will break strict-aliasing rules"); - else if (warn_strict_aliasing > 1 - && !alias_sets_might_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer might break strict-aliasing rules"); + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer will break strict-aliasing rules"); + return true; + } + else if (warn_strict_aliasing == 2 + && !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } } } + else + if ((warn_strict_aliasing == 1) && !VOID_TYPE_P (TREE_TYPE (otype))) + { + /* At this level, warn for any conversions, even if an address is + not taken in the same statement. This will likely produce many + false positives, but could be useful to pinpoint problems that + are not revealed at higher levels. */ + HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (otype)); + HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); + if (!COMPLETE_TYPE_P(type) + || !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } + } + + return false; } @@ -3108,6 +3140,85 @@ def_fn_type (builtin_type def, builtin_t builtin_types[def] = t; } +/* Build builtin functions common to both C and C++ language + frontends. */ + +static void +c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node) +{ +#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ + builtin_types[ENUM] = VALUE; +#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 0, 0); +#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 0, 1, ARG1); +#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6) \ + def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); +#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6, ARG7) \ + def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); +#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 1, 0); +#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 1, 1, ARG1); +#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_POINTER_TYPE(ENUM, TYPE) \ + builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); + +#include "builtin-types.def" + +#undef DEF_PRIMITIVE_TYPE +#undef DEF_FUNCTION_TYPE_1 +#undef DEF_FUNCTION_TYPE_2 +#undef DEF_FUNCTION_TYPE_3 +#undef DEF_FUNCTION_TYPE_4 +#undef DEF_FUNCTION_TYPE_5 +#undef DEF_FUNCTION_TYPE_6 +#undef DEF_FUNCTION_TYPE_VAR_0 +#undef DEF_FUNCTION_TYPE_VAR_1 +#undef DEF_FUNCTION_TYPE_VAR_2 +#undef DEF_FUNCTION_TYPE_VAR_3 +#undef DEF_FUNCTION_TYPE_VAR_4 +#undef DEF_FUNCTION_TYPE_VAR_5 +#undef DEF_POINTER_TYPE + builtin_types[(int) BT_LAST] = NULL_TREE; + + c_init_attributes (); + +#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ + NONANSI_P, ATTRS, IMPLICIT, COND) \ + if (NAME && COND) \ + def_builtin_1 (ENUM, NAME, CLASS, \ + builtin_types[(int) TYPE], \ + builtin_types[(int) LIBTYPE], \ + BOTH_P, FALLBACK_P, NONANSI_P, \ + built_in_attributes[(int) ATTRS], IMPLICIT); +#include "builtins.def" +#undef DEF_BUILTIN + + build_common_builtin_nodes (); + + targetm.init_builtins (); + if (flag_mudflap) + mudflap_init (); +} + /* Build tree nodes and builtin functions common to both C and C++ language frontends. */ @@ -3320,77 +3431,8 @@ c_common_nodes_and_builtins (void) va_list_ref_type_node = build_reference_type (va_list_type_node); } -#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ - builtin_types[ENUM] = VALUE; -#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 0, 0); -#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 0, 1, ARG1); -#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6) \ - def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); -#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6, ARG7) \ - def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); -#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 1, 0); -#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 1, 1, ARG1); -#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_POINTER_TYPE(ENUM, TYPE) \ - builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); - -#include "builtin-types.def" - -#undef DEF_PRIMITIVE_TYPE -#undef DEF_FUNCTION_TYPE_1 -#undef DEF_FUNCTION_TYPE_2 -#undef DEF_FUNCTION_TYPE_3 -#undef DEF_FUNCTION_TYPE_4 -#undef DEF_FUNCTION_TYPE_5 -#undef DEF_FUNCTION_TYPE_6 -#undef DEF_FUNCTION_TYPE_VAR_0 -#undef DEF_FUNCTION_TYPE_VAR_1 -#undef DEF_FUNCTION_TYPE_VAR_2 -#undef DEF_FUNCTION_TYPE_VAR_3 -#undef DEF_FUNCTION_TYPE_VAR_4 -#undef DEF_FUNCTION_TYPE_VAR_5 -#undef DEF_POINTER_TYPE - builtin_types[(int) BT_LAST] = NULL_TREE; - - c_init_attributes (); - -#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ - NONANSI_P, ATTRS, IMPLICIT, COND) \ - if (NAME && COND) \ - def_builtin_1 (ENUM, NAME, CLASS, \ - builtin_types[(int) TYPE], \ - builtin_types[(int) LIBTYPE], \ - BOTH_P, FALLBACK_P, NONANSI_P, \ - built_in_attributes[(int) ATTRS], IMPLICIT); -#include "builtins.def" -#undef DEF_BUILTIN - - build_common_builtin_nodes (); - - targetm.init_builtins (); - if (flag_mudflap) - mudflap_init (); + if (!flag_preprocess_only) + c_define_builtins (va_list_ref_type_node, va_list_arg_type_node); main_identifier_node = get_identifier ("main"); Modified: stable/10/contrib/gcc/c-common.h ============================================================================== --- stable/10/contrib/gcc/c-common.h Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c-common.h Sun Dec 15 03:47:31 2013 (r259405) @@ -654,7 +654,7 @@ extern void binary_op_error (enum tree_c extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); -extern void strict_aliasing_warning(tree, tree, tree); +extern bool strict_aliasing_warning (tree, tree, tree); extern void empty_body_warning (tree, tree); extern tree convert_and_check (tree, tree); extern void overflow_warning (tree); Modified: stable/10/contrib/gcc/c-opts.c ============================================================================== --- stable/10/contrib/gcc/c-opts.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c-opts.c Sun Dec 15 03:47:31 2013 (r259405) @@ -396,7 +396,7 @@ c_common_handle_option (size_t scode, co if (c_dialect_cxx ()) warn_sign_compare = value; warn_switch = value; - warn_strict_aliasing = value; + set_warn_strict_aliasing (value); warn_strict_overflow = value; warn_address = value; @@ -606,6 +606,10 @@ c_common_handle_option (size_t scode, co disable_builtin_function (arg); break; + case OPT_fdirectives_only: + cpp_opts->directives_only = 1; + break; + case OPT_fdollars_in_identifiers: cpp_opts->dollars_in_ident = value; break; @@ -1329,6 +1333,11 @@ sanitize_cpp_opts (void) if (flag_dump_macros == 'M') flag_no_output = 1; + /* By default, -fdirectives-only implies -dD. This allows subsequent phases + to perform proper macro expansion. */ + if (cpp_opts->directives_only && !cpp_opts->preprocessed && !flag_dump_macros) + flag_dump_macros = 'D'; + /* Disable -dD, -dN and -dI if normal output is suppressed. Allow -dM since at least glibc relies on -M -dM to work. */ /* Also, flag_no_output implies flag_no_line_commands, always. */ @@ -1359,6 +1368,14 @@ sanitize_cpp_opts (void) actually output the current directory? */ if (flag_working_directory == -1) flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE); + + if (cpp_opts->directives_only) + { + if (warn_unused_macros) + error ("-fdirectives-only is incompatible with -Wunused_macros"); + if (cpp_opts->traditional) + error ("-fdirectives-only is incompatible with -traditional"); + } } /* Add include path with a prefix at the front of its name. */ @@ -1442,6 +1459,8 @@ finish_options (void) } } } + else if (cpp_opts->directives_only) + cpp_init_special_builtins (parse_in); include_cursor = 0; push_command_line_include (); Modified: stable/10/contrib/gcc/c-ppoutput.c ============================================================================== --- stable/10/contrib/gcc/c-ppoutput.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c-ppoutput.c Sun Dec 15 03:47:31 2013 (r259405) @@ -41,6 +41,8 @@ static struct /* General output routines. */ static void scan_translation_unit (cpp_reader *); +static void print_lines_directives_only (int, const void *, size_t); +static void scan_translation_unit_directives_only (cpp_reader *); static void scan_translation_unit_trad (cpp_reader *); static void account_for_newlines (const unsigned char *, size_t); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); @@ -75,6 +77,9 @@ preprocess_file (cpp_reader *pfile) } else if (cpp_get_options (pfile)->traditional) scan_translation_unit_trad (pfile); + else if (cpp_get_options (pfile)->directives_only + && !cpp_get_options (pfile)->preprocessed) + scan_translation_unit_directives_only (pfile); else scan_translation_unit (pfile); @@ -179,6 +184,26 @@ scan_translation_unit (cpp_reader *pfile } } +static void +print_lines_directives_only (int lines, const void *buf, size_t size) +{ + print.src_line += lines; + fwrite (buf, 1, size, print.outf); +} + +/* Writes out the preprocessed file, handling spacing and paste + avoidance issues. */ +static void +scan_translation_unit_directives_only (cpp_reader *pfile) +{ + struct _cpp_dir_only_callbacks cb; + + cb.print_lines = print_lines_directives_only; + cb.maybe_print_line = maybe_print_line; + + _cpp_preprocess_dir_only (pfile, &cb); +} + /* Adjust print.src_line for newlines embedded in output. */ static void account_for_newlines (const unsigned char *str, size_t len) Modified: stable/10/contrib/gcc/c-typeck.c ============================================================================== --- stable/10/contrib/gcc/c-typeck.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c-typeck.c Sun Dec 15 03:47:31 2013 (r259405) @@ -1876,6 +1876,19 @@ build_indirect_ref (tree ptr, const char if (TREE_CODE (type) == POINTER_TYPE) { + if (TREE_CODE (pointer) == CONVERT_EXPR + || TREE_CODE (pointer) == NOP_EXPR + || TREE_CODE (pointer) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (pointer, 0)), + type, TREE_OPERAND (pointer, 0))) + TREE_NO_WARNING (pointer) = 1; + } + if (TREE_CODE (pointer) == ADDR_EXPR && (TREE_TYPE (TREE_OPERAND (pointer, 0)) == TREE_TYPE (type))) @@ -3562,7 +3575,8 @@ build_c_cast (tree type, tree expr) warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer " "of different size"); - strict_aliasing_warning (otype, type, expr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (otype, type, expr); /* If pedantic, warn for conversions between function and object pointer types, except for converting a null pointer constant Modified: stable/10/contrib/gcc/c.opt ============================================================================== --- stable/10/contrib/gcc/c.opt Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/c.opt Sun Dec 15 03:47:31 2013 (r259405) @@ -494,6 +494,10 @@ fdefault-inline C++ ObjC++ Inline member functions by default +fdirectives-only +C ObjC C++ ObjC++ +Preprocess directives only. + fdollars-in-identifiers C ObjC C++ ObjC++ Permit '$' as an identifier character Modified: stable/10/contrib/gcc/common.opt ============================================================================== --- stable/10/contrib/gcc/common.opt Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/common.opt Sun Dec 15 03:47:31 2013 (r259405) @@ -95,7 +95,11 @@ Warn when an inlined function cannot be Wlarger-than- Common RejectNegative Joined UInteger --Wlarger-than- Warn if an object is larger than bytes +-Wlarger-than- Warn if an object is larger than bytes + +Wframe-larger-than- +Common RejectNegative Joined UInteger +-Wframe-larger-than- Warn if the frame size of a function is larger than bytes Wunsafe-loop-optimizations Common Var(warn_unsafe_loop_optimizations) @@ -537,6 +541,14 @@ finstrument-functions Common Report Var(flag_instrument_function_entry_exit) Instrument function entry and exit with profiling calls +finstrument-functions-exclude-function-list= +Common RejectNegative Joined +-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions + +finstrument-functions-exclude-file-list= +Common RejectNegative Joined +-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files + fipa-cp Common Report Var(flag_ipa_cp) Perform Interprocedural constant propagation Modified: stable/10/contrib/gcc/coverage.c ============================================================================== --- stable/10/contrib/gcc/coverage.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/coverage.c Sun Dec 15 03:47:31 2013 (r259405) @@ -429,57 +429,75 @@ tree_coverage_counter_ref (unsigned coun static unsigned coverage_checksum_string (unsigned chksum, const char *string) { - int i; char *dup = NULL; + char *ptr; /* Look for everything that looks if it were produced by get_file_function_name_long and zero out the second part that may result from flag_random_seed. This is not critical as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) +#define GLOBAL_PREFIX "_GLOBAL__" +#define TRAILING_N "N_" +#define ISCAPXDIGIT(a) (((a) >= '0' && (a) <= '9') || ((a) >= 'A' && (a) <= 'F')) + if ((ptr = strstr (string, GLOBAL_PREFIX))) { - int offset = 0; - if (!strncmp (string + i, "_GLOBAL__N_", 11)) - offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) - offset = 9; - - /* C++ namespaces do have scheme: - _GLOBAL__N___functionname - since filename might contain extra underscores there seems - to be no better chance then walk all possible offsets looking - for magicnuber. */ - if (offset) - { - for (i = i + offset; string[i]; i++) - if (string[i]=='_') - { - int y; - - for (y = 1; y < 9; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 9 || string[i + 9] != '_') - continue; - for (y = 10; y < 18; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 18) - continue; - if (!dup) - string = dup = xstrdup (string); - for (y = 10; y < 18; y++) - dup[i + y] = '0'; - } - break; - } + /* Skip _GLOBAL__. */ + ptr += strlen (GLOBAL_PREFIX); + + /* Skip optional N_ (in case __GLOBAL_N__). */ + if (!strncmp (ptr, TRAILING_N, strlen (TRAILING_N))) + ptr += strlen (TRAILING_N); + /* At this point, ptr should point after "_GLOBAL__N_" or "_GLOBAL__". */ + + while ((ptr = strchr (ptr, '_')) != NULL) + { + int y; + /* For every "_" in the rest of the string, + try the follwing pattern matching */ + + /* Skip over '_'. */ + ptr++; +#define NDIGITS (8) + /* Try matching the pattern: + <8-digit hex>_<8-digit hex> + The second number is randomly generated + so we want to mask it out before computing the checksum. */ + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + if (y != NDIGITS || *ptr != '_') + continue; + /* Skip over '_' again. */ + ptr++; + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + + if (y == NDIGITS) + { + /* We have a match. + Duplicate the string and mask out + the second 8-digit number. */ + dup = xstrdup (string); + ptr = dup + (ptr - string); + for(y = -NDIGITS - 1 ; y < 0; y++) + { + ptr[y] = '0'; + } + ptr = dup; + break; + } + } + /* "ptr" should be NULL if we couldn't find the match + (strchr will return NULL if no match is found), + or it should point to dup which contains the string + with the random part masked. */ } - chksum = crc32_string (chksum, string); + chksum = crc32_string (chksum, (ptr) ? ptr : string); + if (dup) - free (dup); + free (dup); return chksum; } Modified: stable/10/contrib/gcc/cp/typeck.c ============================================================================== --- stable/10/contrib/gcc/cp/typeck.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/cp/typeck.c Sun Dec 15 03:47:31 2013 (r259405) @@ -2334,6 +2334,19 @@ build_indirect_ref (tree ptr, const char types. */ tree t = canonical_type_variant (TREE_TYPE (type)); + if (TREE_CODE (ptr) == CONVERT_EXPR + || TREE_CODE (ptr) == NOP_EXPR + || TREE_CODE (ptr) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (ptr, 0)), + type, TREE_OPERAND (ptr, 0))) + TREE_NO_WARNING (ptr) = 1; + } + if (VOID_TYPE_P (t)) { /* A pointer to incomplete type (other than cv void) can be @@ -5256,7 +5269,8 @@ build_reinterpret_cast_1 (tree type, tre /* We need to strip nops here, because the frontend likes to create (int *)&a for array-to-pointer decay, instead of &a[0]. */ STRIP_NOPS (sexpr); - strict_aliasing_warning (intype, type, sexpr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (intype, type, sexpr); return fold_if_not_in_template (build_nop (type, expr)); } Modified: stable/10/contrib/gcc/doc/cppopts.texi ============================================================================== --- stable/10/contrib/gcc/doc/cppopts.texi Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/doc/cppopts.texi Sun Dec 15 03:47:31 2013 (r259405) @@ -506,6 +506,22 @@ Search @var{dir} only for header files r @xref{Search Path}. @end ifset +@item -fdirectives-only +@opindex fdirectives-only +This option provides a simplified preprocessor to improve the +performance of distributed build systems such as distcc. It's +behavior depends on a number of other flags. + +If the @option{-E} option is enabled, it suppresses things like macro +expansion, trigraph conversion, and escaped newline splicing +outside of directives. All directives are processed normally, except that +macro definitions are output similar to the @option{-dD} option. + +If the @option{-fpreprocessed} option is enabled, it suppresses +predefinition of most builtin and command line macros. This +prevents duplicate definition of macros output with the @option{-E} +option. + @item -fdollars-in-identifiers @opindex fdollars-in-identifiers @anchor{fdollars-in-identifiers} Modified: stable/10/contrib/gcc/doc/invoke.texi ============================================================================== --- stable/10/contrib/gcc/doc/invoke.texi Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/doc/invoke.texi Sun Dec 15 03:47:31 2013 (r259405) @@ -214,7 +214,8 @@ in the following sections. -Wimport -Wno-import -Winit-self -Winline @gol -Wno-int-to-pointer-cast @gol -Wno-invalid-offsetof -Winvalid-pch @gol --Wlarger-than-@var{len} -Wunsafe-loop-optimizations -Wlong-long @gol +-Wlarger-than-@var{len} -Wframe-larger-than-@var{len} @gol +-Wunsafe-loop-optimizations -Wlong-long @gol -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol @@ -758,6 +759,8 @@ See S/390 and zSeries Options. -fnon-call-exceptions -funwind-tables @gol -fasynchronous-unwind-tables @gol -finhibit-size-directive -finstrument-functions @gol +-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol +-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol -fno-common -fno-ident @gol -fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol -fno-jump-tables @gol @@ -2505,14 +2508,40 @@ It warns about code which might break th compiler is using for optimization. The warning does not catch all cases, but does attempt to catch the more common pitfalls. It is included in @option{-Wall}. +It is equivalent to -Wstrict-aliasing=3 -@item -Wstrict-aliasing=2 -@opindex Wstrict-aliasing=2 +@item -Wstrict-aliasing=n +@opindex Wstrict-aliasing=n This option is only active when @option{-fstrict-aliasing} is active. It warns about code which might break the strict aliasing rules that the -compiler is using for optimization. This warning catches more cases than -@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous -cases that are safe. +compiler is using for optimization. +Higher levels correspond to higher accuracy (fewer false positives). +Higher levels also correspond to more effort, similar to the way -O works. +@option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n}, +with n=3. + +Level 1: Most aggressive, quick, least accurate. +Possibly useful when higher levels +do not warn but -fstrict-aliasing still breaks the code, as it has very few +false negatives. However, it has many false positives. +Warns for all pointer conversions between possibly incompatible types, +even if never dereferenced. Runs in the frontend only. + +Level 2: Aggressive, quick, not too precise. +May still have many false positives (not as many as level 1 though), +and few false negatives (but possibly more than level 1). +Unlike level 1, it only warns when an address is taken. Warns about +incomplete types. Runs in the frontend only. + +Level 3 (default for @option{-Wstrict-aliasing}): +Should have very few false positives and few false +negatives. Slightly slower than levels 1 or 2 when optimization is enabled. +Takes care of the common punn+dereference pattern in the frontend: +@code{*(int*)&some_float}. +If optimization is enabled, it also runs in the backend, where it deals +with multiple statement cases using flow-sensitive points-to information. +Only warns when the converted pointer is dereferenced. +Does not warn about incomplete types. @item -Wstrict-overflow @item -Wstrict-overflow=@var{n} @@ -2828,6 +2857,10 @@ global variable or whenever a built-in f @opindex Wlarger-than Warn whenever an object of larger than @var{len} bytes is defined. +@item -Wframe-larger-than-@var{len} +@opindex Wframe-larger-than +Warn whenever the frame size of a function is larger than @var{len} bytes. + @item -Wunsafe-loop-optimizations @opindex Wunsafe-loop-optimizations Warn if the loop cannot be optimized because the compiler could not @@ -13355,6 +13388,37 @@ interrupt routines, and any functions fr cannot safely be called (perhaps signal handlers, if the profiling routines generate output or allocate memory). +@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} +@opindex finstrument-functions-exclude-file-list + +Set the list of functions that are excluded from instrumentation (see +the description of @code{-finstrument-functions}). If the file that +contains a function definition matches with one of @var{file}, then +that function is not instrumented. The match is done on substrings: +if the @var{file} parameter is a substring of the file name, it is +considered to be a match. + +For example, +@code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys} +will exclude any inline function defined in files whose pathnames +contain @code{/bits/stl} or @code{include/sys}. + +If, for some reason, you want to include letter @code{','} in one of +@var{sym}, write @code{'\,'}. For example, +@code{-finstrument-functions-exclude-file-list='\,\,tmp'} +(note the single quote surrounding the option). + +@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} +@opindex finstrument-functions-exclude-function-list + +This is similar to @code{-finstrument-functions-exclude-file-list}, +but this option sets the list of function names to be excluded from +instrumentation. The function name to be matched is its user-visible +name, such as @code{vector blah(const vector &)}, not the +internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}). The +match is done on substrings: if the @var{sym} parameter is a substring +of the function name, it is considered to be a match. + @item -fstack-check @opindex fstack-check Generate code to verify that you do not go beyond the boundary of the @@ -13932,3 +13996,4 @@ exist, because otherwise they won't get @xref{Protoize Caveats}, for more information on how to use @code{protoize} successfully. + Modified: stable/10/contrib/gcc/final.c ============================================================================== --- stable/10/contrib/gcc/final.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/final.c Sun Dec 15 03:47:31 2013 (r259405) @@ -1425,6 +1425,15 @@ final_start_function (rtx first ATTRIBUT TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1; } + if (warn_frame_larger_than + && get_frame_size () > frame_larger_than_size) + { + /* Issue a warning */ + warning (OPT_Wframe_larger_than_, + "the frame size of %wd bytes is larger than %wd bytes", + get_frame_size (), frame_larger_than_size); + } + /* First output the function prologue: code to set up the stack frame. */ targetm.asm_out.function_prologue (file, get_frame_size ()); @@ -4083,4 +4092,3 @@ struct tree_opt_pass pass_clean_state = 0, /* todo_flags_finish */ 0 /* letter */ }; - Modified: stable/10/contrib/gcc/flags.h ============================================================================== --- stable/10/contrib/gcc/flags.h Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/flags.h Sun Dec 15 03:47:31 2013 (r259405) @@ -122,6 +122,15 @@ extern bool extra_warnings; extern void set_Wunused (int setting); +/* Used to set the level of -Wstrict-aliasing, when no level is specified. + The external way to set the default level is to use + -Wstrict-aliasing=level. + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level. */ + +extern void set_warn_strict_aliasing (int onoff); + /* Nonzero means warn about any objects definitions whose size is larger than N bytes. Also want about function definitions whose returned values are larger than N bytes. The value N is in `larger_than_size'. */ @@ -129,6 +138,12 @@ extern void set_Wunused (int setting); extern bool warn_larger_than; extern HOST_WIDE_INT larger_than_size; +/* Nonzero means warn about any function whose frame size is larger + than N bytes. */ + +extern bool warn_frame_larger_than; +extern HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict aliasing safe. */ @@ -287,6 +302,10 @@ extern const char *flag_random_seed; #define abi_version_at_least(N) \ (flag_abi_version == 0 || flag_abi_version >= (N)) +/* Return whether the function should be excluded from + instrumentation. */ +extern bool flag_instrument_functions_exclude_p (tree fndecl); + /* True if the given mode has a NaN representation and the treatment of NaN operands is important. Certain optimizations, such as folding x * 0 into 0, are not correct for NaN operands, and are normally Modified: stable/10/contrib/gcc/gimplify.c ============================================================================== --- stable/10/contrib/gcc/gimplify.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/gimplify.c Sun Dec 15 03:47:31 2013 (r259405) @@ -6397,7 +6397,8 @@ gimplify_function_tree (tree fndecl) catch the exit hook. */ /* ??? Add some way to ignore exceptions for this TFE. */ if (flag_instrument_function_entry_exit - && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)) + && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl) + && !flag_instrument_functions_exclude_p (fndecl)) { tree tf, x, bind; Modified: stable/10/contrib/gcc/opts.c ============================================================================== --- stable/10/contrib/gcc/opts.c Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/opts.c Sun Dec 15 03:47:31 2013 (r259405) @@ -59,6 +59,11 @@ bool extra_warnings; bool warn_larger_than; HOST_WIDE_INT larger_than_size; +/* True to warn about any function whose frame size is larger + * than N bytes. */ +bool warn_frame_larger_than; +HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict-aliasing safe. */ int warn_strict_aliasing; @@ -358,6 +363,15 @@ static bool flag_unroll_loops_set, flag_ static bool flag_value_profile_transformations_set; static bool flag_peel_loops_set, flag_branch_probabilities_set; +/* Functions excluded from profiling. */ + +typedef char *char_p; /* For DEF_VEC_P. */ +DEF_VEC_P(char_p); +DEF_VEC_ALLOC_P(char_p,heap); + +static VEC(char_p,heap) *flag_instrument_functions_exclude_functions; +static VEC(char_p,heap) *flag_instrument_functions_exclude_files; + /* Input file names. */ const char **in_fnames; unsigned num_in_fnames; @@ -604,6 +618,87 @@ add_input_filename (const char *filename in_fnames[num_in_fnames - 1] = filename; } +/* Add functions or file names to a vector of names to exclude from + instrumentation. */ + +static void +add_instrument_functions_exclude_list (VEC(char_p,heap) **pvec, + const char* arg) +{ + char *tmp; + char *r; + char *w; + char *token_start; + + /* We never free this string. */ + tmp = xstrdup (arg); + + r = tmp; + w = tmp; + token_start = tmp; + + while (*r != '\0') + { + if (*r == ',') + { + *w++ = '\0'; + ++r; + VEC_safe_push (char_p, heap, *pvec, token_start); + token_start = w; + } + if (*r == '\\' && r[1] == ',') + { + *w++ = ','; + r += 2; + } + else + *w++ = *r++; + } + if (*token_start != '\0') + VEC_safe_push (char_p, heap, *pvec, token_start); +} + +/* Return whether we should exclude FNDECL from instrumentation. */ + +bool +flag_instrument_functions_exclude_p (tree fndecl) +{ + if (VEC_length (char_p, flag_instrument_functions_exclude_functions) > 0) + { + const char *name; + int i; + char *s; + + name = lang_hooks.decl_printable_name (fndecl, 0); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_functions, + i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0) + { + const char *name; + int i; + char *s; + + name = DECL_SOURCE_FILE (fndecl); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_files, i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + return false; +} + /* Decode and handle the vector of command line options. LANG_MASK contains has a single bit set representing the current language. */ @@ -979,7 +1074,15 @@ common_handle_option (size_t scode, cons warn_larger_than = value != -1; break; + case OPT_Wframe_larger_than_: + frame_larger_than_size = value; + warn_frame_larger_than = value != -1; + break; + case OPT_Wstrict_aliasing: + set_warn_strict_aliasing (value); + break; + case OPT_Wstrict_aliasing_: warn_strict_aliasing = value; break; @@ -1086,6 +1189,16 @@ common_handle_option (size_t scode, cons set_param_value ("max-inline-insns-auto", value / 2); break; + case OPT_finstrument_functions_exclude_function_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_functions, arg); + break; + + case OPT_finstrument_functions_exclude_file_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_files, arg); + break; + case OPT_fmessage_length_: pp_set_line_maximum_length (global_dc->printer, value); break; @@ -1348,6 +1461,20 @@ set_Wunused (int setting) warn_unused_value = setting; } +/* Used to set the level of strict aliasing warnings, + when no level is specified (i.e., when -Wstrict-aliasing, and not + -Wstrict-aliasing=level was given). + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level, currently 3. */ +void +set_warn_strict_aliasing (int onoff) +{ + gcc_assert (onoff == 0 || onoff == 1); + if (onoff != 0) + warn_strict_aliasing = 3; +} + /* The following routines are useful in setting all the flags that -ffast-math and -fno-fast-math imply. */ void Modified: stable/10/contrib/gcc/tree-flow.h ============================================================================== --- stable/10/contrib/gcc/tree-flow.h Sun Dec 15 03:31:36 2013 (r259404) +++ stable/10/contrib/gcc/tree-flow.h Sun Dec 15 03:47:31 2013 (r259405) @@ -694,6 +694,8 @@ static inline bool overlap_subvar (unsig definition, a function with this prototype is called. */ typedef bool (*walk_use_def_chains_fn) (tree, tree, void *); +/* In tree-ssa-alias-warnings.c */ +extern void strict_aliasing_warning_backend (void); /* In tree-ssa.c */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:48:58 2013 Return-Path: Delivered-To: svn-src-all@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 C31D1CBF; Sun, 15 Dec 2013 03:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB10014E2; Sun, 15 Dec 2013 03:48:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF3mwr4008580; Sun, 15 Dec 2013 03:48:58 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF3mtbL008560; Sun, 15 Dec 2013 03:48:55 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312150348.rBF3mtbL008560@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 15 Dec 2013 03:48:55 +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: r259406 - in stable/9: contrib/gcc contrib/gcc/cp contrib/gcc/doc contrib/gcclibs/libcpp contrib/gcclibs/libcpp/include contrib/libstdc++/include/ext gnu/usr.bin/cc/cc_int gnu/usr.bin/c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 03:48:58 -0000 Author: pfg Date: Sun Dec 15 03:48:54 2013 New Revision: 259406 URL: http://svnweb.freebsd.org/changeset/base/259406 Log: MFC rr258501, r258507; gcc: Bring updates from Google's enhanced gcc-4.2.1. Google released and enhanced version of gcc-4.2.1 plus their local patches for Android[1]. The patches are owned by Google and the license hasn't been changed from the original GPLv2. We are only bringing a subset of the available patches that may be helpful in FreeBSD, in other words, changes specific to android are not included. From the README.google file[1]. Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1: gcc/Makefile.in gcc/c-common.c gcc/c-common.h gcc/c-opts.c gcc/c-typeck.c gcc/cp/typeck.c gcc/doc/invoke.texi gcc/flags.h gcc/opts.c gcc/tree-flow.h gcc/tree-ssa-alias-warnings.c gcc/tree-ssa-alias.c Backport of -Wstrict-aliasing from mainline. Silvius Rus gcc/coverage.c: Patch coverage_checksum_string for PR 25351. Seongbae Park Not yet submitted to FSF. gcc/c-opts.c gcc/c-ppoutput.c gcc/c.opt gcc/doc/cppopts.texi libcpp/Makefile.in libcpp/directives-only.c libcpp/directives.c libcpp/files.c libcpp/include/cpplib.h libcpp/init.c libcpp/internal.h libcpp/macro.c Support for -fdirectives-only. Ollie Wild . Submitted to FSF but not yet approved. libstdc++-v3/include/ext/hashtable.h http://b/742065 http://b/629994 Reduce min size of hashtable for hash_map, hash_set from 53 to 5 libstdc++-v3/include/ext/hashtable.h http://b/629994 Do not iterate over buckets if hashtable is empty. gcc/common.opt gcc/doc/invoke.texi gcc/flags.h gcc/gimplify.c gcc/opts.c Add Saito's patch for -finstrument-functions-exclude-* options. gcc/common.opt gcc/doc/invoke.texi gcc/final.c gcc/flags.h gcc/opts.c gcc/testsuite/gcc.dg/Wframe-larger-than.c Add a new flag -Wframe-larger-than- which enables a new warning when a frame size of a function is larger than specified. This patch hasn't been integrated into gcc mainline yet. gcc/tree-vrp.c Add a hack to avoid using ivopts information for pointers starting at constant values. Reference: [1] https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/ Obtained from: Google Inc. Added: stable/9/contrib/gcc/tree-ssa-alias-warnings.c - copied unchanged from r258501, head/contrib/gcc/tree-ssa-alias-warnings.c stable/9/contrib/gcclibs/libcpp/directives-only.c - copied unchanged from r258501, head/contrib/gcclibs/libcpp/directives-only.c Modified: stable/9/contrib/gcc/c-common.c stable/9/contrib/gcc/c-common.h stable/9/contrib/gcc/c-opts.c stable/9/contrib/gcc/c-ppoutput.c stable/9/contrib/gcc/c-typeck.c stable/9/contrib/gcc/c.opt stable/9/contrib/gcc/common.opt stable/9/contrib/gcc/coverage.c stable/9/contrib/gcc/cp/typeck.c stable/9/contrib/gcc/doc/cppopts.texi stable/9/contrib/gcc/doc/invoke.texi stable/9/contrib/gcc/final.c stable/9/contrib/gcc/flags.h stable/9/contrib/gcc/gimplify.c stable/9/contrib/gcc/opts.c stable/9/contrib/gcc/tree-flow.h stable/9/contrib/gcc/tree-ssa-alias.c stable/9/contrib/gcc/tree-vrp.c stable/9/contrib/gcclibs/libcpp/Makefile.in stable/9/contrib/gcclibs/libcpp/directives.c stable/9/contrib/gcclibs/libcpp/files.c stable/9/contrib/gcclibs/libcpp/include/cpplib.h stable/9/contrib/gcclibs/libcpp/init.c stable/9/contrib/gcclibs/libcpp/internal.h stable/9/contrib/gcclibs/libcpp/macro.c stable/9/contrib/libstdc++/include/ext/hashtable.h stable/9/gnu/usr.bin/cc/cc_int/Makefile stable/9/gnu/usr.bin/cc/libcpp/Makefile Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcclibs/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/gcc/c-common.c ============================================================================== --- stable/9/contrib/gcc/c-common.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c-common.c Sun Dec 15 03:48:54 2013 (r259406) @@ -983,35 +983,67 @@ unsigned_conversion_warning (tree result strict aliasing mode is in effect. OTYPE is the original TREE_TYPE of EXPR, and TYPE the type we're casting to. */ -void +bool strict_aliasing_warning (tree otype, tree type, tree expr) { - if (flag_strict_aliasing && warn_strict_aliasing - && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype) - && TREE_CODE (expr) == ADDR_EXPR + if (!(flag_strict_aliasing && POINTER_TYPE_P (type) + && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type)))) + return false; + + if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR && (DECL_P (TREE_OPERAND (expr, 0)) - || handled_component_p (TREE_OPERAND (expr, 0))) - && !VOID_TYPE_P (TREE_TYPE (type))) + || handled_component_p (TREE_OPERAND (expr, 0)))) { /* Casting the address of an object to non void pointer. Warn if the cast breaks type based aliasing. */ - if (!COMPLETE_TYPE_P (TREE_TYPE (type))) - warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " - "might break strict-aliasing rules"); + if (!COMPLETE_TYPE_P (TREE_TYPE (type)) && warn_strict_aliasing == 2) + { + warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " + "might break strict-aliasing rules"); + return true; + } else { - HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); + /* warn_strict_aliasing >= 3. This includes the default (3). + Only warn if the cast is dereferenced immediately. */ + HOST_WIDE_INT set1 = + get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); if (!alias_sets_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer will break strict-aliasing rules"); - else if (warn_strict_aliasing > 1 - && !alias_sets_might_conflict_p (set1, set2)) - warning (OPT_Wstrict_aliasing, "dereferencing type-punned " - "pointer might break strict-aliasing rules"); + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer will break strict-aliasing rules"); + return true; + } + else if (warn_strict_aliasing == 2 + && !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } } } + else + if ((warn_strict_aliasing == 1) && !VOID_TYPE_P (TREE_TYPE (otype))) + { + /* At this level, warn for any conversions, even if an address is + not taken in the same statement. This will likely produce many + false positives, but could be useful to pinpoint problems that + are not revealed at higher levels. */ + HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (otype)); + HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); + if (!COMPLETE_TYPE_P(type) + || !alias_sets_might_conflict_p (set1, set2)) + { + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + return true; + } + } + + return false; } @@ -3108,6 +3140,85 @@ def_fn_type (builtin_type def, builtin_t builtin_types[def] = t; } +/* Build builtin functions common to both C and C++ language + frontends. */ + +static void +c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node) +{ +#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ + builtin_types[ENUM] = VALUE; +#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 0, 0); +#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 0, 1, ARG1); +#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6) \ + def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); +#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6, ARG7) \ + def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); +#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 1, 0); +#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 1, 1, ARG1); +#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_POINTER_TYPE(ENUM, TYPE) \ + builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); + +#include "builtin-types.def" + +#undef DEF_PRIMITIVE_TYPE +#undef DEF_FUNCTION_TYPE_1 +#undef DEF_FUNCTION_TYPE_2 +#undef DEF_FUNCTION_TYPE_3 +#undef DEF_FUNCTION_TYPE_4 +#undef DEF_FUNCTION_TYPE_5 +#undef DEF_FUNCTION_TYPE_6 +#undef DEF_FUNCTION_TYPE_VAR_0 +#undef DEF_FUNCTION_TYPE_VAR_1 +#undef DEF_FUNCTION_TYPE_VAR_2 +#undef DEF_FUNCTION_TYPE_VAR_3 +#undef DEF_FUNCTION_TYPE_VAR_4 +#undef DEF_FUNCTION_TYPE_VAR_5 +#undef DEF_POINTER_TYPE + builtin_types[(int) BT_LAST] = NULL_TREE; + + c_init_attributes (); + +#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ + NONANSI_P, ATTRS, IMPLICIT, COND) \ + if (NAME && COND) \ + def_builtin_1 (ENUM, NAME, CLASS, \ + builtin_types[(int) TYPE], \ + builtin_types[(int) LIBTYPE], \ + BOTH_P, FALLBACK_P, NONANSI_P, \ + built_in_attributes[(int) ATTRS], IMPLICIT); +#include "builtins.def" +#undef DEF_BUILTIN + + build_common_builtin_nodes (); + + targetm.init_builtins (); + if (flag_mudflap) + mudflap_init (); +} + /* Build tree nodes and builtin functions common to both C and C++ language frontends. */ @@ -3320,77 +3431,8 @@ c_common_nodes_and_builtins (void) va_list_ref_type_node = build_reference_type (va_list_type_node); } -#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ - builtin_types[ENUM] = VALUE; -#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 0, 0); -#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 0, 1, ARG1); -#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6) \ - def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); -#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ - ARG6, ARG7) \ - def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); -#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ - def_fn_type (ENUM, RETURN, 1, 0); -#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ - def_fn_type (ENUM, RETURN, 1, 1, ARG1); -#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ - def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); -#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); -#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); -#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ - def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); -#define DEF_POINTER_TYPE(ENUM, TYPE) \ - builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); - -#include "builtin-types.def" - -#undef DEF_PRIMITIVE_TYPE -#undef DEF_FUNCTION_TYPE_1 -#undef DEF_FUNCTION_TYPE_2 -#undef DEF_FUNCTION_TYPE_3 -#undef DEF_FUNCTION_TYPE_4 -#undef DEF_FUNCTION_TYPE_5 -#undef DEF_FUNCTION_TYPE_6 -#undef DEF_FUNCTION_TYPE_VAR_0 -#undef DEF_FUNCTION_TYPE_VAR_1 -#undef DEF_FUNCTION_TYPE_VAR_2 -#undef DEF_FUNCTION_TYPE_VAR_3 -#undef DEF_FUNCTION_TYPE_VAR_4 -#undef DEF_FUNCTION_TYPE_VAR_5 -#undef DEF_POINTER_TYPE - builtin_types[(int) BT_LAST] = NULL_TREE; - - c_init_attributes (); - -#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ - NONANSI_P, ATTRS, IMPLICIT, COND) \ - if (NAME && COND) \ - def_builtin_1 (ENUM, NAME, CLASS, \ - builtin_types[(int) TYPE], \ - builtin_types[(int) LIBTYPE], \ - BOTH_P, FALLBACK_P, NONANSI_P, \ - built_in_attributes[(int) ATTRS], IMPLICIT); -#include "builtins.def" -#undef DEF_BUILTIN - - build_common_builtin_nodes (); - - targetm.init_builtins (); - if (flag_mudflap) - mudflap_init (); + if (!flag_preprocess_only) + c_define_builtins (va_list_ref_type_node, va_list_arg_type_node); main_identifier_node = get_identifier ("main"); Modified: stable/9/contrib/gcc/c-common.h ============================================================================== --- stable/9/contrib/gcc/c-common.h Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c-common.h Sun Dec 15 03:48:54 2013 (r259406) @@ -654,7 +654,7 @@ extern void binary_op_error (enum tree_c extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); -extern void strict_aliasing_warning(tree, tree, tree); +extern bool strict_aliasing_warning (tree, tree, tree); extern void empty_body_warning (tree, tree); extern tree convert_and_check (tree, tree); extern void overflow_warning (tree); Modified: stable/9/contrib/gcc/c-opts.c ============================================================================== --- stable/9/contrib/gcc/c-opts.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c-opts.c Sun Dec 15 03:48:54 2013 (r259406) @@ -396,7 +396,7 @@ c_common_handle_option (size_t scode, co if (c_dialect_cxx ()) warn_sign_compare = value; warn_switch = value; - warn_strict_aliasing = value; + set_warn_strict_aliasing (value); warn_strict_overflow = value; warn_address = value; @@ -606,6 +606,10 @@ c_common_handle_option (size_t scode, co disable_builtin_function (arg); break; + case OPT_fdirectives_only: + cpp_opts->directives_only = 1; + break; + case OPT_fdollars_in_identifiers: cpp_opts->dollars_in_ident = value; break; @@ -1329,6 +1333,11 @@ sanitize_cpp_opts (void) if (flag_dump_macros == 'M') flag_no_output = 1; + /* By default, -fdirectives-only implies -dD. This allows subsequent phases + to perform proper macro expansion. */ + if (cpp_opts->directives_only && !cpp_opts->preprocessed && !flag_dump_macros) + flag_dump_macros = 'D'; + /* Disable -dD, -dN and -dI if normal output is suppressed. Allow -dM since at least glibc relies on -M -dM to work. */ /* Also, flag_no_output implies flag_no_line_commands, always. */ @@ -1359,6 +1368,14 @@ sanitize_cpp_opts (void) actually output the current directory? */ if (flag_working_directory == -1) flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE); + + if (cpp_opts->directives_only) + { + if (warn_unused_macros) + error ("-fdirectives-only is incompatible with -Wunused_macros"); + if (cpp_opts->traditional) + error ("-fdirectives-only is incompatible with -traditional"); + } } /* Add include path with a prefix at the front of its name. */ @@ -1442,6 +1459,8 @@ finish_options (void) } } } + else if (cpp_opts->directives_only) + cpp_init_special_builtins (parse_in); include_cursor = 0; push_command_line_include (); Modified: stable/9/contrib/gcc/c-ppoutput.c ============================================================================== --- stable/9/contrib/gcc/c-ppoutput.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c-ppoutput.c Sun Dec 15 03:48:54 2013 (r259406) @@ -41,6 +41,8 @@ static struct /* General output routines. */ static void scan_translation_unit (cpp_reader *); +static void print_lines_directives_only (int, const void *, size_t); +static void scan_translation_unit_directives_only (cpp_reader *); static void scan_translation_unit_trad (cpp_reader *); static void account_for_newlines (const unsigned char *, size_t); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); @@ -75,6 +77,9 @@ preprocess_file (cpp_reader *pfile) } else if (cpp_get_options (pfile)->traditional) scan_translation_unit_trad (pfile); + else if (cpp_get_options (pfile)->directives_only + && !cpp_get_options (pfile)->preprocessed) + scan_translation_unit_directives_only (pfile); else scan_translation_unit (pfile); @@ -179,6 +184,26 @@ scan_translation_unit (cpp_reader *pfile } } +static void +print_lines_directives_only (int lines, const void *buf, size_t size) +{ + print.src_line += lines; + fwrite (buf, 1, size, print.outf); +} + +/* Writes out the preprocessed file, handling spacing and paste + avoidance issues. */ +static void +scan_translation_unit_directives_only (cpp_reader *pfile) +{ + struct _cpp_dir_only_callbacks cb; + + cb.print_lines = print_lines_directives_only; + cb.maybe_print_line = maybe_print_line; + + _cpp_preprocess_dir_only (pfile, &cb); +} + /* Adjust print.src_line for newlines embedded in output. */ static void account_for_newlines (const unsigned char *str, size_t len) Modified: stable/9/contrib/gcc/c-typeck.c ============================================================================== --- stable/9/contrib/gcc/c-typeck.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c-typeck.c Sun Dec 15 03:48:54 2013 (r259406) @@ -1876,6 +1876,19 @@ build_indirect_ref (tree ptr, const char if (TREE_CODE (type) == POINTER_TYPE) { + if (TREE_CODE (pointer) == CONVERT_EXPR + || TREE_CODE (pointer) == NOP_EXPR + || TREE_CODE (pointer) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (pointer, 0)), + type, TREE_OPERAND (pointer, 0))) + TREE_NO_WARNING (pointer) = 1; + } + if (TREE_CODE (pointer) == ADDR_EXPR && (TREE_TYPE (TREE_OPERAND (pointer, 0)) == TREE_TYPE (type))) @@ -3562,7 +3575,8 @@ build_c_cast (tree type, tree expr) warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer " "of different size"); - strict_aliasing_warning (otype, type, expr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (otype, type, expr); /* If pedantic, warn for conversions between function and object pointer types, except for converting a null pointer constant Modified: stable/9/contrib/gcc/c.opt ============================================================================== --- stable/9/contrib/gcc/c.opt Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/c.opt Sun Dec 15 03:48:54 2013 (r259406) @@ -494,6 +494,10 @@ fdefault-inline C++ ObjC++ Inline member functions by default +fdirectives-only +C ObjC C++ ObjC++ +Preprocess directives only. + fdollars-in-identifiers C ObjC C++ ObjC++ Permit '$' as an identifier character Modified: stable/9/contrib/gcc/common.opt ============================================================================== --- stable/9/contrib/gcc/common.opt Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/common.opt Sun Dec 15 03:48:54 2013 (r259406) @@ -95,7 +95,11 @@ Warn when an inlined function cannot be Wlarger-than- Common RejectNegative Joined UInteger --Wlarger-than- Warn if an object is larger than bytes +-Wlarger-than- Warn if an object is larger than bytes + +Wframe-larger-than- +Common RejectNegative Joined UInteger +-Wframe-larger-than- Warn if the frame size of a function is larger than bytes Wunsafe-loop-optimizations Common Var(warn_unsafe_loop_optimizations) @@ -537,6 +541,14 @@ finstrument-functions Common Report Var(flag_instrument_function_entry_exit) Instrument function entry and exit with profiling calls +finstrument-functions-exclude-function-list= +Common RejectNegative Joined +-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions + +finstrument-functions-exclude-file-list= +Common RejectNegative Joined +-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files + fipa-cp Common Report Var(flag_ipa_cp) Perform Interprocedural constant propagation Modified: stable/9/contrib/gcc/coverage.c ============================================================================== --- stable/9/contrib/gcc/coverage.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/coverage.c Sun Dec 15 03:48:54 2013 (r259406) @@ -429,57 +429,75 @@ tree_coverage_counter_ref (unsigned coun static unsigned coverage_checksum_string (unsigned chksum, const char *string) { - int i; char *dup = NULL; + char *ptr; /* Look for everything that looks if it were produced by get_file_function_name_long and zero out the second part that may result from flag_random_seed. This is not critical as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) +#define GLOBAL_PREFIX "_GLOBAL__" +#define TRAILING_N "N_" +#define ISCAPXDIGIT(a) (((a) >= '0' && (a) <= '9') || ((a) >= 'A' && (a) <= 'F')) + if ((ptr = strstr (string, GLOBAL_PREFIX))) { - int offset = 0; - if (!strncmp (string + i, "_GLOBAL__N_", 11)) - offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) - offset = 9; - - /* C++ namespaces do have scheme: - _GLOBAL__N___functionname - since filename might contain extra underscores there seems - to be no better chance then walk all possible offsets looking - for magicnuber. */ - if (offset) - { - for (i = i + offset; string[i]; i++) - if (string[i]=='_') - { - int y; - - for (y = 1; y < 9; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 9 || string[i + 9] != '_') - continue; - for (y = 10; y < 18; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 18) - continue; - if (!dup) - string = dup = xstrdup (string); - for (y = 10; y < 18; y++) - dup[i + y] = '0'; - } - break; - } + /* Skip _GLOBAL__. */ + ptr += strlen (GLOBAL_PREFIX); + + /* Skip optional N_ (in case __GLOBAL_N__). */ + if (!strncmp (ptr, TRAILING_N, strlen (TRAILING_N))) + ptr += strlen (TRAILING_N); + /* At this point, ptr should point after "_GLOBAL__N_" or "_GLOBAL__". */ + + while ((ptr = strchr (ptr, '_')) != NULL) + { + int y; + /* For every "_" in the rest of the string, + try the follwing pattern matching */ + + /* Skip over '_'. */ + ptr++; +#define NDIGITS (8) + /* Try matching the pattern: + <8-digit hex>_<8-digit hex> + The second number is randomly generated + so we want to mask it out before computing the checksum. */ + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + if (y != NDIGITS || *ptr != '_') + continue; + /* Skip over '_' again. */ + ptr++; + for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++) + if (!ISCAPXDIGIT (*ptr)) + break; + + if (y == NDIGITS) + { + /* We have a match. + Duplicate the string and mask out + the second 8-digit number. */ + dup = xstrdup (string); + ptr = dup + (ptr - string); + for(y = -NDIGITS - 1 ; y < 0; y++) + { + ptr[y] = '0'; + } + ptr = dup; + break; + } + } + /* "ptr" should be NULL if we couldn't find the match + (strchr will return NULL if no match is found), + or it should point to dup which contains the string + with the random part masked. */ } - chksum = crc32_string (chksum, string); + chksum = crc32_string (chksum, (ptr) ? ptr : string); + if (dup) - free (dup); + free (dup); return chksum; } Modified: stable/9/contrib/gcc/cp/typeck.c ============================================================================== --- stable/9/contrib/gcc/cp/typeck.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/cp/typeck.c Sun Dec 15 03:48:54 2013 (r259406) @@ -2334,6 +2334,19 @@ build_indirect_ref (tree ptr, const char types. */ tree t = canonical_type_variant (TREE_TYPE (type)); + if (TREE_CODE (ptr) == CONVERT_EXPR + || TREE_CODE (ptr) == NOP_EXPR + || TREE_CODE (ptr) == VIEW_CONVERT_EXPR) + { + /* If a warning is issued, mark it to avoid duplicates from + the backend. This only needs to be done at + warn_strict_aliasing > 2. */ + if (warn_strict_aliasing > 2) + if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (ptr, 0)), + type, TREE_OPERAND (ptr, 0))) + TREE_NO_WARNING (ptr) = 1; + } + if (VOID_TYPE_P (t)) { /* A pointer to incomplete type (other than cv void) can be @@ -5256,7 +5269,8 @@ build_reinterpret_cast_1 (tree type, tre /* We need to strip nops here, because the frontend likes to create (int *)&a for array-to-pointer decay, instead of &a[0]. */ STRIP_NOPS (sexpr); - strict_aliasing_warning (intype, type, sexpr); + if (warn_strict_aliasing <= 2) + strict_aliasing_warning (intype, type, sexpr); return fold_if_not_in_template (build_nop (type, expr)); } Modified: stable/9/contrib/gcc/doc/cppopts.texi ============================================================================== --- stable/9/contrib/gcc/doc/cppopts.texi Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/doc/cppopts.texi Sun Dec 15 03:48:54 2013 (r259406) @@ -506,6 +506,22 @@ Search @var{dir} only for header files r @xref{Search Path}. @end ifset +@item -fdirectives-only +@opindex fdirectives-only +This option provides a simplified preprocessor to improve the +performance of distributed build systems such as distcc. It's +behavior depends on a number of other flags. + +If the @option{-E} option is enabled, it suppresses things like macro +expansion, trigraph conversion, and escaped newline splicing +outside of directives. All directives are processed normally, except that +macro definitions are output similar to the @option{-dD} option. + +If the @option{-fpreprocessed} option is enabled, it suppresses +predefinition of most builtin and command line macros. This +prevents duplicate definition of macros output with the @option{-E} +option. + @item -fdollars-in-identifiers @opindex fdollars-in-identifiers @anchor{fdollars-in-identifiers} Modified: stable/9/contrib/gcc/doc/invoke.texi ============================================================================== --- stable/9/contrib/gcc/doc/invoke.texi Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/doc/invoke.texi Sun Dec 15 03:48:54 2013 (r259406) @@ -214,7 +214,8 @@ in the following sections. -Wimport -Wno-import -Winit-self -Winline @gol -Wno-int-to-pointer-cast @gol -Wno-invalid-offsetof -Winvalid-pch @gol --Wlarger-than-@var{len} -Wunsafe-loop-optimizations -Wlong-long @gol +-Wlarger-than-@var{len} -Wframe-larger-than-@var{len} @gol +-Wunsafe-loop-optimizations -Wlong-long @gol -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol @@ -758,6 +759,8 @@ See S/390 and zSeries Options. -fnon-call-exceptions -funwind-tables @gol -fasynchronous-unwind-tables @gol -finhibit-size-directive -finstrument-functions @gol +-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol +-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol -fno-common -fno-ident @gol -fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol -fno-jump-tables @gol @@ -2505,14 +2508,40 @@ It warns about code which might break th compiler is using for optimization. The warning does not catch all cases, but does attempt to catch the more common pitfalls. It is included in @option{-Wall}. +It is equivalent to -Wstrict-aliasing=3 -@item -Wstrict-aliasing=2 -@opindex Wstrict-aliasing=2 +@item -Wstrict-aliasing=n +@opindex Wstrict-aliasing=n This option is only active when @option{-fstrict-aliasing} is active. It warns about code which might break the strict aliasing rules that the -compiler is using for optimization. This warning catches more cases than -@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous -cases that are safe. +compiler is using for optimization. +Higher levels correspond to higher accuracy (fewer false positives). +Higher levels also correspond to more effort, similar to the way -O works. +@option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n}, +with n=3. + +Level 1: Most aggressive, quick, least accurate. +Possibly useful when higher levels +do not warn but -fstrict-aliasing still breaks the code, as it has very few +false negatives. However, it has many false positives. +Warns for all pointer conversions between possibly incompatible types, +even if never dereferenced. Runs in the frontend only. + +Level 2: Aggressive, quick, not too precise. +May still have many false positives (not as many as level 1 though), +and few false negatives (but possibly more than level 1). +Unlike level 1, it only warns when an address is taken. Warns about +incomplete types. Runs in the frontend only. + +Level 3 (default for @option{-Wstrict-aliasing}): +Should have very few false positives and few false +negatives. Slightly slower than levels 1 or 2 when optimization is enabled. +Takes care of the common punn+dereference pattern in the frontend: +@code{*(int*)&some_float}. +If optimization is enabled, it also runs in the backend, where it deals +with multiple statement cases using flow-sensitive points-to information. +Only warns when the converted pointer is dereferenced. +Does not warn about incomplete types. @item -Wstrict-overflow @item -Wstrict-overflow=@var{n} @@ -2828,6 +2857,10 @@ global variable or whenever a built-in f @opindex Wlarger-than Warn whenever an object of larger than @var{len} bytes is defined. +@item -Wframe-larger-than-@var{len} +@opindex Wframe-larger-than +Warn whenever the frame size of a function is larger than @var{len} bytes. + @item -Wunsafe-loop-optimizations @opindex Wunsafe-loop-optimizations Warn if the loop cannot be optimized because the compiler could not @@ -13353,6 +13386,37 @@ interrupt routines, and any functions fr cannot safely be called (perhaps signal handlers, if the profiling routines generate output or allocate memory). +@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} +@opindex finstrument-functions-exclude-file-list + +Set the list of functions that are excluded from instrumentation (see +the description of @code{-finstrument-functions}). If the file that +contains a function definition matches with one of @var{file}, then +that function is not instrumented. The match is done on substrings: +if the @var{file} parameter is a substring of the file name, it is +considered to be a match. + +For example, +@code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys} +will exclude any inline function defined in files whose pathnames +contain @code{/bits/stl} or @code{include/sys}. + +If, for some reason, you want to include letter @code{','} in one of +@var{sym}, write @code{'\,'}. For example, +@code{-finstrument-functions-exclude-file-list='\,\,tmp'} +(note the single quote surrounding the option). + +@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} +@opindex finstrument-functions-exclude-function-list + +This is similar to @code{-finstrument-functions-exclude-file-list}, +but this option sets the list of function names to be excluded from +instrumentation. The function name to be matched is its user-visible +name, such as @code{vector blah(const vector &)}, not the +internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}). The +match is done on substrings: if the @var{sym} parameter is a substring +of the function name, it is considered to be a match. + @item -fstack-check @opindex fstack-check Generate code to verify that you do not go beyond the boundary of the @@ -13930,3 +13994,4 @@ exist, because otherwise they won't get @xref{Protoize Caveats}, for more information on how to use @code{protoize} successfully. + Modified: stable/9/contrib/gcc/final.c ============================================================================== --- stable/9/contrib/gcc/final.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/final.c Sun Dec 15 03:48:54 2013 (r259406) @@ -1425,6 +1425,15 @@ final_start_function (rtx first ATTRIBUT TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1; } + if (warn_frame_larger_than + && get_frame_size () > frame_larger_than_size) + { + /* Issue a warning */ + warning (OPT_Wframe_larger_than_, + "the frame size of %wd bytes is larger than %wd bytes", + get_frame_size (), frame_larger_than_size); + } + /* First output the function prologue: code to set up the stack frame. */ targetm.asm_out.function_prologue (file, get_frame_size ()); @@ -4083,4 +4092,3 @@ struct tree_opt_pass pass_clean_state = 0, /* todo_flags_finish */ 0 /* letter */ }; - Modified: stable/9/contrib/gcc/flags.h ============================================================================== --- stable/9/contrib/gcc/flags.h Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/flags.h Sun Dec 15 03:48:54 2013 (r259406) @@ -122,6 +122,15 @@ extern bool extra_warnings; extern void set_Wunused (int setting); +/* Used to set the level of -Wstrict-aliasing, when no level is specified. + The external way to set the default level is to use + -Wstrict-aliasing=level. + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level. */ + +extern void set_warn_strict_aliasing (int onoff); + /* Nonzero means warn about any objects definitions whose size is larger than N bytes. Also want about function definitions whose returned values are larger than N bytes. The value N is in `larger_than_size'. */ @@ -129,6 +138,12 @@ extern void set_Wunused (int setting); extern bool warn_larger_than; extern HOST_WIDE_INT larger_than_size; +/* Nonzero means warn about any function whose frame size is larger + than N bytes. */ + +extern bool warn_frame_larger_than; +extern HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict aliasing safe. */ @@ -287,6 +302,10 @@ extern const char *flag_random_seed; #define abi_version_at_least(N) \ (flag_abi_version == 0 || flag_abi_version >= (N)) +/* Return whether the function should be excluded from + instrumentation. */ +extern bool flag_instrument_functions_exclude_p (tree fndecl); + /* True if the given mode has a NaN representation and the treatment of NaN operands is important. Certain optimizations, such as folding x * 0 into 0, are not correct for NaN operands, and are normally Modified: stable/9/contrib/gcc/gimplify.c ============================================================================== --- stable/9/contrib/gcc/gimplify.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/gimplify.c Sun Dec 15 03:48:54 2013 (r259406) @@ -6397,7 +6397,8 @@ gimplify_function_tree (tree fndecl) catch the exit hook. */ /* ??? Add some way to ignore exceptions for this TFE. */ if (flag_instrument_function_entry_exit - && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)) + && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl) + && !flag_instrument_functions_exclude_p (fndecl)) { tree tf, x, bind; Modified: stable/9/contrib/gcc/opts.c ============================================================================== --- stable/9/contrib/gcc/opts.c Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/opts.c Sun Dec 15 03:48:54 2013 (r259406) @@ -59,6 +59,11 @@ bool extra_warnings; bool warn_larger_than; HOST_WIDE_INT larger_than_size; +/* True to warn about any function whose frame size is larger + * than N bytes. */ +bool warn_frame_larger_than; +HOST_WIDE_INT frame_larger_than_size; + /* Nonzero means warn about constructs which might not be strict-aliasing safe. */ int warn_strict_aliasing; @@ -358,6 +363,15 @@ static bool flag_unroll_loops_set, flag_ static bool flag_value_profile_transformations_set; static bool flag_peel_loops_set, flag_branch_probabilities_set; +/* Functions excluded from profiling. */ + +typedef char *char_p; /* For DEF_VEC_P. */ +DEF_VEC_P(char_p); +DEF_VEC_ALLOC_P(char_p,heap); + +static VEC(char_p,heap) *flag_instrument_functions_exclude_functions; +static VEC(char_p,heap) *flag_instrument_functions_exclude_files; + /* Input file names. */ const char **in_fnames; unsigned num_in_fnames; @@ -604,6 +618,87 @@ add_input_filename (const char *filename in_fnames[num_in_fnames - 1] = filename; } +/* Add functions or file names to a vector of names to exclude from + instrumentation. */ + +static void +add_instrument_functions_exclude_list (VEC(char_p,heap) **pvec, + const char* arg) +{ + char *tmp; + char *r; + char *w; + char *token_start; + + /* We never free this string. */ + tmp = xstrdup (arg); + + r = tmp; + w = tmp; + token_start = tmp; + + while (*r != '\0') + { + if (*r == ',') + { + *w++ = '\0'; + ++r; + VEC_safe_push (char_p, heap, *pvec, token_start); + token_start = w; + } + if (*r == '\\' && r[1] == ',') + { + *w++ = ','; + r += 2; + } + else + *w++ = *r++; + } + if (*token_start != '\0') + VEC_safe_push (char_p, heap, *pvec, token_start); +} + +/* Return whether we should exclude FNDECL from instrumentation. */ + +bool +flag_instrument_functions_exclude_p (tree fndecl) +{ + if (VEC_length (char_p, flag_instrument_functions_exclude_functions) > 0) + { + const char *name; + int i; + char *s; + + name = lang_hooks.decl_printable_name (fndecl, 0); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_functions, + i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0) + { + const char *name; + int i; + char *s; + + name = DECL_SOURCE_FILE (fndecl); + for (i = 0; + VEC_iterate (char_p, flag_instrument_functions_exclude_files, i, s); + ++i) + { + if (strstr (name, s) != NULL) + return true; + } + } + + return false; +} + /* Decode and handle the vector of command line options. LANG_MASK contains has a single bit set representing the current language. */ @@ -979,7 +1074,15 @@ common_handle_option (size_t scode, cons warn_larger_than = value != -1; break; + case OPT_Wframe_larger_than_: + frame_larger_than_size = value; + warn_frame_larger_than = value != -1; + break; + case OPT_Wstrict_aliasing: + set_warn_strict_aliasing (value); + break; + case OPT_Wstrict_aliasing_: warn_strict_aliasing = value; break; @@ -1086,6 +1189,16 @@ common_handle_option (size_t scode, cons set_param_value ("max-inline-insns-auto", value / 2); break; + case OPT_finstrument_functions_exclude_function_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_functions, arg); + break; + + case OPT_finstrument_functions_exclude_file_list_: + add_instrument_functions_exclude_list + (&flag_instrument_functions_exclude_files, arg); + break; + case OPT_fmessage_length_: pp_set_line_maximum_length (global_dc->printer, value); break; @@ -1348,6 +1461,20 @@ set_Wunused (int setting) warn_unused_value = setting; } +/* Used to set the level of strict aliasing warnings, + when no level is specified (i.e., when -Wstrict-aliasing, and not + -Wstrict-aliasing=level was given). + ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified, + and 0 otherwise. After calling this function, wstrict_aliasing will be + set to the default value of -Wstrict_aliasing=level, currently 3. */ +void +set_warn_strict_aliasing (int onoff) +{ + gcc_assert (onoff == 0 || onoff == 1); + if (onoff != 0) + warn_strict_aliasing = 3; +} + /* The following routines are useful in setting all the flags that -ffast-math and -fno-fast-math imply. */ void Modified: stable/9/contrib/gcc/tree-flow.h ============================================================================== --- stable/9/contrib/gcc/tree-flow.h Sun Dec 15 03:47:31 2013 (r259405) +++ stable/9/contrib/gcc/tree-flow.h Sun Dec 15 03:48:54 2013 (r259406) @@ -694,6 +694,8 @@ static inline bool overlap_subvar (unsig definition, a function with this prototype is called. */ typedef bool (*walk_use_def_chains_fn) (tree, tree, void *); +/* In tree-ssa-alias-warnings.c */ +extern void strict_aliasing_warning_backend (void); /* In tree-ssa.c */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 04:11:44 2013 Return-Path: Delivered-To: svn-src-all@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 105B7F5F; Sun, 15 Dec 2013 04:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E910F1635; Sun, 15 Dec 2013 04:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF4Bhne018853; Sun, 15 Dec 2013 04:11:43 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF4Bhtg018852; Sun, 15 Dec 2013 04:11:43 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201312150411.rBF4Bhtg018852@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 15 Dec 2013 04:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259407 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 04:11:44 -0000 Author: mjg Date: Sun Dec 15 04:11:43 2013 New Revision: 259407 URL: http://svnweb.freebsd.org/changeset/base/259407 Log: proc exit: don't take PROC_LOCK while freeing rlimits Code wishing to check rlimits of some process should check whether it is exiting first, which current consumers do. MFC after: 2 weeks Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Dec 15 03:48:54 2013 (r259406) +++ head/sys/kern/kern_exit.c Sun Dec 15 04:11:43 2013 (r259407) @@ -385,10 +385,8 @@ exit1(struct thread *td, int rv) /* * Release our limits structure. */ - PROC_LOCK(p); plim = p->p_limit; p->p_limit = NULL; - PROC_UNLOCK(p); lim_free(plim); tidhash_remove(td); From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 04:27:49 2013 Return-Path: Delivered-To: svn-src-all@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 CC3171B8; Sun, 15 Dec 2013 04:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9930016C1; Sun, 15 Dec 2013 04:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF4Rn53023025; Sun, 15 Dec 2013 04:27:49 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF4Rnk4023024; Sun, 15 Dec 2013 04:27:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312150427.rBF4Rnk4023024@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 15 Dec 2013 04:27: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: r259408 - stable/10/contrib/gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 04:27:50 -0000 Author: pfg Date: Sun Dec 15 04:27:49 2013 New Revision: 259408 URL: http://svnweb.freebsd.org/changeset/base/259408 Log: MFC r258530; libcpp: Keep a record of changes from upstream GCC (pre-43). Added: stable/10/contrib/gcclibs/libcpp/ChangeLog.gcc43 - copied unchanged from r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43 Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/gcclibs/libcpp/ChangeLog.gcc43 (from r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/gcclibs/libcpp/ChangeLog.gcc43 Sun Dec 15 04:27:49 2013 (r259408, copy of r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43) @@ -0,0 +1,29 @@ +2007-06-05 Joerg Wunsch (r250566) + + PR preprocessor/23479 + * expr.c (cpp_classify_number): Implement 0b-prefixed binary + integer constants. + (append_digit): Likewise. + * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed + binary integer constants. + +2007-05-21 Ian Lance Taylor (r124929) + + * internal.h (struct cpp_reader): Add new fields: + nonexistent_file_hash and nonexistent_file_ob. + * files.c: Include "obstack.h". + (find_file_in_dir): Before trying to open the file, look up the + path name in the hash table of nonexistent files. After failing + to open the file, add the path name to the hash table. + (_cpp_find_file): Cache the results of looking up the file name + starting with the quote and bracket chain heads, if we can. + (nonexistent_file_hash_eq): New static function. + (_cpp_init_files): Initialize pfile->nonexistent_file_hash and + pfile->nonexistent_file_ob. + (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and + pfile->nonexistent_file_ob. + +2006-12-29 Ian Lance Taylor (r120263) + + * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't + look backward at the end of the line unless we saw a backslash. From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 04:28:21 2013 Return-Path: Delivered-To: svn-src-all@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 74E4B2EA; Sun, 15 Dec 2013 04:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46CCC16C6; Sun, 15 Dec 2013 04:28:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF4SLUP023127; Sun, 15 Dec 2013 04:28:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF4SLm6023126; Sun, 15 Dec 2013 04:28:21 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312150428.rBF4SLm6023126@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 15 Dec 2013 04:28:21 +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: r259409 - stable/9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 04:28:21 -0000 Author: pfg Date: Sun Dec 15 04:28:20 2013 New Revision: 259409 URL: http://svnweb.freebsd.org/changeset/base/259409 Log: MFC r258530; libcpp: Keep a record of changes from upstream GCC (pre-43). Added: stable/9/contrib/gcclibs/libcpp/ChangeLog.gcc43 - copied unchanged from r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43 Modified: Directory Properties: stable/9/ (props changed) stable/9/contrib/gcclibs/ (props changed) Copied: stable/9/contrib/gcclibs/libcpp/ChangeLog.gcc43 (from r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/gcclibs/libcpp/ChangeLog.gcc43 Sun Dec 15 04:28:20 2013 (r259409, copy of r258530, head/contrib/gcclibs/libcpp/ChangeLog.gcc43) @@ -0,0 +1,29 @@ +2007-06-05 Joerg Wunsch (r250566) + + PR preprocessor/23479 + * expr.c (cpp_classify_number): Implement 0b-prefixed binary + integer constants. + (append_digit): Likewise. + * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed + binary integer constants. + +2007-05-21 Ian Lance Taylor (r124929) + + * internal.h (struct cpp_reader): Add new fields: + nonexistent_file_hash and nonexistent_file_ob. + * files.c: Include "obstack.h". + (find_file_in_dir): Before trying to open the file, look up the + path name in the hash table of nonexistent files. After failing + to open the file, add the path name to the hash table. + (_cpp_find_file): Cache the results of looking up the file name + starting with the quote and bracket chain heads, if we can. + (nonexistent_file_hash_eq): New static function. + (_cpp_init_files): Initialize pfile->nonexistent_file_hash and + pfile->nonexistent_file_ob. + (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and + pfile->nonexistent_file_ob. + +2006-12-29 Ian Lance Taylor (r120263) + + * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't + look backward at the end of the line unless we saw a backslash. From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 07:05:00 2013 Return-Path: Delivered-To: svn-src-all@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 9E4CBD6D; Sun, 15 Dec 2013 07:05:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E8ED1F6E; Sun, 15 Dec 2013 07:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF7508t079113; Sun, 15 Dec 2013 07:05:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF750Oa079112; Sun, 15 Dec 2013 07:05:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312150705.rBF750Oa079112@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 15 Dec 2013 07:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259410 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 07:05:00 -0000 Author: luigi Date: Sun Dec 15 07:04:59 2013 New Revision: 259410 URL: http://svnweb.freebsd.org/changeset/base/259410 Log: revise the helper functions to lookup binaries and their shared libraries. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun Dec 15 04:28:20 2013 (r259409) +++ head/release/picobsd/build/picobsd Sun Dec 15 07:04:59 2013 (r259410) @@ -91,7 +91,7 @@ log() { # message # unconditionally log and wait for input logverbose() { # message local foo - printf "\n*** %s\n" "$*" + printf "\n*** %s\n" "$*" >&2 read -p "=== Press enter to continue" foo return 0 } @@ -570,71 +570,89 @@ do_links() { # rootdir varname # cp -p ${u_progs} ${dst}/libexec # ignore errors # } +# find programs and required libraries. Accept -L libs -P path +# if no argument default to objdir/SHLIBDIRPREFIX for both find_progs() { # programs - local pass i old_libs="" tmp o="" - if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path - o="-P $2"; shift; shift - fi - # Result returned in global variables - u_libs="" ; u_progs="`find_progs_helper $*`" + # logverbose "find_progs: called with $*" + local i=`realpath ${o_objdir:-${_SHLIBDIRPREFIX}/..}` + # default values for -L and -P + local dir="-P $i" + local ldir="-L $i" + + while [ "$1" != "" ] ; do + if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path + ldir="-L $2"; shift; shift + elif [ x"$1" = "x-P" -a -d "$2" ] ; then # set prog search path + dir="-P $2"; shift; shift + else + break + fi + done + + # Results are returned in global variables + u_libs="" + u_progs="`find_progs_helper $dir $*`" [ -z "${u_progs}" ] && return 1 # not found, error - # use objdump to find libraries. Iterate to fetch recursive - # dependencies. - tmp="${u_progs}" ; pass=1 + + # use objdump to find libraries. + # Iterate to fetch recursive dependencies. + local tmp="${u_progs}" + local old_libs="" + local pass=1 while [ $pass -lt 10 ] ; do pass=$(($pass + 1)) i="`objdump -x ${tmp} | \ - awk '$1 == "NEEDED" { print $2 }' | sort | uniq`" + awk '$1 == "NEEDED" { print $2 }' | sort | uniq | tr '\n' ' '`" if [ "$old_libs" = "$i" ] ; then - log "libraries for: $my_progs ($u_progs) are ($i) $u_libs" - log "--- done find_progs ---" + # logverbose "find_progs: have `echo ${u_libs} | wc -w`/`echo ${i} | wc -w` libraries for: $my_progs ($u_progs)" + # logverbose "they are ($i) $u_libs" return 0 else # logverbose "old--- $old_libs --- new +++ $i +++" fi - u_libs="`find_progs_helper $o $i`" + u_libs="`find_progs_helper $ldir $i`" old_libs="$i" tmp="$tmp $u_libs" done log "WARNING: Too many passes, giving up" } -find_progs_helper() { # programs - local dir=${o_objdir:-${_SHLIBDIRPREFIX}/..} - local ldir="" - if [ x"$1" = "x-P" -a -d "$2" ] ; then # set path - ldir=$2; shift; shift - fi - local progs="$*" - local subdirs=". local/bin local/sbin local/lib local/libexec \ - bin sbin usr.bin usr.sbin libexec lib \ - gnu/usr.bin gnu/lib \ - secure/usr.bin secure/usr.sbin secure/libexec secure/lib" - local names="" # files to search - local o="" +# prints to stdout files and libs in the search paths +find_progs_helper() { # first arg is either -P or -L + local ty=$1 dir=$2 ; shift; shift + local progs="`echo $* | tr ' ' '\n' | sort -u | tr '\n' ' '`" + # first, extract absolute pathnames or files in this directory + + # accumulate others in $names + local names="" local i for i in $progs ; do - # full pathnames are just listed - [ -f "$i" ] && echo $i && continue - names="${names} ${o} -name $i" - o="-o" + [ -f "$i" ] && echo `realpath $i` && continue + names="${names} $i" done + # if nothing left, we are done [ -z "${names}" ] && return 0 - local places="" # places to search - for i in $subdirs ; do - [ -d "${dir}/${i}" ] && places="${places} ${dir}/${i}" - done - if [ -n "${ldir}" ] ; then - for i in $subdirs ; do - [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" - done + + local depth p + local places="" # places to search + if [ x-P = "x$ty" ] ; then # search programs + depth=2 + p=". local/bin local/sbin local/libexec \ + bin sbin usr/bin usr/sbin libexec gnu/usr.bin \ + secure/usr.bin secure/usr.sbin secure/libexec " + else + depth=3 + p="lib usr/lib gnu/lib secure/lib" fi - for i in $progs ; do - # full pathnames are just listed - [ -f "$i" ] && echo $i && continue - find ${places} -maxdepth 3 -type f -name ${i} | head -1 + for i in $p ; do + i="${dir}/${i}" + [ -d "${i}" ] && places="${places} `realpath ${i}`" + done + # logverbose "--- looking into $places" + places=`echo ${places} | tr ' ' '\n' | sort -u` + for i in $names ; do + find ${places} -maxdepth $depth -type f -name ${i} | head -1 done - # use maxdepth 3 because some libs are way down } # Populate the memory filesystem with binaries and non-variable @@ -746,6 +764,7 @@ populate_mfs_tree() { fi log "for a shared 'crunch' take libraries and dynamic loader as well" + # /stand/crunch is our main binary, we extract its libs find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 07:07:13 2013 Return-Path: Delivered-To: svn-src-all@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 D6F20F5E; Sun, 15 Dec 2013 07:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C28321F84; Sun, 15 Dec 2013 07:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF77DJg079506; Sun, 15 Dec 2013 07:07:13 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF77D2g079503; Sun, 15 Dec 2013 07:07:13 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201312150707.rBF77D2g079503@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 15 Dec 2013 07:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259411 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 07:07:13 -0000 Author: alfred Date: Sun Dec 15 07:07:13 2013 New Revision: 259411 URL: http://svnweb.freebsd.org/changeset/base/259411 Log: Defer start/stop port to workqueues. We need to do this because the Linux compat layer uses sx(9) for mutex, however the lagg code uses rmlocks and calls into the mellanox driver. This causes deadlock due to sleeping while holding a rmlock. Submitted by: Shahar Klein (shahark mellanox.com) MFC After: 3 days. Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/mlx4_en.h Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Dec 15 07:04:59 2013 (r259410) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Sun Dec 15 07:07:13 2013 (r259411) @@ -153,6 +153,19 @@ restart: return (i); } +static void mlx4_en_stop_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->stop_port_task); +} + +static void mlx4_en_start_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->start_port_task); +} static void mlx4_en_set_multicast(struct net_device *dev) { @@ -473,6 +486,7 @@ static void mlx4_en_do_get_stats(struct queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); } + mlx4_en_QUERY_PORT(priv->mdev, priv->port); mutex_unlock(&mdev->state_lock); } @@ -498,8 +512,31 @@ static void mlx4_en_linkstate(struct wor mutex_unlock(&mdev->state_lock); } +static void mlx4_en_lock_and_stop_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + stop_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_stop_port(dev); + mutex_unlock(&mdev->state_lock); +} + +static void mlx4_en_lock_and_start_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + start_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_start_port(dev); + mutex_unlock(&mdev->state_lock); +} -int mlx4_en_start_port(struct net_device *dev) +int mlx4_en_do_start_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -691,7 +728,7 @@ cq_err: } -void mlx4_en_stop_port(struct net_device *dev) +void mlx4_en_do_stop_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -761,8 +798,8 @@ reset: mutex_lock(&mdev->state_lock); if (priv->port_up) { - mlx4_en_stop_port(dev); - if (mlx4_en_start_port(dev)) + mlx4_en_do_stop_port(dev); + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed restarting port %d\n", priv->port); } mutex_unlock(&mdev->state_lock); @@ -793,7 +830,7 @@ mlx4_en_init_locked(struct mlx4_en_priv dev = priv->dev; mdev = priv->mdev; if (dev->if_drv_flags & IFF_DRV_RUNNING) - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); if (!mdev->device_up) { en_err(priv, "Cannot open - device down/disabled\n"); @@ -816,7 +853,7 @@ mlx4_en_init_locked(struct mlx4_en_priv } mlx4_en_set_default_moderation(priv); - if (mlx4_en_start_port(dev)) + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed starting port:%d\n", priv->port); } @@ -905,7 +942,7 @@ void mlx4_en_destroy_netdev(struct net_d mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); mutex_lock(&mdev->state_lock); - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mutex_unlock(&mdev->state_lock); cancel_delayed_work(&priv->stats_task); @@ -925,7 +962,6 @@ void mlx4_en_destroy_netdev(struct net_d mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); - mtx_destroy(&priv->ioctl_lock.m); kfree(priv); if_free(dev); } @@ -951,9 +987,9 @@ static int mlx4_en_change_mtu(struct net * the port */ en_dbg(DRV, priv, "Change MTU called with card down!?\n"); } else { - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mlx4_en_set_default_moderation(priv); - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) { en_err(priv, "Failed restarting port:%d\n", priv->port); @@ -973,8 +1009,13 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); + /* + * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a + * non-sleepable lock. + * I moved it to the periodic mlx4_en_do_get_stats. + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + return (active); + */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1078,7 +1119,6 @@ static int mlx4_en_ioctl(struct ifnet *d error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: - mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) mlx4_en_start_port(dev); @@ -1087,16 +1127,24 @@ static int mlx4_en_ioctl(struct ifnet *d } else { if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); - if_link_state_change(dev, LINK_STATE_DOWN); + if_link_state_change(dev, LINK_STATE_DOWN); + /* + * Since mlx4_en_stop_port is defered we + * have to wait till it's finished. + */ + for (int count=0; count<10; count++) { + if (dev->if_drv_flags & IFF_DRV_RUNNING) { + DELAY(20000); + } else { + break; + } + } } } - mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: - spin_lock(&priv->ioctl_lock); mlx4_en_set_multicast(dev); - spin_unlock(&priv->ioctl_lock); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: @@ -1153,7 +1201,7 @@ static int mlx4_en_set_ring_size(struct mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); } mlx4_en_free_resources(priv); priv->prof->tx_ring_size = tx_size; @@ -1164,7 +1212,7 @@ static int mlx4_en_set_ring_size(struct goto out; } if (port_up) { - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) en_err(priv, "Failed starting port\n"); } @@ -1256,7 +1304,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(priv->dev); + mlx4_en_do_stop_port(priv->dev); } mlx4_en_free_resources(priv); priv->tx_ring_num = tx_ring_num; @@ -1265,7 +1313,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN if (error) en_err(priv, "Failed reallocating port resources\n"); if (error == 0 && port_up) { - error = -mlx4_en_start_port(priv->dev); + error = -mlx4_en_do_start_port(priv->dev); if (error) en_err(priv, "Failed starting port\n"); } @@ -1517,8 +1565,9 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->msg_enable = MLX4_EN_MSG_LEVEL; priv->ip_reasm = priv->mdev->profile.ip_reasm; mtx_init(&priv->stats_lock.m, "mlx4 stats", NULL, MTX_DEF); - mtx_init(&priv->ioctl_lock.m, "mlx4 ioctl", NULL, MTX_DEF); mtx_init(&priv->vlan_lock.m, "mlx4 vlan", NULL, MTX_DEF); + INIT_WORK(&priv->start_port_task, mlx4_en_lock_and_start_port); + INIT_WORK(&priv->stop_port_task, mlx4_en_lock_and_stop_port); INIT_WORK(&priv->mcast_task, mlx4_en_do_set_multicast); INIT_WORK(&priv->watchdog_task, mlx4_en_restart); INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mlx4_en.h Sun Dec 15 07:04:59 2013 (r259410) +++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h Sun Dec 15 07:07:13 2013 (r259411) @@ -493,7 +493,6 @@ struct mlx4_en_priv { spinlock_t vlan_lock; struct mlx4_en_port_state port_state; spinlock_t stats_lock; - spinlock_t ioctl_lock; unsigned long last_moder_packets[MAX_RX_RINGS]; unsigned long last_moder_tx_packets; @@ -546,6 +545,8 @@ struct mlx4_en_priv { struct mlx4_en_cq rx_cq[MAX_RX_RINGS]; struct mlx4_en_tx_hash_entry tx_hash[MLX4_EN_TX_HASH_SIZE]; struct work_struct mcast_task; + struct work_struct start_port_task; + struct work_struct stop_port_task; struct work_struct watchdog_task; struct work_struct linkstate_task; struct delayed_work stats_task; @@ -580,8 +581,8 @@ void mlx4_en_destroy_netdev(struct net_d int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, struct mlx4_en_port_profile *prof); -int mlx4_en_start_port(struct net_device *dev); -void mlx4_en_stop_port(struct net_device *dev); +int mlx4_en_do_start_port(struct net_device *dev); +void mlx4_en_do_stop_port(struct net_device *dev); void mlx4_en_free_resources(struct mlx4_en_priv *priv); int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 08:37:25 2013 Return-Path: Delivered-To: svn-src-all@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 5C10BA39; Sun, 15 Dec 2013 08:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46E8813D6; Sun, 15 Dec 2013 08:37:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF8bPKw011584; Sun, 15 Dec 2013 08:37:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF8bON1011577; Sun, 15 Dec 2013 08:37:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312150837.rBF8bON1011577@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 15 Dec 2013 08:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259412 - in head/sys: conf dev/netmap modules/netmap net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 08:37:25 -0000 Author: luigi Date: Sun Dec 15 08:37:24 2013 New Revision: 259412 URL: http://svnweb.freebsd.org/changeset/base/259412 Log: split netmap code according to functions: - netmap.c base code - netmap_freebsd.c FreeBSD-specific code - netmap_generic.c emulate netmap over standard drivers - netmap_mbq.c simple mbuf tailq - netmap_mem2.c memory management - netmap_vale.c VALE switch simplify devce-specific code Added: head/sys/dev/netmap/netmap_freebsd.c (contents, props changed) head/sys/dev/netmap/netmap_generic.c (contents, props changed) head/sys/dev/netmap/netmap_mbq.c (contents, props changed) head/sys/dev/netmap/netmap_mbq.h (contents, props changed) head/sys/dev/netmap/netmap_vale.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/modules/netmap/Makefile head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/conf/files Sun Dec 15 08:37:24 2013 (r259412) @@ -1880,7 +1880,11 @@ dev/nand/nfc_if.m optional nand dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/netmap.c optional netmap +dev/netmap/netmap_freebsd.c optional netmap +dev/netmap/netmap_generic.c optional netmap +dev/netmap/netmap_mbq.c optional netmap dev/netmap/netmap_mem2.c optional netmap +dev/netmap/netmap_vale.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge \ Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_em_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -26,7 +26,7 @@ /* * $FreeBSD$ * - * netmap support for em. + * netmap support for: em. * * For more details on netmap support please see ixgbe_netmap.h */ @@ -39,10 +39,6 @@ #include -static void em_netmap_block_tasks(struct adapter *); -static void em_netmap_unblock_tasks(struct adapter *); - - // XXX do we need to block/unblock the tasks ? static void em_netmap_block_tasks(struct adapter *adapter) @@ -85,45 +81,31 @@ em_netmap_unblock_tasks(struct adapter * /* - * Register/unregister routine + * Register/unregister. We are already under netmap lock. */ static int -em_netmap_reg(struct ifnet *ifp, int onoff) +em_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; /* no netmap support here */ + EM_CORE_LOCK(adapter); em_disable_intr(adapter); /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); em_netmap_block_tasks(adapter); - + /* enable or disable flags and callbacks in na and ifp */ if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - em_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + nm_set_native_flags(na); } else { -fail: - /* return to non-netmap mode */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - em_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } + em_init_locked(adapter); /* also enable intr */ em_netmap_unblock_tasks(adapter); - return (error); + EM_CORE_UNLOCK(adapter); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -131,93 +113,103 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +em_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ u_int report_frequency = kring->nkr_num_slots >> 1; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); /* - * Process new packets to send. j is the current index in the - * netmap ring, l is the corresponding index in the NIC ring. + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (j != k) { /* we have new packets to send */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - struct e1000_tx_desc *curr = &txr->tx_base[l]; - struct em_buffer *txbuf = &txr->tx_buffers[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_TXD_CMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } + /* device-specific */ + struct e1000_tx_desc *curr = &txr->tx_base[nic_i]; + struct em_buffer *txbuf = &txr->tx_buffers[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_TXD_CMD_RS : 0; + + NM_CHECK_ADDR_LEN(addr, len); - slot->flags &= ~NS_REPORT; if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->upper.data = 0; curr->lower.data = htole32(adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } - kring->nr_hwcur = k; /* the saved ring->cur */ - kring->nr_hwavail -= n; + kring->nr_hwcur = cur; /* the saved ring->cur */ + /* decrease avail by # of packets sent minus previous ones */ + kring->nr_hwavail -= new_slots; + /* synchronize the NIC ring */ bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), l); + /* (re)start the tx unit up to slot nic_i (excluded) */ + E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), nic_i); } - if (n == 0 || kring->nr_hwavail < 1) { + /* + * Second part: reclaim buffers for completed transmissions. + */ + if (flags & NAF_FORCE_RECLAIM || kring->nr_hwavail < 1) { int delta; /* record completed transmissions using TDH */ - l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ - D("TDH wrap %d", l); - l -= kring->nkr_num_slots; + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ + D("TDH wrap %d", nic_i); + nic_i -= kring->nkr_num_slots; } - delta = l - txr->next_to_clean; + delta = nic_i - txr->next_to_clean; if (delta) { /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; - txr->next_to_clean = l; + txr->next_to_clean = nic_i; kring->nr_hwavail += delta; } } - /* update avail to what the kernel knows */ - ring->avail = kring->nr_hwavail; + + nm_txsync_finalize(kring, cur); return 0; } @@ -227,19 +219,23 @@ em_netmap_txsync(struct ifnet *ifp, u_in * Reconcile kernel and user view of the receive ring. */ static int -em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) +em_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, l, n, lim = kring->nkr_num_slots - 1; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, resvd; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_rxsync_prologue(kring, &resvd); /* cur + res */ int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - u_int k = ring->cur, resvd = ring->reserved; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + + if (cur > lim) return netmap_ring_reinit(kring); /* XXX check sync modes */ @@ -247,84 +243,85 @@ em_netmap_rxsync(struct ifnet *ifp, u_in BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* - * Import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring. + * First part: import newly received packets. */ - l = rxr->next_to_check; - j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { uint16_t slot_flags = kring->nkr_slot_flags; + nic_i = rxr->next_to_check; + nm_i = netmap_idx_n2k(kring, nic_i); + for (n = 0; ; n++) { - struct e1000_rx_desc *curr = &rxr->rx_base[l]; + struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; uint32_t staterr = le32toh(curr->status); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - ring->slot[j].len = le16toh(curr->length); - ring->slot[j].flags = slot_flags; - bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, + ring->slot[nm_i].len = le16toh(curr->length); + ring->slot[nm_i].flags = slot_flags; + bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[nic_i].map, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; + nm_i = nm_next(nm_i, lim); /* make sure next_to_refresh follows next_to_check */ - rxr->next_to_refresh = l; // XXX - l = (l == lim) ? 0 : l + 1; + rxr->next_to_refresh = nic_i; // XXX + nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ - rxr->next_to_check = l; + rxr->next_to_check = nic_i; kring->nr_hwavail += n; } kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has released */ - j = kring->nr_hwcur; /* netmap ring index */ - if (resvd > 0) { - if (resvd + ring->avail >= lim + 1) { - D("XXX invalid reserve/avail %d %d", resvd, ring->avail); - ring->reserved = resvd = 0; // XXX panic... - } - k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; - } - if (j != k) { /* userspace has released some packets. */ - l = netmap_idx_k2n(kring, j); /* NIC ring index */ - for (n = 0; j != k; n++) { - struct netmap_slot *slot = &ring->slot[j]; - struct e1000_rx_desc *curr = &rxr->rx_base[l]; - struct em_buffer *rxbuf = &rxr->rx_buffers[l]; + /* + * Second part: skip past packets that userspace has released. + */ + nm_i = kring->nr_hwcur; + if (nm_i != cur) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(slot, &paddr); - if (addr == netmap_buffer_base) { /* bad buf */ - return netmap_ring_reinit(kring); - } + struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; + struct em_buffer *rxbuf = &rxr->rx_buffers[nic_i]; + + if (addr == netmap_buffer_base) /* bad buf */ + goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ + curr->buffer_addr = htole64(paddr); netmap_reload_map(rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->status = 0; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } kring->nr_hwavail -= n; - kring->nr_hwcur = k; + kring->nr_hwcur = cur; + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* * IMPORTANT: we must leave one free slot in the ring, - * so move l back by one unit + * so move nic_i back by one unit */ - l = (l == 0) ? lim : l - 1; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); + nic_i = (nic_i == 0) ? lim : nic_i - 1; + E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), nic_i); } - /* tell userspace that there are new packets */ + + /* tell userspace that there might be new packets */ ring->avail = kring->nr_hwavail - resvd; + return 0; + +ring_reset: + return netmap_ring_reinit(kring); } @@ -342,7 +339,8 @@ em_netmap_attach(struct adapter *adapter na.nm_txsync = em_netmap_txsync; na.nm_rxsync = em_netmap_rxsync; na.nm_register = em_netmap_reg; - netmap_attach(&na, adapter->num_queues); + na.num_tx_rings = na.num_rx_rings = adapter->num_queues; + netmap_attach(&na); } /* end of file */ Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_igb_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -37,44 +37,43 @@ #include /* vtophys ? */ #include +/* + * Adaptation to different versions of the driver. + */ + +#ifndef IGB_MEDIA_RESET +/* at the same time as IGB_MEDIA_RESET was defined, the + * tx buffer descriptor was renamed, so use this to revert + * back to the old name. + */ +#define igb_tx_buf igb_tx_buffer +#endif + /* - * register-unregister routine + * Register/unregister. We are already under netmap lock. */ static int -igb_netmap_reg(struct ifnet *ifp, int onoff) +igb_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; /* no netmap support here */ + IGB_CORE_LOCK(adapter); igb_disable_intr(adapter); /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* enable or disable flags and callbacks in na and ifp */ if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - igb_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + nm_set_native_flags(na); } else { -fail: - /* restore if_transmit */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - igb_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } - return (error); + igb_init_locked(adapter); /* also enable intr */ + IGB_CORE_UNLOCK(adapter); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -82,68 +81,62 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +igb_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ u_int report_frequency = kring->nkr_num_slots >> 1; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + /* 82575 needs the queue index added */ + u32 olinfo_status = + (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; + + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD); - /* check for new packets to send. - * j indexes the netmap ring, l indexes the nic ring, and - * j = kring->nr_hwcur, l = E1000_TDT (not tracked), - * j == (l + kring->nkr_hwofs) % ring_size + /* + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (j != k) { /* we have new packets to send */ - /* 82575 needs the queue index added */ - u32 olinfo_status = - (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; - - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - union e1000_adv_tx_desc *curr = - (union e1000_adv_tx_desc *)&txr->tx_base[l]; -#ifndef IGB_MEDIA_RESET -/* at the same time as IGB_MEDIA_RESET was defined, the - * tx buffer descriptor was renamed, so use this to revert - * back to the old name. - */ -#define igb_tx_buf igb_tx_buffer -#endif - struct igb_tx_buf *txbuf = &txr->tx_buffers[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_ADVTXD_DCMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } + /* device-specific */ + union e1000_adv_tx_desc *curr = + (union e1000_adv_tx_desc *)&txr->tx_base[nic_i]; + struct igb_tx_buf *txbuf = &txr->tx_buffers[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_ADVTXD_DCMD_RS : 0; + + NM_CHECK_ADDR_LEN(addr, len); - slot->flags &= ~NS_REPORT; if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->read.buffer_addr = htole64(paddr); // XXX check olinfo and cmd_type_len curr->read.olinfo_status = @@ -151,48 +144,56 @@ igb_netmap_txsync(struct ifnet *ifp, u_i (len<< E1000_ADVTXD_PAYLEN_SHIFT)); curr->read.cmd_type_len = htole32(len | E1000_ADVTXD_DTYP_DATA | - E1000_ADVTXD_DCMD_IFCS | - E1000_ADVTXD_DCMD_DEXT | - E1000_ADVTXD_DCMD_EOP | flags); + E1000_ADVTXD_DCMD_IFCS | + E1000_ADVTXD_DCMD_DEXT | + E1000_ADVTXD_DCMD_EOP | flags); + /* make sure changes to the buffer are synced */ bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } - kring->nr_hwcur = k; /* the saved ring->cur */ - kring->nr_hwavail -= n; + kring->nr_hwcur = cur; /* the saved ring->cur */ + /* decrease avail by # of packets sent minus previous ones */ + kring->nr_hwavail -= new_slots; /* Set the watchdog XXX ? */ txr->queue_status = IGB_QUEUE_WORKING; txr->watchdog_time = ticks; + /* synchronize the NIC ring */ bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), l); + /* (re)start the tx unit up to slot nic_i (excluded) */ + E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), nic_i); } - if (n == 0 || kring->nr_hwavail < 1) { + /* + * Second part: reclaim buffers for completed transmissions. + */ + if (flags & NAF_FORCE_RECLAIM || kring->nr_hwavail < 1) { int delta; /* record completed transmissions using TDH */ - l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ - D("TDH wrap %d", l); - l -= kring->nkr_num_slots; + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ + D("TDH wrap %d", nic_i); + nic_i -= kring->nkr_num_slots; } - delta = l - txr->next_to_clean; + delta = nic_i - txr->next_to_clean; if (delta) { /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; - txr->next_to_clean = l; + txr->next_to_clean = nic_i; kring->nr_hwavail += delta; } } - /* update avail to what the kernel knows */ - ring->avail = kring->nr_hwavail; + + nm_txsync_finalize(kring, cur); return 0; } @@ -202,101 +203,107 @@ igb_netmap_txsync(struct ifnet *ifp, u_i * Reconcile kernel and user view of the receive ring. */ static int -igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) +igb_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, l, n, lim = kring->nkr_num_slots - 1; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, resvd; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_rxsync_prologue(kring, &resvd); /* cur + res */ int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; - u_int k = ring->cur, resvd = ring->reserved; - k = ring->cur; - if (k > lim) + /* device-specific */ + struct adapter *adapter = ifp->if_softc; + struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + + if (cur > lim) return netmap_ring_reinit(kring); /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* - * import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring. + * First part: import newly received packets. */ - l = rxr->next_to_check; - j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { uint16_t slot_flags = kring->nkr_slot_flags; + nic_i = rxr->next_to_check; + nm_i = netmap_idx_n2k(kring, nic_i); + for (n = 0; ; n++) { - union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; + union e1000_adv_rx_desc *curr = &rxr->rx_base[nic_i]; uint32_t staterr = le32toh(curr->wb.upper.status_error); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - ring->slot[j].len = le16toh(curr->wb.upper.length); - ring->slot[j].flags = slot_flags; + ring->slot[nm_i].len = le16toh(curr->wb.upper.length); + ring->slot[nm_i].flags = slot_flags; bus_dmamap_sync(rxr->ptag, - rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + rxr->rx_buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ - rxr->next_to_check = l; + rxr->next_to_check = nic_i; kring->nr_hwavail += n; } kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has released */ - j = kring->nr_hwcur; /* netmap ring index */ - if (resvd > 0) { - if (resvd + ring->avail >= lim + 1) { - D("XXX invalid reserve/avail %d %d", resvd, ring->avail); - ring->reserved = resvd = 0; // XXX panic... - } - k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; - } - if (j != k) { /* userspace has released some packets. */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - struct netmap_slot *slot = ring->slot + j; - union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; - struct igb_rx_buf *rxbuf = rxr->rx_buffers + l; + /* + * Second part: skip past packets that userspace has released. + */ + nm_i = kring->nr_hwcur; + if (nm_i != cur) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; void *addr = PNMB(slot, &paddr); - if (addr == netmap_buffer_base) { /* bad buf */ - return netmap_ring_reinit(kring); - } + union e1000_adv_rx_desc *curr = &rxr->rx_base[nic_i]; + struct igb_rx_buf *rxbuf = &rxr->rx_buffers[nic_i]; + + if (addr == netmap_buffer_base) /* bad buf */ + goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } - curr->read.pkt_addr = htole64(paddr); curr->wb.upper.status_error = 0; + curr->read.pkt_addr = htole64(paddr); bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; + BUS_DMASYNC_PREREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); } kring->nr_hwavail -= n; - kring->nr_hwcur = k; + kring->nr_hwcur = cur; + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* * IMPORTANT: we must leave one free slot in the ring, - * so move l back by one unit + * so move nic_i back by one unit */ - l = (l == 0) ? lim : l - 1; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); + nic_i = (nic_i == 0) ? lim : nic_i - 1; + E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), nic_i); } - /* tell userspace that there are new packets */ + + /* tell userspace that there might be new packets */ ring->avail = kring->nr_hwavail - resvd; + return 0; + +ring_reset: + return netmap_ring_reinit(kring); } @@ -314,6 +321,8 @@ igb_netmap_attach(struct adapter *adapte na.nm_txsync = igb_netmap_txsync; na.nm_rxsync = igb_netmap_rxsync; na.nm_register = igb_netmap_reg; - netmap_attach(&na, adapter->num_queues); -} + na.num_tx_rings = na.num_rx_rings = adapter->num_queues; + netmap_attach(&na); +} + /* end of file */ Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Sun Dec 15 07:07:13 2013 (r259411) +++ head/sys/dev/netmap/if_lem_netmap.h Sun Dec 15 08:37:24 2013 (r259412) @@ -27,11 +27,12 @@ /* * $FreeBSD$ * - * netmap support for "lem" + * netmap support for: lem * * For details on netmap support please see ixgbe_netmap.h */ + #include #include #include @@ -40,17 +41,13 @@ /* - * Register/unregister + * Register/unregister. We are already under netmap lock. */ static int -lem_netmap_reg(struct ifnet *ifp, int onoff) +lem_netmap_reg(struct netmap_adapter *na, int onoff) { + struct ifnet *ifp = na->ifp; struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); - int error = 0; - - if (na == NULL) - return EINVAL; EM_CORE_LOCK(adapter); @@ -64,24 +61,14 @@ lem_netmap_reg(struct ifnet *ifp, int on taskqueue_drain(adapter->tq, &adapter->rxtx_task); taskqueue_drain(adapter->tq, &adapter->link_task); #endif /* !EM_LEGCY_IRQ */ - if (onoff) { - ifp->if_capenable |= IFCAP_NETMAP; - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - - lem_init_locked(adapter); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { - error = ENOMEM; - goto fail; - } + /* enable or disable flags and callbacks in na and ifp */ + if (onoff) { + nm_set_native_flags(na); } else { -fail: - /* return to non-netmap mode */ - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; - lem_init_locked(adapter); /* also enable intr */ + nm_clear_native_flags(na); } + lem_init_locked(adapter); /* also enable intr */ #ifndef EM_LEGACY_IRQ taskqueue_unblock(adapter->tq); // XXX do we need this ? @@ -89,7 +76,7 @@ fail: EM_CORE_UNLOCK(adapter); - return (error); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); } @@ -97,108 +84,102 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -lem_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) +lem_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) { - struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(ifp); + struct ifnet *ifp = na->ifp; struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; - + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n, new_slots; + u_int const lim = kring->nkr_num_slots - 1; + u_int const cur = nm_txsync_prologue(kring, &new_slots); /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; + + /* device-specific */ + struct adapter *adapter = ifp->if_softc; - ND("%s: hwofs %d, hwcur %d hwavail %d lease %d cur %d avail %d", - ifp->if_xname, - kring->nkr_hwofs, kring->nr_hwcur, kring->nr_hwavail, - kring->nkr_hwlease, - ring->cur, ring->avail); - /* take a copy of ring->cur now, and never read it again */ - k = ring->cur; - if (k > lim) + if (cur > lim) /* error checking in nm_txsync_prologue() */ return netmap_ring_reinit(kring); bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); + /* - * Process new packets to send. j is the current index in the - * netmap ring, l is the corresponding index in the NIC ring. + * First part: process new packets to send. */ - j = kring->nr_hwcur; - if (netmap_verbose > 255) - RD(5, "device %s send %d->%d", ifp->if_xname, j, k); - if (j != k) { /* we have new packets to send */ - l = netmap_idx_k2n(kring, j); - for (n = 0; j != k; n++) { - /* slot is the current slot in the netmap ring */ - struct netmap_slot *slot = &ring->slot[j]; - /* curr is the current slot in the nic ring */ - struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; - struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; - int flags = ((slot->flags & NS_REPORT) || - j == 0 || j == report_frequency) ? - E1000_TXD_CMD_RS : 0; + + nm_i = kring->nr_hwcur; + if (nm_i != cur) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != cur; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; uint64_t paddr; void *addr = PNMB(slot, &paddr); - u_int len = slot->len; - if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - return netmap_ring_reinit(kring); - } - ND("slot %d NIC %d %s", j, l, nm_dump_buf(addr, len, 128, NULL)); + /* device-specific */ + struct e1000_tx_desc *curr = &adapter->tx_desc_base[nic_i]; + struct em_buffer *txbuf = &adapter->tx_buffer_area[nic_i]; + int flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + E1000_TXD_CMD_RS : 0; - slot->flags &= ~NS_REPORT; - if (1 || slot->flags & NS_BUF_CHANGED) { + NM_CHECK_ADDR_LEN(addr, len); + + if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(adapter->txtag, txbuf->map, addr); curr->buffer_addr = htole64(paddr); - slot->flags &= ~NS_BUF_CHANGED; + netmap_reload_map(adapter->txtag, txbuf->map, addr); } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ curr->upper.data = 0; - curr->lower.data = - htole32( adapter->txd_cmd | len | + curr->lower.data = htole32(adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); - - ND("len %d kring %d nic %d", len, j, l); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 08:52:16 2013 Return-Path: Delivered-To: svn-src-all@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 E159BC13; Sun, 15 Dec 2013 08:52:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDDE214F8; Sun, 15 Dec 2013 08:52:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBF8qGG8018018; Sun, 15 Dec 2013 08:52:16 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBF8qGDf018017; Sun, 15 Dec 2013 08:52:16 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201312150852.rBF8qGDf018017@svn.freebsd.org> From: Joel Dahl Date: Sun, 15 Dec 2013 08:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259413 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 08:52:17 -0000 Author: joel (doc committer) Date: Sun Dec 15 08:52:16 2013 New Revision: 259413 URL: http://svnweb.freebsd.org/changeset/base/259413 Log: mdoc: sort SEE ALSO. Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sun Dec 15 08:37:24 2013 (r259412) +++ head/usr.sbin/bhyve/bhyve.8 Sun Dec 15 08:52:16 2013 (r259413) @@ -288,8 +288,8 @@ bhyve -c 4 \e\ .Xr nmdm 4 , .Xr vmm 4 , .Xr ethers 5 , -.Xr bhyveload 8 , -.Xr bhyvectl 8 +.Xr bhyvectl 8 , +.Xr bhyveload 8 .Sh HISTORY .Nm first appeared in From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 14:01:21 2013 Return-Path: Delivered-To: svn-src-all@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 C65C5825; Sun, 15 Dec 2013 14:01:21 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3470B16E7; Sun, 15 Dec 2013 14:01:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBFE1F9h053545; Sun, 15 Dec 2013 16:01:15 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBFE1F9h053545 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBFE1FqG053544; Sun, 15 Dec 2013 16:01:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 15 Dec 2013 16:01:15 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi Message-ID: <20131215140115.GM59496@kib.kiev.ua> References: <201312142207.rBEM7fnW075560@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5R8EFYLX8234Xn45" Content-Disposition: inline In-Reply-To: <201312142207.rBEM7fnW075560@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 14:01:21 -0000 --5R8EFYLX8234Xn45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Dec 14 22:07:40 2013 > New Revision: 259397 > URL: http://svnweb.freebsd.org/changeset/base/259397 >=20 > Log: > Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the ke= rnel > support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI > (though not API) is changed. No behavior is changed relative to r257345 > except that LUNs with non-zero high 32 bits will no longer be ignored > during device enumeration for SIMs that have set PIM_EXTLUNS. Does libcam.so version need to be bumped ? --5R8EFYLX8234Xn45 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSrbYqAAoJEJDCuSvBvK1BglkP+gKL05HB4AsoFOQYHdcFZWUb x60h2QgP4qnwV4Q3c5k8xPv0e5HM7q9XqcEIVg7407wyxhf+VMdkJ4IqqIRftcj2 kRefwU/3XVTfE5aeNDa8W80pXH0sCnzDiKKnDtpU4qR7XoJLgookVLiQdpkMCfhm Lz00QkDyjXafbhim5wwXeohSj/yTWaDnCgyK/aTPsoYJwq0HbgHtFVakEMl3Iix4 NThTWGmwTd7VpUdn7rJ8IqxJWI8RrXj1HM4w8+D1TQ4usx1LvHh0d/JSPqOAl1Ys +M9wujKpA+3uMkXWoYq9QhXUD5jXjmegR08rzofIytl5yU1Z+nNQ4glz5KzwGtIP 6xk/RymFrL+cv9tFeICqnbjsmHtMxI6pcvycQrjSVPuNx3vD7uTfw2mN68zWv4am HPW2D7pghRLoNqAGTi+4OXHzsf2ti8m3gQ1ORD4KaGev3YXo+qZX1DH+uEDeyFgd umkaYWXiJ4jOQyEuLAL01yU8fuZQ1EF/Z/wDnfSVK5WRL//59zoTCXBKEg5H5Sb1 S4VYJd6RHdiBoiHLy6zg3OfKCXnGGov7Yk+7HjU0nNQT806z0Nw8JU/DpjGGLs4Q Y1pQGyoh+7h9bm5jDau7NIN19WAyEb8lc2E7A4l92BKzg90pBNq6kUZSxksN0X59 CfF7m50C5YnR1cEhRL5P =4IkZ -----END PGP SIGNATURE----- --5R8EFYLX8234Xn45-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 15:45:52 2013 Return-Path: Delivered-To: svn-src-all@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 01629C2B; Sun, 15 Dec 2013 15:45:52 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C214E1D2E; Sun, 15 Dec 2013 15:45:51 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXU00200U756A00@smtpauth3.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:45:44 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.15.153615, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXU00G81UG6JO10@smtpauth3.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:45:43 -0600 (CST) Message-id: <52ADCEA6.80308@freebsd.org> Date: Sun, 15 Dec 2013 09:45:42 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Konstantin Belousov Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi References: <201312142207.rBEM7fnW075560@svn.freebsd.org> <20131215140115.GM59496@kib.kiev.ua> In-reply-to: <20131215140115.GM59496@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 15:45:52 -0000 On 12/15/13 08:01, Konstantin Belousov wrote: > On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sat Dec 14 22:07:40 2013 >> New Revision: 259397 >> URL: http://svnweb.freebsd.org/changeset/base/259397 >> >> Log: >> Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel >> support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI >> (though not API) is changed. No behavior is changed relative to r257345 >> except that LUNs with non-zero high 32 bits will no longer be ignored >> during device enumeration for SIMs that have set PIM_EXTLUNS. > Does libcam.so version need to be bumped ? Yes, it should have been. I'll go do this now. -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 15:51:06 2013 Return-Path: Delivered-To: svn-src-all@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 61FBAF6D; Sun, 15 Dec 2013 15:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBA41D9B; Sun, 15 Dec 2013 15:51:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFFp6vu071576; Sun, 15 Dec 2013 15:51:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFFp512071573; Sun, 15 Dec 2013 15:51:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312151551.rBFFp512071573@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Dec 2013 15:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259416 - in head: . lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 15:51:06 -0000 Author: nwhitehorn Date: Sun Dec 15 15:51:05 2013 New Revision: 259416 URL: http://svnweb.freebsd.org/changeset/base/259416 Log: Bump libcam shared library version forgotten in r259397. Submitted by: kib Modified: head/ObsoleteFiles.inc head/lib/libcam/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Dec 15 15:37:07 2013 (r259415) +++ head/ObsoleteFiles.inc Sun Dec 15 15:51:05 2013 (r259416) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20131215: libcam version bumped +OLD_LIBS+=lib/libcam.so.6 usr/lib32/libcam.so.6 # 20131202: libcapsicum and libcasper moved to /lib/ OLD_LIBS+=usr/lib/libcapsicum.so.0 OLD_LIBS+=usr/lib/libcasper.so.0 Modified: head/lib/libcam/Makefile ============================================================================== --- head/lib/libcam/Makefile Sun Dec 15 15:37:07 2013 (r259415) +++ head/lib/libcam/Makefile Sun Dec 15 15:51:05 2013 (r259416) @@ -42,6 +42,6 @@ MLINKS+= cam.3 cam_open_device.3 \ SDIR= ${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR} -I${SDIR} -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 .include From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 16:17:01 2013 Return-Path: Delivered-To: svn-src-all@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 D91AD9AF; Sun, 15 Dec 2013 16:17:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C541A1ED9; Sun, 15 Dec 2013 16:17:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFGH0gq080063; Sun, 15 Dec 2013 16:17:00 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFGH0cs080061; Sun, 15 Dec 2013 16:17:00 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201312151617.rBFGH0cs080061@svn.freebsd.org> From: Hiroki Sato Date: Sun, 15 Dec 2013 16:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259417 - head/usr.sbin/ypbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 16:17:01 -0000 Author: hrs Date: Sun Dec 15 16:17:00 2013 New Revision: 259417 URL: http://svnweb.freebsd.org/changeset/base/259417 Log: Replace Sun RPC license for TI-RPC library with a 3-clause BSD license, with the explicit permission of Sun Microsystems in 2009. The code in question in this file was copied from lib/libc/rpc/pmap_getport.c. Modified: head/usr.sbin/ypbind/yp_ping.c Modified: head/usr.sbin/ypbind/yp_ping.c ============================================================================== --- head/usr.sbin/ypbind/yp_ping.c Sun Dec 15 15:51:05 2013 (r259416) +++ head/usr.sbin/ypbind/yp_ping.c Sun Dec 15 16:17:00 2013 (r259417) @@ -30,35 +30,33 @@ * SUCH DAMAGE. */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. +/*- + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ - #if 0 #ifndef lint static char *sccsid = "@(#)from: clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 16:40:22 2013 Return-Path: Delivered-To: svn-src-all@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 17E543DB; Sun, 15 Dec 2013 16:40:22 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D914B1037; Sun, 15 Dec 2013 16:40:21 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXU00M00TIFWH00@smtpauth2.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:40:12 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.15.152715, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXU00FKQU6ZU100@smtpauth2.wiscmail.wisc.edu>; Sun, 15 Dec 2013 09:40:12 -0600 (CST) Message-id: <52ADCD5B.5000401@freebsd.org> Date: Sun, 15 Dec 2013 09:40:11 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Konstantin Belousov Subject: Re: svn commit: r259397 - in head/sys/cam: . scsi References: <201312142207.rBEM7fnW075560@svn.freebsd.org> <20131215140115.GM59496@kib.kiev.ua> In-reply-to: <20131215140115.GM59496@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 16:40:22 -0000 On 12/15/13 08:01, Konstantin Belousov wrote: > On Sat, Dec 14, 2013 at 10:07:41PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sat Dec 14 22:07:40 2013 >> New Revision: 259397 >> URL: http://svnweb.freebsd.org/changeset/base/259397 >> >> Log: >> Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel >> support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI >> (though not API) is changed. No behavior is changed relative to r257345 >> except that LUNs with non-zero high 32 bits will no longer be ignored >> during device enumeration for SIMs that have set PIM_EXTLUNS. > Does libcam.so version need to be bumped ? It wasn't the last time. Maybe it should have been? -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 16:58:23 2013 Return-Path: Delivered-To: svn-src-all@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 AA477978; Sun, 15 Dec 2013 16:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9635B114B; Sun, 15 Dec 2013 16:58:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFGwNip095392; Sun, 15 Dec 2013 16:58:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFGwNQ0095391; Sun, 15 Dec 2013 16:58:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312151658.rBFGwNQ0095391@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Dec 2013 16:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259418 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 16:58:23 -0000 Author: nwhitehorn Date: Sun Dec 15 16:58:23 2013 New Revision: 259418 URL: http://svnweb.freebsd.org/changeset/base/259418 Log: Set max_lun to zero. This field is ignored unless we are manually probing LUNs anyway, and we certainly don't want to probe 2^32 values by hand in that case. MFC after: 2 weeks Modified: head/sys/powerpc/pseries/phyp_vscsi.c Modified: head/sys/powerpc/pseries/phyp_vscsi.c ============================================================================== --- head/sys/powerpc/pseries/phyp_vscsi.c Sun Dec 15 16:17:00 2013 (r259417) +++ head/sys/powerpc/pseries/phyp_vscsi.c Sun Dec 15 16:58:23 2013 (r259418) @@ -426,7 +426,7 @@ vscsi_cam_action(struct cam_sim *sim, un cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; cpi->max_target = 0; - cpi->max_lun = ~(lun_id_t)(0); + cpi->max_lun = 0; cpi->initiator_id = ~0; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "IBM", HBA_IDLEN); From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 18:07:25 2013 Return-Path: Delivered-To: svn-src-all@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 CDBC4A04; Sun, 15 Dec 2013 18:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAA5C155A; Sun, 15 Dec 2013 18:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFI7PCn021204; Sun, 15 Dec 2013 18:07:25 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFI7PHw021202; Sun, 15 Dec 2013 18:07:25 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312151807.rBFI7PHw021202@svn.freebsd.org> From: Justin Hibbits Date: Sun, 15 Dec 2013 18:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259421 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 18:07:25 -0000 Author: jhibbits Date: Sun Dec 15 18:07:25 2013 New Revision: 259421 URL: http://svnweb.freebsd.org/changeset/base/259421 Log: Save r3 before using it for the trap check, else we end up saving the new r3, containing the trap instruction encoding (0x7c810808), and restoring it back with the frame on return. This caused it to panic on my ppc32 machine, but somehow my ppc64 machine overlooked it, because I was using such a simple dtrace probe. X-MFC-with: r259245 MFC after: 2 weeks Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:07:25 2013 (r259421) @@ -897,11 +897,13 @@ CNAME(dblow): #ifdef KDTRACE_HOOKS /* Privileged, so drop to KDB */ mfsrr0 %r1 - lwz %r4,0(%r1) + mtsprg3 %r3 + lwz %r1,0(%r1) /* Check if it's a DTrace trap. */ li %r3,0x0808 addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r4 + cmplw %cr0,%r3,%r1 + mfsprg3 %r3 beq %cr0,1b #endif /* Privileged, so drop to KDB */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:07:25 2013 (r259421) @@ -804,11 +804,13 @@ CNAME(dblow): #ifdef KDTRACE_HOOKS /* Privileged, so drop to KDB */ mfsrr0 %r1 - lwz %r4,0(%r1) + mtsprg3 %r3 + lwz %r1,0(%r1) /* Check if it's a DTrace trap. */ li %r3,0x0808 addis %r3,%r3,0x7c81 - cmplw %cr0,%r3,%r4 + cmplw %cr0,%r3,%r1 + mfsprg3 %r3 beq %cr0,1b #endif GET_CPUINFO(%r1) From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 18:13:43 2013 Return-Path: Delivered-To: svn-src-all@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 54456DA3; Sun, 15 Dec 2013 18:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 410B815FE; Sun, 15 Dec 2013 18:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFIDhcF024563; Sun, 15 Dec 2013 18:13:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFIDhgW024562; Sun, 15 Dec 2013 18:13:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312151813.rBFIDhgW024562@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Dec 2013 18:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259422 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 18:13:43 -0000 Author: kib Date: Sun Dec 15 18:13:42 2013 New Revision: 259422 URL: http://svnweb.freebsd.org/changeset/base/259422 Log: Revert r259045. It seems that clang miscompiles code related to UDP with -fno-strict-overflow. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Dec 15 18:07:25 2013 (r259421) +++ head/sys/conf/kern.mk Sun Dec 15 18:13:42 2013 (r259422) @@ -148,12 +148,6 @@ INLINE_LIMIT?= 8000 CFLAGS+= -ffreestanding # -# Do not allow a compiler to optimize out overflow checks for signed -# types. -# -CFLAGS+= -fno-strict-overflow - -# # GCC SSP support # .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 18:26:32 2013 Return-Path: Delivered-To: svn-src-all@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 8813A37D; Sun, 15 Dec 2013 18:26:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7520116BB; Sun, 15 Dec 2013 18:26:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFIQW4h028468; Sun, 15 Dec 2013 18:26:32 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFIQWWB028467; Sun, 15 Dec 2013 18:26:32 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312151826.rBFIQWWB028467@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 15 Dec 2013 18:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259424 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 18:26:32 -0000 Author: bjk (doc committer) Date: Sun Dec 15 18:26:31 2013 New Revision: 259424 URL: http://svnweb.freebsd.org/changeset/base/259424 Log: Increment __FreeBSD_version for the behavior change of gss_pseudo_random introduced in r259286. Approved by: hrs (mentor, src committer) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 15 18:22:51 2013 (r259423) +++ head/sys/sys/param.h Sun Dec 15 18:26:31 2013 (r259424) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 18:34:25 2013 Return-Path: Delivered-To: svn-src-all@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 09E2B704; Sun, 15 Dec 2013 18:34:25 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id E17C21767; Sun, 15 Dec 2013 18:34:24 +0000 (UTC) Received: from [IPv6:2601:9:8200:372:592f:3ab3:8cd8:ec31] (unknown [IPv6:2601:9:8200:372:592f:3ab3:8cd8:ec31]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id C3E2F39828; Sun, 15 Dec 2013 10:34:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1387132464; bh=kwhLvPekC9Hk3KSTMneoKJ5/khZY4meOPUutla+ehW0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Ykow9oKtxLcxOSIOAgQnIqBNyuqlSy5xgojJ177OaABX7H038e4LolzjPrtOmuvZh wW2Kb410F05slSJhtyr0AIXXRuG7G8ZtY14LR07WErAWSAOJ9IkxI7MiPI88VeLkCv QMyH+YlJ6oV0ESp+pZkwiv3r9y1NBNGzNhpRK1Jo= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1812\)) Subject: Re: svn commit: r259422 - head/sys/conf From: Rui Paulo In-Reply-To: <201312151813.rBFIDhgW024562@svn.freebsd.org> Date: Sun, 15 Dec 2013 10:33:47 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1812) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 18:34:25 -0000 On 15 Dec 2013, at 10:13, Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 15 18:13:42 2013 > New Revision: 259422 > URL: http://svnweb.freebsd.org/changeset/base/259422 >=20 > Log: > Revert r259045. >=20 > It seems that clang miscompiles code related to UDP with = -fno-strict-overflow. Could you please file a bug report if you haven't already? Thanks, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 19:09:15 2013 Return-Path: Delivered-To: svn-src-all@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 4E96B7DA for ; Sun, 15 Dec 2013 19:09:15 +0000 (UTC) Received: from mail-pb0-x22f.google.com (mail-pb0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB8D19F4 for ; Sun, 15 Dec 2013 19:09:15 +0000 (UTC) Received: by mail-pb0-f47.google.com with SMTP id um1so4541781pbc.6 for ; Sun, 15 Dec 2013 11:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=kuNiKHzueQr46rY44hJwps6CAUdx+T+A+YjM+5rT0/Y=; b=Onh+l0Bix7f75Zlu1pRXTT5HdoqrBr86JpctlnKzxN307ZPhg+vHaDLVgoJiJx/MOp O8Y5jClJg5R5EYRZoIOCr8ImNKyigmWwzHKX91hMvkpg1LsZTD9HQ/YCbWlW5vu43ELD +FsQGbNh0wrXMGT1sKaFRWgKsgLe6dQnfyJCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=kuNiKHzueQr46rY44hJwps6CAUdx+T+A+YjM+5rT0/Y=; b=TVug34+/PFUpHa3Xf6xj899OXiwm/iUw0IIgtzvR6Dsv1QoBk8108T64ywRE/EsTk2 LRPr/cixkmT296+snS9RK4IYIn2+ai2m+cQxlGWjR2Rzt+ftqkGB+vhcyJr8jGWdgjri US+frKME+qdmpMUbMrtkm3PrfgD3UJS8mylVwnGQqKq+6ExJYRcaxPtDElxx9NB0k8ug VMF0U3LWmUD2kxDjVuJLvVlYF3LUhe62h+SJFxFI2xWuM6xVv6s21D7Cm7HSQcVim016 /0mh349N60cFb8oqp0ocmLLwwQcPWYnmlmi0jb6SpbDO/UKDl/cVkS94lBttjddCYgdS g9wA== X-Gm-Message-State: ALoCoQnRbWVqa9+XPtSoJX2fJvURf2GCvSXgmzWlWJxaLFYjdT+UzWIuB8ClA7/hD0W07vM70nm5 X-Received: by 10.69.31.170 with SMTP id kn10mr15791694pbd.106.1387134554611; Sun, 15 Dec 2013 11:09:14 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.57.98 with HTTP; Sun, 15 Dec 2013 11:08:44 -0800 (PST) In-Reply-To: <201312151813.rBFIDhgW024562@svn.freebsd.org> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Dec 2013 14:08:44 -0500 X-Google-Sender-Auth: hd-3wN7kgoNd_WJvE-PKHzXi6sU Message-ID: Subject: Re: svn commit: r259422 - head/sys/conf To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 19:09:15 -0000 On Sun, Dec 15, 2013 at 1:13 PM, Konstantin Belousov wrote: > Author: kib > Date: Sun Dec 15 18:13:42 2013 > New Revision: 259422 > URL: http://svnweb.freebsd.org/changeset/base/259422 > > Log: > Revert r259045. > > It seems that clang miscompiles code related to UDP with -fno-strict-overflow. = Is this actual miscompilation or just a missed optimization opportunity? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 19:18:19 2013 Return-Path: Delivered-To: svn-src-all@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 72F81A99; Sun, 15 Dec 2013 19:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9D31A85; Sun, 15 Dec 2013 19:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFJIJGG047069; Sun, 15 Dec 2013 19:18:19 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFJIJFk047068; Sun, 15 Dec 2013 19:18:19 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312151918.rBFJIJFk047068@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 15 Dec 2013 19:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259425 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 19:18:19 -0000 Author: bjk (doc committer) Date: Sun Dec 15 19:18:18 2013 New Revision: 259425 URL: http://svnweb.freebsd.org/changeset/base/259425 Log: Add an UPDATING entry for the gss_pseudo_random behavior change Approved by: hrs (mentor, src committer) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Dec 15 18:26:31 2013 (r259424) +++ head/UPDATING Sun Dec 15 19:18:18 2013 (r259425) @@ -31,6 +31,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131213: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 1100004. + 20131108: The WITHOUT_ATF build knob has been removed and its functionality has been subsumed into the more generic WITHOUT_TESTS. If you were From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 20:38:08 2013 Return-Path: Delivered-To: svn-src-all@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 5474D75D; Sun, 15 Dec 2013 20:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40EBD1041; Sun, 15 Dec 2013 20:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFKc80e076472; Sun, 15 Dec 2013 20:38:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFKc7vS076470; Sun, 15 Dec 2013 20:38:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312152038.rBFKc7vS076470@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 20:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259426 - in head/release: . scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 20:38:08 -0000 Author: gjb Date: Sun Dec 15 20:38:07 2013 New Revision: 259426 URL: http://svnweb.freebsd.org/changeset/base/259426 Log: Add a pkg(8) repository configuration file for cdrom-based package installation. As part of the 'pkg-stage' target, copy the configuration file to the 'packages/repos/' directory on the DVD filesystem. MFC after: 3 days X-MFC-Before: -RC3 Sponsored by: The FreeBSD Foundation Added: head/release/scripts/FreeBSD_install_cdrom.conf (contents, props changed) Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Dec 15 19:18:18 2013 (r259425) +++ head/release/Makefile Sun Dec 15 20:38:07 2013 (r259426) @@ -225,7 +225,11 @@ pkg-stage: .if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf) sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ ${REVISION} + mkdir -p ${.OBJDIR}/dvd/packages/repos/ + cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ + ${.OBJDIR}/dvd/packages/repos/ .endif + touch ${.TARGET} cdrom: disc1.iso bootonly.iso dvdrom: dvd1.iso Added: head/release/scripts/FreeBSD_install_cdrom.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/FreeBSD_install_cdrom.conf Sun Dec 15 20:38:07 2013 (r259426) @@ -0,0 +1,12 @@ +# +# $FreeBSD$ +# +# The pkg(8) repository configuration file for the installation DVD. +# + +FreeBSD_install_cdrom: { + url: "file:///dist/packages/${ABI}", + mirror_type: "none", + enabled: yes +} + From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 20:47:27 2013 Return-Path: Delivered-To: svn-src-all@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 E98BDA42; Sun, 15 Dec 2013 20:47:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4F3D10D4; Sun, 15 Dec 2013 20:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFKlRSE079899; Sun, 15 Dec 2013 20:47:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFKlRrJ079898; Sun, 15 Dec 2013 20:47:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312152047.rBFKlRrJ079898@svn.freebsd.org> From: Glen Barber Date: Sun, 15 Dec 2013 20:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259427 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 20:47:28 -0000 Author: gjb Date: Sun Dec 15 20:47:27 2013 New Revision: 259427 URL: http://svnweb.freebsd.org/changeset/base/259427 Log: Export 'REPOS_DIR' when the selected source medium for package installation is cdrom. This enables bsdconfig(8) to make use of the on-disc pkg(8) repository configuration, which fixes package selection and installation from the dvd installer. MFC after: 3 days M-MFC-With: r259426 X-MFC-Before: -RC3 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Dec 15 20:38:07 2013 (r259426) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Dec 15 20:47:27 2013 (r259427) @@ -119,6 +119,9 @@ f_index_initialize() $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_CDROM) + __site="file://$MOUNTPOINT/packages/$PKG_ABI" + export REPOS_DIR="$MOUNTPOINT/packages/repos" ;; *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 22:51:27 2013 Return-Path: Delivered-To: svn-src-all@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 4D6A1953; Sun, 15 Dec 2013 22:51:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39DE9185D; Sun, 15 Dec 2013 22:51:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMpREf027151; Sun, 15 Dec 2013 22:51:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMpRgn027150; Sun, 15 Dec 2013 22:51:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152251.rBFMpRgn027150@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259428 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 22:51:27 -0000 Author: pjd Date: Sun Dec 15 22:51:26 2013 New Revision: 259428 URL: http://svnweb.freebsd.org/changeset/base/259428 Log: Clear content of keyfiles loaded by the loader after processing them. Pointed out by: rwatson MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sun Dec 15 20:47:27 2013 (r259427) +++ head/sys/geom/eli/g_eli.c Sun Dec 15 22:51:26 2013 (r259428) @@ -990,6 +990,7 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); g_eli_crypto_hmac_update(ctx, data, size); + bzero(data, size); } } From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 22:52:19 2013 Return-Path: Delivered-To: svn-src-all@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 07409AAC; Sun, 15 Dec 2013 22:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E78F71865; Sun, 15 Dec 2013 22:52:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMqI0N027284; Sun, 15 Dec 2013 22:52:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMqIdj027283; Sun, 15 Dec 2013 22:52:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152252.rBFMqIdj027283@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259429 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 22:52:19 -0000 Author: pjd Date: Sun Dec 15 22:52:18 2013 New Revision: 259429 URL: http://svnweb.freebsd.org/changeset/base/259429 Log: Clear some more places with potentially sensitive data. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_crypto.c Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Sun Dec 15 22:51:26 2013 (r259428) +++ head/sys/geom/eli/g_eli_crypto.c Sun Dec 15 22:52:18 2013 (r259429) @@ -288,10 +288,12 @@ g_eli_crypto_hmac_final(struct hmac_ctx bzero(ctx, sizeof(*ctx)); SHA512_Update(&lctx, digest, sizeof(digest)); SHA512_Final(digest, &lctx); + bzero(&lctx, sizeof(lctx)); /* mdsize == 0 means "Give me the whole hash!" */ if (mdsize == 0) mdsize = SHA512_MDLEN; bcopy(digest, md, mdsize); + bzero(digest, sizeof(digest)); } void From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 22:58:10 2013 Return-Path: Delivered-To: svn-src-all@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 685C7DAB; Sun, 15 Dec 2013 22:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AAF81899; Sun, 15 Dec 2013 22:58:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMwAKl027970; Sun, 15 Dec 2013 22:58:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMw9ip027967; Sun, 15 Dec 2013 22:58:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152258.rBFMw9ip027967@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259430 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 22:58:10 -0000 Author: pjd Date: Sun Dec 15 22:58:09 2013 New Revision: 259430 URL: http://svnweb.freebsd.org/changeset/base/259430 Log: MFp4 @1189139: Get rid of the msg_peek() function, which has a problem. If there was less data in the socket buffer than requested by the caller, the function would busy loop, as select(2) will always return immediately. We can just receive nvlhdr now, because some time ago we splitted receive of data from the receive of descriptors. MFC after: 1 week Modified: head/lib/libnv/msgio.c head/lib/libnv/msgio.h head/lib/libnv/nvlist.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/msgio.c Sun Dec 15 22:58:09 2013 (r259430) @@ -113,30 +113,6 @@ fd_wait(int fd, bool doread) NULL, NULL); } -int -msg_peek(int sock, void *buf, size_t size) -{ - ssize_t done; - - PJDLOG_ASSERT(sock >= 0); - PJDLOG_ASSERT(size > 0); - - do { - fd_wait(sock, true); - done = recv(sock, buf, size, MSG_PEEK | MSG_WAITALL); - if (done == -1) { - if (errno == EAGAIN || errno == EINTR) - continue; - return (-1); - } else if (done == 0) { - errno = ENOTCONN; - return (-1); - } - } while (done != (ssize_t)size); - - return (0); -} - static int msg_recv(int sock, struct msghdr *msg) { Modified: head/lib/libnv/msgio.h ============================================================================== --- head/lib/libnv/msgio.h Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/msgio.h Sun Dec 15 22:58:09 2013 (r259430) @@ -38,8 +38,6 @@ struct cmsgcred; struct iovec; struct msghdr; -int msg_peek(int sock, void *buf, size_t size); - int cred_send(int sock); int cred_recv(int sock, struct cmsgcred *cred); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Dec 15 22:52:18 2013 (r259429) +++ head/lib/libnv/nvlist.c Sun Dec 15 22:58:09 2013 (r259430) @@ -724,11 +724,11 @@ nvlist_recv(int sock) { struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; + unsigned char *buf; size_t nfds, size; - void *buf; int serrno, *fds; - if (msg_peek(sock, &nvlhdr, sizeof(nvlhdr)) == -1) + if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); if (!nvlist_check_header(&nvlhdr)) @@ -741,10 +741,12 @@ nvlist_recv(int sock) if (buf == NULL) return (NULL); + memcpy(buf, &nvlhdr, sizeof(nvlhdr)); + ret = NULL; fds = NULL; - if (buf_recv(sock, buf, size) == -1) + if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1) goto out; if (nfds > 0) { From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 22:59:34 2013 Return-Path: Delivered-To: svn-src-all@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 AD3C5F02; Sun, 15 Dec 2013 22:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9939D18A6; Sun, 15 Dec 2013 22:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFMxYgm028146; Sun, 15 Dec 2013 22:59:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFMxYjU028145; Sun, 15 Dec 2013 22:59:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152259.rBFMxYjU028145@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 22:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259431 - head/sbin/casperd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 22:59:34 -0000 Author: pjd Date: Sun Dec 15 22:59:34 2013 New Revision: 259431 URL: http://svnweb.freebsd.org/changeset/base/259431 Log: MFp4 @1189141: Change casperd's zygote process title. MFC after: 1 week Modified: head/sbin/casperd/zygote.c Modified: head/sbin/casperd/zygote.c ============================================================================== --- head/sbin/casperd/zygote.c Sun Dec 15 22:58:09 2013 (r259430) +++ head/sbin/casperd/zygote.c Sun Dec 15 22:59:34 2013 (r259431) @@ -122,6 +122,8 @@ zygote_main(int sock) assert(sock > STDERR_FILENO); + setproctitle("zygote"); + if (pjdlog_mode_get() != PJDLOG_MODE_STD) stdnull(); for (fd = STDERR_FILENO + 1; fd < sock; fd++) From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:02:37 2013 Return-Path: Delivered-To: svn-src-all@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 29FE6125; Sun, 15 Dec 2013 23:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16270190A; Sun, 15 Dec 2013 23:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN2aYP031102; Sun, 15 Dec 2013 23:02:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN2a5N031099; Sun, 15 Dec 2013 23:02:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152302.rBFN2a5N031099@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259432 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:02:37 -0000 Author: pjd Date: Sun Dec 15 23:02:36 2013 New Revision: 259432 URL: http://svnweb.freebsd.org/changeset/base/259432 Log: Make use of casperd's system.dns service when running without the -n option. Now tcpdump(8) is sandboxed even if DNS resolution is required. Sponsored by: The FreeBSD Foundation Modified: head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Sun Dec 15 22:59:34 2013 (r259431) +++ head/contrib/tcpdump/addrtoname.c Sun Dec 15 23:02:36 2013 (r259432) @@ -32,6 +32,10 @@ static const char rcsid[] _U_ = #include "config.h" #endif +#ifdef __FreeBSD__ +#include +#include +#endif #include #ifdef USE_ETHER_NTOHOST @@ -203,6 +207,9 @@ intoa(u_int32_t addr) static u_int32_t f_netmask; static u_int32_t f_localnet; +#ifdef HAVE_LIBCAPSICUM +extern cap_channel_t *capdns; +#endif /* * Return a name for the IP address pointed to by ap. This address @@ -248,7 +255,13 @@ getname(const u_char *ap) */ if (!nflag && (addr & f_netmask) == f_localnet) { - hp = gethostbyaddr((char *)&addr, 4, AF_INET); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) { + hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, + AF_INET); + } else +#endif + hp = gethostbyaddr((char *)&addr, 4, AF_INET); if (hp) { char *dotp; @@ -293,7 +306,13 @@ getname6(const u_char *ap) * Do not print names if -n was given. */ if (!nflag) { - hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); +#ifdef HAVE_LIBCAPSICUM + if (capdns != NULL) { + hp = cap_gethostbyaddr(capdns, (char *)&addr, + sizeof(addr), AF_INET6); + } else +#endif + hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); if (hp) { char *dotp; Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Sun Dec 15 22:59:34 2013 (r259431) +++ head/contrib/tcpdump/tcpdump.c Sun Dec 15 23:02:36 2013 (r259432) @@ -76,6 +76,12 @@ extern int SIZE_BUF; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#include +#include +#include +#endif /* HAVE_LIBCAPSICUM */ #endif /* __FreeBSD__ */ #ifndef WIN32 #include @@ -123,6 +129,10 @@ static int infoprint; char *program_name; +#ifdef HAVE_LIBCAPSICUM +cap_channel_t *capdns; +#endif + int32_t thiszone; /* seconds offset from gmt to local time */ /* Forwards */ @@ -684,6 +694,45 @@ get_next_file(FILE *VFile, char *ptr) return ret; } +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t * +capdns_setup(void) +{ + cap_channel_t *capcas, *capdnsloc; + const char *types[1]; + int families[2]; + + capcas = cap_init(); + if (capcas == NULL) { + warning("unable to contact casperd"); + return (NULL); + } + capdnsloc = cap_service_open(capcas, "system.dns"); + /* Casper capability no longer needed. */ + cap_close(capcas); + if (capdnsloc == NULL) { + warning("unable to open system.dns service"); + return (NULL); + } + /* Limit system.dns to reverse DNS lookups. */ + types[0] = "ADDR"; + if (cap_dns_type_limit(capdnsloc, types, 1) < 0) { + warning("unable to limit access to system.dns service"); + cap_close(capdnsloc); + return (NULL); + } + families[0] = AF_INET; + families[1] = AF_INET6; + if (cap_dns_family_limit(capdnsloc, families, 2) < 0) { + warning("unable to limit access to system.dns service"); + cap_close(capdnsloc); + return (NULL); + } + + return (capdnsloc); +} +#endif /* HAVE_LIBCAPSICUM */ + int main(int argc, char **argv) { @@ -1417,6 +1466,12 @@ main(int argc, char **argv) free(cmdbuf); exit(0); } + +#ifdef HAVE_LIBCAPSICUM + if (!nflag) + capdns = capdns_setup(); +#endif /* HAVE_LIBCAPSICUM */ + init_addrtoname(localnet, netmask); init_checksum(); @@ -1615,7 +1670,12 @@ main(int argc, char **argv) #endif /* WIN32 */ #ifdef __FreeBSD__ - cansandbox = (nflag && VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL); +#ifdef HAVE_LIBCAPSICUM + cansandbox = (cansandbox && (nflag || capdns != NULL)); +#else + cansandbox = (cansandbox && nflag); +#endif if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); if (cap_sandboxed()) From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:05:19 2013 Return-Path: Delivered-To: svn-src-all@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 A53C230A; Sun, 15 Dec 2013 23:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 917D01921; Sun, 15 Dec 2013 23:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN5Jel031572; Sun, 15 Dec 2013 23:05:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN5JKT031571; Sun, 15 Dec 2013 23:05:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152305.rBFN5JKT031571@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259433 - head/usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:05:19 -0000 Author: pjd Date: Sun Dec 15 23:05:19 2013 New Revision: 259433 URL: http://svnweb.freebsd.org/changeset/base/259433 Log: Add Casper support. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Sun Dec 15 23:02:36 2013 (r259432) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Sun Dec 15 23:05:19 2013 (r259433) @@ -162,6 +162,11 @@ CFLAGS+= -DLBL_ALIGN DPADD= ${LIBL} ${LIBPCAP} LDADD= -ll -lpcap +.if ${MK_CASPER} != "no" +DPADD+= ${LIBCAPSICUM} ${LIBNV} +LDADD+= -lcapsicum -lnv +CFLAGS+=-DHAVE_LIBCAPSICUM +.endif .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:09:06 2013 Return-Path: Delivered-To: svn-src-all@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 9A8F5494; Sun, 15 Dec 2013 23:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79D131940; Sun, 15 Dec 2013 23:09:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFN96aC032129; Sun, 15 Dec 2013 23:09:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFN96Z9032127; Sun, 15 Dec 2013 23:09:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152309.rBFN96Z9032127@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259434 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:09:06 -0000 Author: pjd Date: Sun Dec 15 23:09:05 2013 New Revision: 259434 URL: http://svnweb.freebsd.org/changeset/base/259434 Log: Make use of Casper's system.pwd and system.grp services when the -r option is given to convert uids and gids to user names and group names even when running in capability mode sandbox. While here log on stderr when we successfully enter the sandbox. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Sun Dec 15 23:05:19 2013 (r259433) +++ head/usr.bin/kdump/Makefile Sun Dec 15 23:09:05 2013 (r259434) @@ -12,6 +12,12 @@ SRCS= kdump_subr.c kdump.c ioctl.c subr DPSRCS= kdump_subr.h CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. +.if ${MK_CASPER} != "no" +DPADD+= ${LIBCAPSICUM} ${LIBNV} +LDADD+= -lcapsicum -lnv +CFLAGS+=-DHAVE_LIBCAPSICUM +.endif + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun Dec 15 23:05:19 2013 (r259433) +++ head/usr.bin/kdump/kdump.c Sun Dec 15 23:09:05 2013 (r259434) @@ -74,9 +74,18 @@ extern int errno; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#include +#include +#include +#endif #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#endif #include #include #include @@ -167,6 +176,10 @@ struct proc_info TAILQ_HEAD(trace_procs, proc_info) trace_procs; +#ifdef HAVE_LIBCAPSICUM +static cap_channel_t *cappwd, *capgrp; +#endif + static void strerror_init(void) { @@ -192,6 +205,64 @@ localtime_init(void) (void)localtime(<ime); } +#ifdef HAVE_LIBCAPSICUM +static int +cappwdgrp_setup(cap_channel_t **cappwdp, cap_channel_t **capgrpp) +{ + cap_channel_t *capcas, *cappwdloc, *capgrploc; + const char *cmds[1], *fields[1]; + + capcas = cap_init(); + if (capcas == NULL) { + warn("unable to contact casperd"); + return (NULL); + } + cappwdloc = cap_service_open(capcas, "system.pwd"); + capgrploc = cap_service_open(capcas, "system.grp"); + /* Casper capability no longer needed. */ + cap_close(capcas); + if (cappwdloc == NULL || capgrploc == NULL) { + if (cappwdloc == NULL) + warn("unable to open system.pwd service"); + if (capgrploc == NULL) + warn("unable to open system.grp service"); + goto fail; + } + /* Limit system.pwd to only getpwuid() function and pw_name field. */ + cmds[0] = "getpwuid"; + if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) { + warn("unable to limit access to system.pwd service"); + goto fail; + } + fields[0] = "pw_name"; + if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) { + warn("unable to limit access to system.pwd service"); + goto fail; + } + /* Limit system.grp to only getgrgid() function and gr_name field. */ + cmds[0] = "getgrgid"; + if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) { + warn("unable to limit access to system.grp service"); + goto fail; + } + fields[0] = "gr_name"; + if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) { + warn("unable to limit access to system.grp service"); + goto fail; + } + + *cappwdp = cappwdloc; + *capgrpp = capgrploc; + return (0); +fail: + if (capgrploc == NULL) + cap_close(cappwdloc); + if (capgrploc == NULL) + cap_close(capgrploc); + return (-1); +} +#endif /* HAVE_LIBCAPSICUM */ + int main(int argc, char *argv[]) { @@ -265,14 +336,28 @@ main(int argc, char *argv[]) strerror_init(); localtime_init(); - +#ifdef HAVE_LIBCAPSICUM + if (resolv != 0) { + if (cappwdgrp_setup(&cappwd, &capgrp) < 0) { + cappwd = NULL; + capgrp = NULL; + } + } + if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) { + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + } +#else if (resolv == 0) { if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); } +#endif limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); + if (cap_sandboxed()) + fprintf(stderr, "capability mode sandbox enabled\n"); TAILQ_INIT(&trace_procs); drop_logged = 0; @@ -1664,11 +1749,31 @@ ktrstat(struct stat *statp) printf("mode=%s, ", mode); } printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); - if (resolv == 0 || (pwd = getpwuid(statp->st_uid)) == NULL) + if (resolv == 0) { + pwd = NULL; + } else { +#ifdef HAVE_LIBCAPSICUM + if (cappwd != NULL) + pwd = cap_getpwuid(cappwd, statp->st_uid); + else +#endif + pwd = getpwuid(statp->st_uid); + } + if (pwd == NULL) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else printf("uid=\"%s\", ", pwd->pw_name); - if (resolv == 0 || (grp = getgrgid(statp->st_gid)) == NULL) + if (resolv == 0) { + grp = NULL; + } else { +#ifdef HAVE_LIBCAPSICUM + if (capgrp != NULL) + grp = cap_getgrgid(capgrp, statp->st_gid); + else +#endif + grp = getgrgid(statp->st_gid); + } + if (grp == NULL) printf("gid=%ju, ", (uintmax_t)statp->st_gid); else printf("gid=\"%s\", ", grp->gr_name); From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:12:42 2013 Return-Path: Delivered-To: svn-src-all@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 C14ED62F; Sun, 15 Dec 2013 23:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD7DA19DB; Sun, 15 Dec 2013 23:12:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNCgBd035100; Sun, 15 Dec 2013 23:12:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNCgjq035099; Sun, 15 Dec 2013 23:12:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152312.rBFNCgjq035099@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259435 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:12:42 -0000 Author: pjd Date: Sun Dec 15 23:12:42 2013 New Revision: 259435 URL: http://svnweb.freebsd.org/changeset/base/259435 Log: Forgot to regenerate after r257736. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:09:05 2013 (r259434) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:12:42 2013 (r259435) @@ -368,7 +368,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */ { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ + { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:14:27 2013 Return-Path: Delivered-To: svn-src-all@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 E604B778; Sun, 15 Dec 2013 23:14:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1F6619E3; Sun, 15 Dec 2013 23:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNERjF035380; Sun, 15 Dec 2013 23:14:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNERxD035379; Sun, 15 Dec 2013 23:14:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152314.rBFNERxD035379@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259436 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:14:28 -0000 Author: pjd Date: Sun Dec 15 23:14:27 2013 New Revision: 259436 URL: http://svnweb.freebsd.org/changeset/base/259436 Log: Allow for pselect(2) in capability mode. Noticed by: David Drysdale Modified: head/sys/kern/capabilities.conf Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Sun Dec 15 23:12:42 2013 (r259435) +++ head/sys/kern/capabilities.conf Sun Dec 15 23:14:27 2013 (r259436) @@ -559,10 +559,11 @@ sctp_generic_sendmsg_iov sctp_peeloff ## -## Allow select(2), which will be scoped by capability rights. +## Allow pselect(2) and select(2), which will be scoped by capability rights. ## ## XXXRW: But is it? ## +pselect select ## From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:15:13 2013 Return-Path: Delivered-To: svn-src-all@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 647E68B7; Sun, 15 Dec 2013 23:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50F6919E8; Sun, 15 Dec 2013 23:15:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNFDe5035573; Sun, 15 Dec 2013 23:15:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNFDo9035572; Sun, 15 Dec 2013 23:15:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152315.rBFNFDo9035572@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259437 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:15:13 -0000 Author: pjd Date: Sun Dec 15 23:15:12 2013 New Revision: 259437 URL: http://svnweb.freebsd.org/changeset/base/259437 Log: Regenerate after r259436. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:14:27 2013 (r259436) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:15:12 2013 (r259437) @@ -556,7 +556,7 @@ struct sysent sysent[] = { { AS(pdkill_args), (sy_call_t *)sys_pdkill, AUE_PDKILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 519 = pdkill */ { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait4 */ - { AS(pselect_args), (sy_call_t *)sys_pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 522 = pselect */ + { AS(pselect_args), (sy_call_t *)sys_pselect, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 522 = pselect */ { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ { AS(rctl_get_racct_args), (sy_call_t *)sys_rctl_get_racct, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_racct */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:19:43 2013 Return-Path: Delivered-To: svn-src-all@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 8B9F5A36; Sun, 15 Dec 2013 23:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77C9C19FB; Sun, 15 Dec 2013 23:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNJhFR036072; Sun, 15 Dec 2013 23:19:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNJhVM036071; Sun, 15 Dec 2013 23:19:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152319.rBFNJhVM036071@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259438 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:19:43 -0000 Author: pjd Date: Sun Dec 15 23:19:42 2013 New Revision: 259438 URL: http://svnweb.freebsd.org/changeset/base/259438 Log: Fix syscalls that can be loaded as kernel modules - they were not given the flag allowing to call them from capability mode sandbox. Noticed by: David Drysdale Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Sun Dec 15 23:15:12 2013 (r259437) +++ head/sys/kern/makesyscalls.sh Sun Dec 15 23:19:42 2013 (r259438) @@ -460,7 +460,7 @@ s/\$//g printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 if (flag("NOSTD")) { - printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT") > sysent + printf("lkmressys, AUE_NULL, NULL, 0, 0, %s, SY_THR_ABSENT },", flags) > sysent column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { if (funcname == "nosys" || funcname == "sysarch" || From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:20:27 2013 Return-Path: Delivered-To: svn-src-all@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 05956B8A; Sun, 15 Dec 2013 23:20:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9F671A06; Sun, 15 Dec 2013 23:20:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNKQM5038041; Sun, 15 Dec 2013 23:20:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNKQ9u038040; Sun, 15 Dec 2013 23:20:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152320.rBFNKQ9u038040@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259439 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:20:27 -0000 Author: pjd Date: Sun Dec 15 23:20:26 2013 New Revision: 259439 URL: http://svnweb.freebsd.org/changeset/base/259439 Log: Regenerate after r259438. Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sun Dec 15 23:19:42 2013 (r259438) +++ head/sys/kern/init_sysent.c Sun Dec 15 23:20:26 2013 (r259439) @@ -289,9 +289,9 @@ struct sysent sysent[] = { { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 252 = openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ - { AS(aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 255 = aio_read */ - { AS(aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 256 = aio_write */ - { AS(lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 257 = lio_listio */ + { AS(aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 255 = aio_read */ + { AS(aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 256 = aio_write */ + { AS(lio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 257 = lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 260 = nosys */ @@ -348,13 +348,13 @@ struct sysent sysent[] = { { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */ - { AS(aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 314 = aio_return */ - { AS(aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 315 = aio_suspend */ - { AS(aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 316 = aio_cancel */ - { AS(aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 317 = aio_error */ - { AS(oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 318 = oaio_read */ - { AS(oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 319 = oaio_write */ - { AS(olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 320 = olio_listio */ + { AS(aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 314 = aio_return */ + { AS(aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 315 = aio_suspend */ + { AS(aio_cancel_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 316 = aio_cancel */ + { AS(aio_error_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 317 = aio_error */ + { AS(oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 318 = oaio_read */ + { AS(oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 319 = oaio_write */ + { AS(olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 320 = olio_listio */ { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */ @@ -393,7 +393,7 @@ struct sysent sysent[] = { { AS(extattr_set_file_args), (sy_call_t *)sys_extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)sys_extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)sys_extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */ - { AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = aio_waitcomplete */ + { AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 359 = aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ @@ -492,14 +492,14 @@ struct sysent sysent[] = { { AS(thr_new_args), (sy_call_t *)sys_thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = thr_new */ { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */ { AS(kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = kmq_open */ - { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = kmq_setattr */ - { AS(kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = kmq_timedreceive */ - { AS(kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = kmq_timedsend */ - { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ + { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = kmq_setattr */ + { AS(kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 459 = kmq_timedreceive */ + { AS(kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 460 = kmq_timedsend */ + { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 461 = kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ - { AS(aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 465 = aio_fsync */ + { AS(aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 465 = aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 23:49:42 2013 Return-Path: Delivered-To: svn-src-all@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 99970892; Sun, 15 Dec 2013 23:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8562F1D3C; Sun, 15 Dec 2013 23:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBFNngra046917; Sun, 15 Dec 2013 23:49:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBFNng6r046916; Sun, 15 Dec 2013 23:49:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312152349.rBFNng6r046916@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Dec 2013 23:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259440 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 23:49:42 -0000 Author: pjd Date: Sun Dec 15 23:49:42 2013 New Revision: 259440 URL: http://svnweb.freebsd.org/changeset/base/259440 Log: Include bsd.own.mk for MK_CASPER to work. Reported by: nwhitehorn Modified: head/usr.bin/kdump/Makefile Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Sun Dec 15 23:20:26 2013 (r259439) +++ head/usr.bin/kdump/Makefile Sun Dec 15 23:49:42 2013 (r259440) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + .if (${MACHINE_ARCH} == "amd64") SFX= 32 .endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 00:50:15 2013 Return-Path: Delivered-To: svn-src-all@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 81FA1FD4; Mon, 16 Dec 2013 00:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5500A114D; Mon, 16 Dec 2013 00:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG0oFSI071412; Mon, 16 Dec 2013 00:50:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG0oFjY071411; Mon, 16 Dec 2013 00:50:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312160050.rBG0oFjY071411@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 16 Dec 2013 00:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259441 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 00:50:15 -0000 Author: marcel Date: Mon Dec 16 00:50:14 2013 New Revision: 259441 URL: http://svnweb.freebsd.org/changeset/base/259441 Log: Properly drain the TTY when both revoke(2) and close(2) end up closing the TTY. In such a case, ttydev_close() is called multiple times and each time, t_revokecnt is incremented and cv_broadcast() is called for both the t_outwait and t_inwait condition variables. Let's say revoke(2) comes in first and gets to call tty_drain() from ttydev_leave(). Let's say that the revoke comes from init(8) as the result of running "shutdown -r now". Since shutdown prints various messages to the console before announing that the machine will reboot immediately, let's also say that the output queue is not empty and that tty_drain() has something to do. Let's assume this all happens on a 9600 baud serial console, so it takes a time to drain. The shutdown command will exit(2) and as such will end up closing stdout. Let's say this close will come in second, bump t_revokecnt and call tty_wakeup(). This has tty_wait() return prematurely and the next thing that will happen is that the thread doing revoke(2) will flush the TTY. Since the drain wasn't complete, the flush will effectively drop whatever is left in t_outq. This change takes into account that tty_drain() will return ERESTART due to the fact that t_revokecnt was bumped and in that case simply call tty_drain() again. The thread in question is already performing the close so it can safely finish draining the TTY before destroying the TTY structure. Now all messages from shutdown will be printed on the serial console. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Dec 15 23:49:42 2013 (r259440) +++ head/sys/kern/tty.c Mon Dec 16 00:50:14 2013 (r259441) @@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) - tty_drain(tp); + if (!tty_gone(tp)) { + while (tty_drain(tp) == ERESTART) + ; + } ttydisc_close(tp); From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 01:20:19 2013 Return-Path: Delivered-To: svn-src-all@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 A9A93713; Mon, 16 Dec 2013 01:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 941C312D6; Mon, 16 Dec 2013 01:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG1KJWl082793; Mon, 16 Dec 2013 01:20:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG1KItL082437; Mon, 16 Dec 2013 01:20:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312160120.rBG1KItL082437@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 01:20: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: r259443 - in stable/10: tools/regression/usr.bin/sed usr.bin/sed 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 01:20:19 -0000 Author: eadler Date: Mon Dec 16 01:20:18 2013 New Revision: 259443 URL: http://svnweb.freebsd.org/changeset/base/259443 Log: MFC r259132,r259133,r259143: Per the resolution of POSIX bug 0000779 (note 0002050) add support for using 'i' as a case insensitive flag. Add regression test for recently added 'i' flag in r259132. the i modifier was added in r259132 since POSIX recently agreed to add it. Switch uses of /I to /i. PR: standards/184641 Added: stable/10/tools/regression/usr.bin/sed/regress.icase4.out - copied unchanged from r259133, head/tools/regression/usr.bin/sed/regress.icase4.out Modified: stable/10/tools/regression/usr.bin/sed/regress.sh stable/10/usr.bin/sed/compile.c stable/10/usr.bin/sed/sed.1 stable/10/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/10/ (props changed) Copied: stable/10/tools/regression/usr.bin/sed/regress.icase4.out (from r259133, head/tools/regression/usr.bin/sed/regress.icase4.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/regression/usr.bin/sed/regress.icase4.out Mon Dec 16 01:20:18 2013 (r259443, copy of r259133, head/tools/regression/usr.bin/sed/regress.icase4.out) @@ -0,0 +1,4 @@ +input +data +for validation +of Foo(1) Modified: stable/10/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- stable/10/tools/regression/usr.bin/sed/regress.sh Mon Dec 16 00:59:05 2013 (r259442) +++ stable/10/tools/regression/usr.bin/sed/regress.sh Mon Dec 16 01:20:18 2013 (r259443) @@ -66,6 +66,7 @@ REGRESSION_TEST_FREEFORM(`inplace5', `in REGRESSION_TEST(`icase1', `sed /SED/Id < regress.in') REGRESSION_TEST(`icase2', `sed s/SED/Foo/I < regress.in') REGRESSION_TEST(`icase3', `sed s/SED/Foo/ < regress.in') +REGRESSION_TEST(`icase4', `sed s/SED/Foo/i < regress.in') REGRESSION_TEST(`hanoi', `echo ":abcd: : :" | sed -f hanoi.sed') REGRESSION_TEST(`math', `echo "4+7*3+2^7/3" | sed -f math.sed') Modified: stable/10/usr.bin/sed/compile.c ============================================================================== --- stable/10/usr.bin/sed/compile.c Mon Dec 16 00:59:05 2013 (r259442) +++ stable/10/usr.bin/sed/compile.c Mon Dec 16 01:20:18 2013 (r259443) @@ -582,6 +582,7 @@ compile_flags(char *p, struct s_subst *s case 'p': s->p = 1; break; + case 'i': case 'I': s->icase = 1; break; Modified: stable/10/usr.bin/sed/sed.1 ============================================================================== --- stable/10/usr.bin/sed/sed.1 Mon Dec 16 00:59:05 2013 (r259442) +++ stable/10/usr.bin/sed/sed.1 Mon Dec 16 01:20:18 2013 (r259443) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd May 24, 2009 +.Dd December 9, 2013 .Dt SED 1 .Os .Sh NAME @@ -196,7 +196,7 @@ option was specified); a context address that consists of a regular expression preceded and followed by a delimiter. The closing delimiter can also optionally be followed by the -.Dq I +.Dq i character, to indicate that the regular expression is to be matched in a case-insensitive way. .El @@ -507,7 +507,7 @@ Append the pattern space to if a replacement was made. If the replacement string is identical to that which it replaces, it is still considered to have been a replacement. -.It I +.It i or I Match the regular expression in a case-insensitive way. .El .Pp Modified: stable/10/usr.sbin/bsdinstall/scripts/services ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/services Mon Dec 16 00:59:05 2013 (r259442) +++ stable/10/usr.sbin/bsdinstall/scripts/services Mon Dec 16 01:20:18 2013 (r259443) @@ -29,7 +29,7 @@ : ${DIALOG_OK=0} if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then - eval `sed -e s/YES/on/I -e s/NO/off/I $BSDINSTALL_TMPETC/rc.conf.services` + eval `sed -e s/YES/on/i -e s/NO/off/i $BSDINSTALL_TMPETC/rc.conf.services` else # Default service states. Everything is off if not enabled. sshd_enable="on" From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 01:22:58 2013 Return-Path: Delivered-To: svn-src-all@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 952CA86E; Mon, 16 Dec 2013 01:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66626132E; Mon, 16 Dec 2013 01:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG1MwSb083374; Mon, 16 Dec 2013 01:22:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG1Mv0v083368; Mon, 16 Dec 2013 01:22:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312160122.rBG1Mv0v083368@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 01:22:57 +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: r259444 - in stable/9: tools/regression/usr.bin/sed usr.bin/sed X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 01:22:58 -0000 Author: eadler Date: Mon Dec 16 01:22:57 2013 New Revision: 259444 URL: http://svnweb.freebsd.org/changeset/base/259444 Log: MFC r259132,r259133: Per the resolution of POSIX bug 0000779 (note 0002050) add support for using 'i' as a case insensitive flag. Add regression test for recently added 'i' flag in r259132. PR: standards/184641 Modified: stable/9/tools/regression/usr.bin/sed/regress.sh stable/9/usr.bin/sed/compile.c stable/9/usr.bin/sed/sed.1 Modified: stable/9/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- stable/9/tools/regression/usr.bin/sed/regress.sh Mon Dec 16 01:20:18 2013 (r259443) +++ stable/9/tools/regression/usr.bin/sed/regress.sh Mon Dec 16 01:22:57 2013 (r259444) @@ -66,6 +66,7 @@ REGRESSION_TEST_FREEFORM(`inplace5', `in REGRESSION_TEST(`icase1', `sed /SED/Id < regress.in') REGRESSION_TEST(`icase2', `sed s/SED/Foo/I < regress.in') REGRESSION_TEST(`icase3', `sed s/SED/Foo/ < regress.in') +REGRESSION_TEST(`icase4', `sed s/SED/Foo/i < regress.in') REGRESSION_TEST(`hanoi', `echo ":abcd: : :" | sed -f hanoi.sed') REGRESSION_TEST(`math', `echo "4+7*3+2^7/3" | sed -f math.sed') Modified: stable/9/usr.bin/sed/compile.c ============================================================================== --- stable/9/usr.bin/sed/compile.c Mon Dec 16 01:20:18 2013 (r259443) +++ stable/9/usr.bin/sed/compile.c Mon Dec 16 01:22:57 2013 (r259444) @@ -582,6 +582,7 @@ compile_flags(char *p, struct s_subst *s case 'p': s->p = 1; break; + case 'i': case 'I': s->icase = 1; break; Modified: stable/9/usr.bin/sed/sed.1 ============================================================================== --- stable/9/usr.bin/sed/sed.1 Mon Dec 16 01:20:18 2013 (r259443) +++ stable/9/usr.bin/sed/sed.1 Mon Dec 16 01:22:57 2013 (r259444) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd May 24, 2009 +.Dd December 9, 2013 .Dt SED 1 .Os .Sh NAME @@ -196,7 +196,7 @@ option was specified); a context address that consists of a regular expression preceded and followed by a delimiter. The closing delimiter can also optionally be followed by the -.Dq I +.Dq i character, to indicate that the regular expression is to be matched in a case-insensitive way. .El @@ -507,7 +507,7 @@ Append the pattern space to if a replacement was made. If the replacement string is identical to that which it replaces, it is still considered to have been a replacement. -.It I +.It i or I Match the regular expression in a case-insensitive way. .El .Pp From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 01:47:52 2013 Return-Path: Delivered-To: svn-src-all@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 BA111C20; Mon, 16 Dec 2013 01:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BB7414B1; Mon, 16 Dec 2013 01:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG1lqqO090859; Mon, 16 Dec 2013 01:47:52 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG1lqg6090858; Mon, 16 Dec 2013 01:47:52 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312160147.rBG1lqg6090858@svn.freebsd.org> From: Peter Wemm Date: Mon, 16 Dec 2013 01:47: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: r259445 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 01:47:52 -0000 Author: peter Date: Mon Dec 16 01:47:52 2013 New Revision: 259445 URL: http://svnweb.freebsd.org/changeset/base/259445 Log: Record r258428 and r258445 as not merged. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 01:58:12 2013 Return-Path: Delivered-To: svn-src-all@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 A0BBDE9C; Mon, 16 Dec 2013 01:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2121546; Mon, 16 Dec 2013 01:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG1wC9Q094340; Mon, 16 Dec 2013 01:58:12 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG1wCBZ094339; Mon, 16 Dec 2013 01:58:12 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160158.rBG1wCBZ094339@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 01:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259446 - head/contrib/tzcode/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 01:58:12 -0000 Author: bjk (doc committer) Date: Mon Dec 16 01:58:12 2013 New Revision: 259446 URL: http://svnweb.freebsd.org/changeset/base/259446 Log: tzfile.5: catch up to r204333 The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h is not an installed header, so the man page refers to its location in the source tree. The documentation could be more clear about the internal nature of the header, but those changes should go through upstream tzcode. PR: docs/176864 Approved by: hrs (mentor) Modified: head/contrib/tzcode/stdtime/tzfile.5 Modified: head/contrib/tzcode/stdtime/tzfile.5 ============================================================================== --- head/contrib/tzcode/stdtime/tzfile.5 Mon Dec 16 01:47:52 2013 (r259445) +++ head/contrib/tzcode/stdtime/tzfile.5 Mon Dec 16 01:58:12 2013 (r259446) @@ -6,7 +6,7 @@ .Nm tzfile .Nd timezone information .Sh SYNOPSIS -.Fd #include \&"/usr/src/lib/libc/stdtime/tzfile.h\&" +.Fd #include \&"/usr/src/contrib/tzcode/stdtime/tzfile.h\&" .Sh DESCRIPTION The time zone information files used by .Xr tzset 3 From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 02:04:29 2013 Return-Path: Delivered-To: svn-src-all@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 7A22819B; Mon, 16 Dec 2013 02:04:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6576C15D2; Mon, 16 Dec 2013 02:04:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG24Tcj097915; Mon, 16 Dec 2013 02:04:29 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG24ST3097912; Mon, 16 Dec 2013 02:04:28 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160204.rBG24ST3097912@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 02:04: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: r259447 - in stable/10: . crypto/heimdal/lib/gssapi/krb5 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 02:04:29 -0000 Author: bjk (doc committer) Date: Mon Dec 16 02:04:28 2013 New Revision: 259447 URL: http://svnweb.freebsd.org/changeset/base/259447 Log: MFC r259286,259424,259425: Apply patch from upstream Heimdal for encoding fix RFC 4402 specifies the implementation of the gss_pseudo_random() function for the krb5 mechanism (and the C bindings therein). The implementation uses a PRF+ function that concatenates the output of individual krb5 pseudo-random operations produced with a counter and seed. The original implementation of this function in Heimdal incorrectly encoded the counter as a little-endian integer, but the RFC specifies the counter encoding as big-endian. The implementation initializes the counter to zero, so the first block of output (16 octets, for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 specifies that the counter should begin at 1, but both existing implementations begin with zero and it looks like the standard will be re-issued, with test vectors, to begin at zero.) This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6, from 13 October, 2013: % Fix krb5's gss_pseudo_random() (n is big-endian) % % The first enctype RFC3961 prf output length's bytes are correct because % the little- and big-endian representations of unsigned zero are the % same. The second block of output was wrong because the counter was not % being encoded as big-endian. % % This change could break applications. But those applications would not % have been interoperating with other implementations anyways (in % particular: MIT's). Bump __FreeBSD_version accordingly and add a note in UPDATING. Approved by: hrs (mentor, src committer) Modified: stable/10/UPDATING stable/10/crypto/heimdal/lib/gssapi/krb5/prf.c stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 16 01:58:12 2013 (r259446) +++ stable/10/UPDATING Mon Dec 16 02:04:28 2013 (r259447) @@ -16,6 +16,17 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20131216: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 1000701. + 20131031: The default version of mtree is nmtree which is obtained from NetBSD. The output is generally the same, but may vary Modified: stable/10/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- stable/10/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 01:58:12 2013 (r259446) +++ stable/10/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 02:04:28 2013 (r259447) @@ -119,7 +119,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ while(dol > 0) { size_t tsize; - _gsskrb5_encode_om_uint32(num, input.data); + _gsskrb5_encode_be_om_uint32(num, input.data); ret = krb5_crypto_prf(context, crypto, &input, &output); if (ret) { @@ -133,7 +133,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ tsize = min(dol, output.length); memcpy(p, output.data, tsize); - p += output.length; + p += tsize; dol -= tsize; krb5_data_free(&output); num++; Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Mon Dec 16 01:58:12 2013 (r259446) +++ stable/10/sys/sys/param.h Mon Dec 16 02:04:28 2013 (r259447) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000700 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000701 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 02:25:29 2013 Return-Path: Delivered-To: svn-src-all@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 80A48459; Mon, 16 Dec 2013 02:25:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C27216D0; Mon, 16 Dec 2013 02:25:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG2PTDv005651; Mon, 16 Dec 2013 02:25:29 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG2PSwj005645; Mon, 16 Dec 2013 02:25:28 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160225.rBG2PSwj005645@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 02: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: r259448 - in stable/9: . crypto/heimdal/lib/gssapi/krb5 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 02:25:29 -0000 Author: bjk (doc committer) Date: Mon Dec 16 02:25:28 2013 New Revision: 259448 URL: http://svnweb.freebsd.org/changeset/base/259448 Log: MFC r259286,259424,259425: Apply patch from upstream Heimdal for encoding fix RFC 4402 specifies the implementation of the gss_pseudo_random() function for the krb5 mechanism (and the C bindings therein). The implementation uses a PRF+ function that concatenates the output of individual krb5 pseudo-random operations produced with a counter and seed. The original implementation of this function in Heimdal incorrectly encoded the counter as a little-endian integer, but the RFC specifies the counter encoding as big-endian. The implementation initializes the counter to zero, so the first block of output (16 octets, for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 specifies that the counter should begin at 1, but both existing implementations begin with zero and it looks like the standard will be re-issued, with test vectors, to begin at zero.) This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6, from 13 October, 2013: % Fix krb5's gss_pseudo_random() (n is big-endian) % % The first enctype RFC3961 prf output length's bytes are correct because % the little- and big-endian representations of unsigned zero are the % same. The second block of output was wrong because the counter was not % being encoded as big-endian. % % This change could break applications. But those applications would not % have been interoperating with other implementations anyways (in % particular: MIT's). Bump __FreeBSD_version accordingly and add a note in UPDATING. Approved by: hrs (mentor, src committer) Modified: stable/9/UPDATING (contents, props changed) stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c stable/9/sys/sys/param.h Directory Properties: stable/9/crypto/heimdal/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Dec 16 02:04:28 2013 (r259447) +++ stable/9/UPDATING Mon Dec 16 02:25:28 2013 (r259448) @@ -11,6 +11,17 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20131216: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 902505. + 20130930: 9.2-RELEASE. Modified: stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 02:04:28 2013 (r259447) +++ stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 02:25:28 2013 (r259448) @@ -117,7 +117,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ num = 0; p = prf_out->value; while(desired_output_len > 0) { - _gsskrb5_encode_om_uint32(num, input.data); + _gsskrb5_encode_be_om_uint32(num, input.data); ret = krb5_crypto_prf(context, crypto, &input, &output); if (ret) { OM_uint32 junk; @@ -129,7 +129,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ return GSS_S_FAILURE; } memcpy(p, output.data, min(desired_output_len, output.length)); - p += output.length; + p += tsize; desired_output_len -= output.length; krb5_data_free(&output); num++; Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Mon Dec 16 02:04:28 2013 (r259447) +++ stable/9/sys/sys/param.h Mon Dec 16 02:25:28 2013 (r259448) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 902504 /* Master, propagated to newvers */ +#define __FreeBSD_version 902505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 02:30:57 2013 Return-Path: Delivered-To: svn-src-all@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 E0FDA6DC; Mon, 16 Dec 2013 02:30:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCFBE1749; Mon, 16 Dec 2013 02:30:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG2UvDg008667; Mon, 16 Dec 2013 02:30:57 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG2UvH5008664; Mon, 16 Dec 2013 02:30:57 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160230.rBG2UvH5008664@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 02:30:57 +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: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 02:30:58 -0000 Author: bjk (doc committer) Date: Mon Dec 16 02:30:56 2013 New Revision: 259449 URL: http://svnweb.freebsd.org/changeset/base/259449 Log: MFC r259286,259424,259425: Apply patch from upstream Heimdal for encoding fix RFC 4402 specifies the implementation of the gss_pseudo_random() function for the krb5 mechanism (and the C bindings therein). The implementation uses a PRF+ function that concatenates the output of individual krb5 pseudo-random operations produced with a counter and seed. The original implementation of this function in Heimdal incorrectly encoded the counter as a little-endian integer, but the RFC specifies the counter encoding as big-endian. The implementation initializes the counter to zero, so the first block of output (16 octets, for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 specifies that the counter should begin at 1, but both existing implementations begin with zero and it looks like the standard will be re-issued, with test vectors, to begin at zero.) This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6, from 13 October, 2013: % Fix krb5's gss_pseudo_random() (n is big-endian) % % The first enctype RFC3961 prf output length's bytes are correct because % the little- and big-endian representations of unsigned zero are the % same. The second block of output was wrong because the counter was not % being encoded as big-endian. % % This change could break applications. But those applications would not % have been interoperating with other implementations anyways (in % particular: MIT's). Bump __FreeBSD_version accordingly and add a note in UPDATING. Approved by: hrs (mentor, src committer) Modified: stable/8/UPDATING (contents, props changed) stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c stable/8/sys/sys/param.h Directory Properties: stable/8/crypto/heimdal/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon Dec 16 02:25:28 2013 (r259448) +++ stable/8/UPDATING Mon Dec 16 02:30:56 2013 (r259449) @@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20131216: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 804501. + 20130823: Behavior of devfs rules path matching has been changed. Pattern is now always matched against fully qualified devfs Modified: stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 02:25:28 2013 (r259448) +++ stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 02:30:56 2013 (r259449) @@ -117,7 +117,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ num = 0; p = prf_out->value; while(desired_output_len > 0) { - _gsskrb5_encode_om_uint32(num, input.data); + _gsskrb5_encode_be_om_uint32(num, input.data); ret = krb5_crypto_prf(context, crypto, &input, &output); if (ret) { OM_uint32 junk; @@ -129,7 +129,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ return GSS_S_FAILURE; } memcpy(p, output.data, min(desired_output_len, output.length)); - p += output.length; + p += tsize; desired_output_len -= output.length; krb5_data_free(&output); num++; Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Mon Dec 16 02:25:28 2013 (r259448) +++ stable/8/sys/sys/param.h Mon Dec 16 02:30:56 2013 (r259449) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804500 /* Master, propagated to newvers */ +#define __FreeBSD_version 804501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 02:34:38 2013 Return-Path: Delivered-To: svn-src-all@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 932AF848; Mon, 16 Dec 2013 02:34:38 +0000 (UTC) Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com [IPv6:2607:f8b0:4003:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22272176D; Mon, 16 Dec 2013 02:34:38 +0000 (UTC) Received: by mail-ob0-f178.google.com with SMTP id uz6so4245116obc.9 for ; Sun, 15 Dec 2013 18:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=l/jX3A/JTpvLvx1lVwv4PT2y8JB9o9kxbJU5x1JIZf8=; b=PVRkUMwUhKyuyX+4V4sjOa3SbZ3XmMixwmQZ1x7yYE/1U+9k50we4wkOl2ztJFe8te Au14HCiQuQMRksvzIhY/C0e6BiYasPgm9awYf0MOET+rXL3qsZeiBUTDBFs0EY5NLN6c ylBDGfJedzJ3OF8pUgJsA3Pfab1ao7kPBulQ95GYfnwQOv7nxyKGkv4axeGdxeRQjj/Y Zk6eMpYqv/bCZ6huPK8B8Ir58doHNYCc6qViSZrQozInjyhOqUFaWkI4C/nVgRRL7o/s ScaVXzVUPwNsJwia8endFi3U3hMBUsO394SmwSNFR9wEOcGijPLxu4cRBtWvWQGxpaXH sByQ== MIME-Version: 1.0 X-Received: by 10.60.115.138 with SMTP id jo10mr65052oeb.71.1387161277412; Sun, 15 Dec 2013 18:34:37 -0800 (PST) Received: by 10.182.142.101 with HTTP; Sun, 15 Dec 2013 18:34:37 -0800 (PST) In-Reply-To: <201312160225.rBG2PSwj005645@svn.freebsd.org> References: <201312160225.rBG2PSwj005645@svn.freebsd.org> Date: Sun, 15 Dec 2013 21:34:37 -0500 Message-ID: Subject: Re: svn commit: r259448 - in stable/9: . crypto/heimdal/lib/gssapi/krb5 sys/sys From: Benjamin Kaduk To: Benjamin Kaduk Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 02:34:38 -0000 On Sun, Dec 15, 2013 at 9:25 PM, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Mon Dec 16 02:25:28 2013 > New Revision: 259448 > URL: http://svnweb.freebsd.org/changeset/base/259448 > > Directory Properties: > stable/9/crypto/heimdal/ (props changed) > stable/9/sys/ (props changed) > stable/9/sys/sys/ (props changed) > I am not sure why there is mergeinfo on sys/sys; we chalked it up to the broken state of mergeinfo on stable/[89] in general. -Ben From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 03:40:46 2013 Return-Path: Delivered-To: svn-src-all@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 A46B9D0F; Mon, 16 Dec 2013 03:40:46 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 742FC1D4E; Mon, 16 Dec 2013 03:40:46 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:5604:a6ff:fe3a:96ea]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id B624222A4F; Mon, 16 Dec 2013 03:40:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us B624222A4F Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sun, 15 Dec 2013 22:40:43 -0500 From: Glen Barber To: Benjamin Kaduk Subject: Re: svn commit: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 sys/sys Message-ID: <20131216034043.GK1446@glenbarber.us> References: <201312160230.rBG2UvH5008664@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M9kwpIYUMbI/2cCx" Content-Disposition: inline In-Reply-To: <201312160230.rBG2UvH5008664@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 03:40:46 -0000 --M9kwpIYUMbI/2cCx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 16, 2013 at 02:30:57AM +0000, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Mon Dec 16 02:30:56 2013 > New Revision: 259449 > URL: http://svnweb.freebsd.org/changeset/base/259449 >=20 > Log: > MFC r259286,259424,259425: > Apply patch from upstream Heimdal for encoding fix > =20 > RFC 4402 specifies the implementation of the gss_pseudo_random() > function for the krb5 mechanism (and the C bindings therein). > The implementation uses a PRF+ function that concatenates the output > of individual krb5 pseudo-random operations produced with a counter > and seed. The original implementation of this function in Heimdal > incorrectly encoded the counter as a little-endian integer, but the > RFC specifies the counter encoding as big-endian. The implementation > initializes the counter to zero, so the first block of output (16 oct= ets, > for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 speci= fies > that the counter should begin at 1, but both existing implementations > begin with zero and it looks like the standard will be re-issued, with > test vectors, to begin at zero.) > =20 This breaks stable/8 build. Glen --M9kwpIYUMbI/2cCx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSrnY7AAoJELls3eqvi17QHvwP/jR7CKp7Jdj6L+nzmCk6u6nR lKFdkwNjnG/b2W+Rr4KVREZGReNe1+t++OnFrSgo3HuWc5Ou8ulXKHeg4NSRinf2 3RO2gLNZhSi6EH3GHdgRronJcRi4N9Fo91n0CV3uUQswA6CeMD9150sgaKEH91r4 CH9cXGO5XBiws1wlAkUpYq74Yg8urREyMqxgbPC/iQV6KUCKCEczfpc/aGD8B5Tn 32Ytk0U3XhHQHrVvZxwx3w15HEztQSD7aPclgaq599wOLt9wqQELkaQd8DmxJdVm UzqMcHc6c6JMTNGmr9eEftGPoMAfcI6ws7sa+JQVZPW9GJRik5YeQC5dfmth92Gr e62YwJ8+99WCnOYcRsH8charCaNfaIc3TsCklwU8QfusFNZS+GojhU0WnRSbW5v2 KuJ7sl9nH02DoN2UspFhTNX0OXroOJgZUeV9y98veBnEpnI+BJAY/Naul8Ya17wE WnoVUaib8GOmoPevIx1CjxrZJtJC3uyJKhXF9HwUwa2LqAjolilNatbzFYBDnjRP TvdPD8NnuMMPT2+QJU+tZaKY7QXQbj872a8zjgyw7yCW37U5diTnJ1gOdb/EXO8k aO9nE8j2wdqJpr9u8Yrhg5kLgykfDHzxr4Zg5ecRHVlcOxUYiD+2SHV4pbzq+RUu iUV2m96IaeSO/xlN88zI =kaj+ -----END PGP SIGNATURE----- --M9kwpIYUMbI/2cCx-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 03:48:53 2013 Return-Path: Delivered-To: svn-src-all@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 097CCE96; Mon, 16 Dec 2013 03:48:53 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08D4D1DBC; Mon, 16 Dec 2013 03:48:51 +0000 (UTC) X-AuditID: 1209190c-b7f7f6d000000bbd-80-52ae782210c6 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id C3.C5.03005.2287EA25; Sun, 15 Dec 2013 22:48:50 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id rBG3mnrc001867; Sun, 15 Dec 2013 22:48:49 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBG3mkTW029404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 15 Dec 2013 22:48:48 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id rBG3mkiX017764; Sun, 15 Dec 2013 22:48:46 -0500 (EST) Date: Sun, 15 Dec 2013 22:48:46 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Glen Barber Subject: Re: svn commit: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 sys/sys In-Reply-To: <20131216034043.GK1446@glenbarber.us> Message-ID: References: <201312160230.rBG2UvH5008664@svn.freebsd.org> <20131216034043.GK1446@glenbarber.us> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42IRYrdT0VWqWBdksOKAhMWkOa9ZLfY3H2Cz +NM+hcXiz6aFrBY9i88wWWzbvJfdgc1jxqf5LAGMUVw2Kak5mWWpRfp2CVwZ9+euYS5YzFWx 4/U/pgbGJo4uRk4OCQETiUnLNzFC2GISF+6tZ+ti5OIQEpjNJPHpXDM7hLORUWLRwV2MEM4h Jokdv0+yQDgNjBLvZ89jAelnEdCWODRlHyuIzSagJvF4bzMrxFxFic2nJjGD2CJA9rK1z8DG MgssZZTYuXcfkMPBISwQJXH9bgVIDaeAkcSUpY/A6nkFHCU2H7kPNkdIIF6iYe9fsFtFBXQk Vu+fwgJRIyhxcuYTMJtZwFLi3J/rbBMYhWYhSc1CklrAyLSKUTYlt0o3NzEzpzg1Wbc4OTEv L7VI11AvN7NELzWldBMjKMQ5JXl2ML45qHSIUYCDUYmHV8FyXZAQa2JZcWXuIUZJDiYlUV62 cqAQX1J+SmVGYnFGfFFpTmrxIUYJDmYlEd6Yq2uDhHhTEiurUovyYVLSHCxK4rw3OeyDhATS E0tSs1NTC1KLYLIyHBxKErw8IEMFi1LTUyvSMnNKENJMHJwgw3mAhr8sA6rhLS5IzC3OTIfI n2JUlBLn/QCSEABJZJTmwfXCUtArRnGgV4R534JU8QDTF1z3K6DBTECDvfesAhlckoiQkmpg XLvy94fVsYopb4UmP3wStOnUwWUFYeqMy6V79sw5mn31wGxbvYObo5fxvW4WzM6uakzaq3Vq Y0/UVI28u8ut5rxrCp54zeLy/HUTde5nqwQ9uHy1a2bo4j9JTbGSbz965+7s2dV0Ns9G43W1 zOqPUu+ZOjlqr8efVlBgOSXpvHHnGuNflZv+VSqxFGckGmoxFxUnAgDFFRfEHAMAAA== Cc: Benjamin Kaduk , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 03:48:53 -0000 On Sun, 15 Dec 2013, Glen Barber wrote: > On Mon, Dec 16, 2013 at 02:30:57AM +0000, Benjamin Kaduk wrote: >> Author: bjk (doc committer) >> Date: Mon Dec 16 02:30:56 2013 >> New Revision: 259449 >> URL: http://svnweb.freebsd.org/changeset/base/259449 >> >> Log: >> MFC r259286,259424,259425: >> Apply patch from upstream Heimdal for encoding fix >> >> RFC 4402 specifies the implementation of the gss_pseudo_random() >> function for the krb5 mechanism (and the C bindings therein). >> The implementation uses a PRF+ function that concatenates the output >> of individual krb5 pseudo-random operations produced with a counter >> and seed. The original implementation of this function in Heimdal >> incorrectly encoded the counter as a little-endian integer, but the >> RFC specifies the counter encoding as big-endian. The implementation >> initializes the counter to zero, so the first block of output (16 octets, >> for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 specifies >> that the counter should begin at 1, but both existing implementations >> begin with zero and it looks like the standard will be re-issued, with >> test vectors, to begin at zero.) >> > > This breaks stable/8 build. Looking... -Ben From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 04:01:28 2013 Return-Path: Delivered-To: svn-src-all@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 DFDB9312; Mon, 16 Dec 2013 04:01:27 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 682AF1EA0; Mon, 16 Dec 2013 04:01:20 +0000 (UTC) Received: from alph.d.allbsd.org (p2106-ipbf2009funabasi.chiba.ocn.ne.jp [114.146.169.106]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id rBG410UO087427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Dec 2013 13:01:11 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id rBG40wvA059710; Mon, 16 Dec 2013 13:00:59 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 16 Dec 2013 13:00:52 +0900 (JST) Message-Id: <20131216.130052.128049839311409145.hrs@allbsd.org> To: bjk@FreeBSD.org Subject: Re: svn commit: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 sys/sys From: Hiroki Sato In-Reply-To: References: <201312160230.rBG2UvH5008664@svn.freebsd.org> <20131216034043.GK1446@glenbarber.us> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Dec_16_13_00_52_2013_160)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 16 Dec 2013 13:01:11 +0900 (JST) X-Spam-Status: No, score=-95.6 required=13.0 tests=CONTENT_TYPE_PRESENT, RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: gjb@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 04:01:28 -0000 ----Security_Multipart(Mon_Dec_16_13_00_52_2013_160)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Benjamin Kaduk wrote in : bj> On Sun, 15 Dec 2013, Glen Barber wrote: bj> bj> > On Mon, Dec 16, 2013 at 02:30:57AM +0000, Benjamin Kaduk wrote: bj> >> Author: bjk (doc committer) bj> >> Date: Mon Dec 16 02:30:56 2013 bj> >> New Revision: 259449 bj> >> URL: http://svnweb.freebsd.org/changeset/base/259449 bj> >> bj> >> Log: bj> >> MFC r259286,259424,259425: bj> >> Apply patch from upstream Heimdal for encoding fix bj> >> bj> >> RFC 4402 specifies the implementation of the gss_pseudo_random() bj> >> function for the krb5 mechanism (and the C bindings therein). bj> >> The implementation uses a PRF+ function that concatenates the output bj> >> of individual krb5 pseudo-random operations produced with a counter bj> >> and seed. The original implementation of this function in Heimdal bj> >> incorrectly encoded the counter as a little-endian integer, but the bj> >> RFC specifies the counter encoding as big-endian. The implementation bj> >> initializes the counter to zero, so the first block of output (16 bj> >> octets, bj> >> for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 bj> >> specifies bj> >> that the counter should begin at 1, but both existing implementations bj> >> begin with zero and it looks like the standard will be re-issued, with bj> >> test vectors, to begin at zero.) bj> >> bj> > bj> > This breaks stable/8 build. bj> bj> Looking... It seems tsize = min(desired_output_len, output.length) and /output.length/tsize/ just after the p+= line are missing for stable/9 and /8. -- Hiroki ----Security_Multipart(Mon_Dec_16_13_00_52_2013_160)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlKuevQACgkQTyzT2CeTzy3rUwCcD/fYpZHzXBhncLeRiV9a3D11 yjQAn1zP4JtqBMdibYjtE51yYzAkzfuh =YZOy -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Dec_16_13_00_52_2013_160)---- From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 04:15:52 2013 Return-Path: Delivered-To: svn-src-all@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 5D394E77; Mon, 16 Dec 2013 04:15:52 +0000 (UTC) Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu [18.9.25.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42BD81FD7; Mon, 16 Dec 2013 04:15:50 +0000 (UTC) X-AuditID: 1209190e-b7efb6d000000bb9-81-52ae7e751ff6 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id C0.F7.03001.57E7EA25; Sun, 15 Dec 2013 23:15:49 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id rBG4FmSS003819; Sun, 15 Dec 2013 23:15:48 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBG4FjU5004832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 15 Dec 2013 23:15:47 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id rBG4FjhL021229; Sun, 15 Dec 2013 23:15:45 -0500 (EST) Date: Sun, 15 Dec 2013 23:15:45 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Hiroki Sato Subject: Re: svn commit: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 sys/sys In-Reply-To: <20131216.130052.128049839311409145.hrs@allbsd.org> Message-ID: References: <201312160230.rBG2UvH5008664@svn.freebsd.org> <20131216034043.GK1446@glenbarber.us> <20131216.130052.128049839311409145.hrs@allbsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT0S2tWxdkcPeIosWkOa9ZLfY3H2Cz uNW+itniT/sUFos/mxayWvQsPsNksW3zXnYHdo8Zn+azBDBGcdmkpOZklqUW6dslcGXc+TiH peCwQMXGrbcYGxif8HQxcnJICJhIvHwzhw3CFpO4cG89mC0kMJtJ4umJnC5GLiB7I6PEx9tb GCGcQ0wSj14tYoNwGhgl5i++yQjSwiKgLTHx6yRWEJtNQE3i8d5mVoixihKbT01i7mLk4BAB svuPeIP0MgssZZQ4Nf8kWFxYIEri+t0KkHJOAQeJ508WsIGEeQUcJRY9t4FYdZJR4kjnJrCR ogI6Eqv3T2EBsXkFBCVOznwCZjMLWEqc+3OdbQKj0CwkqVlIUgsYmVYxyqbkVunmJmbmFKcm 6xYnJ+blpRbpGuvlZpbopaaUbmIEBTqnJN8Oxq8HlQ4xCnAwKvHwKliuCxJiTSwrrsw9xCjJ waQkyruqBijEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhDfm6togId6UxMqq1KJ8mJQ0B4uSOO9N DvsgIYH0xJLU7NTUgtQimKwMB4eSBO+dWqChgkWp6akVaZk5JQhpJg5OkOE8QMN3gNTwFhck 5hZnpkPkTzEqSonzrgFJCIAkMkrz4HphiegVozjQK8K830GqeIBJDK77FdBgJqDB3ntWgQwu SURISTUwTiqzMFrdtlHNRuijz/cVmu/lBUJW+c360HbUtvXmBXaN5wfmT/HJWvPbL8k5dOHP 83eEzvUHTXHg9nm2Sez1q1U7KsNPGrkvTRKqft5Z/1h+elRKvANzgdXklBeLu6Z1b2Gbfmfd ln9XpLdqCr+Xs1/Rq/1Aubj6ltyC7zzfghtfbfu1pVVirxJLcUaioRZzUXEiAIYLUfAfAwAA Cc: bjk@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, gjb@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 04:15:52 -0000 On Mon, 16 Dec 2013, Hiroki Sato wrote: > Benjamin Kaduk wrote > in : > > bj> On Sun, 15 Dec 2013, Glen Barber wrote: > bj> > bj> > On Mon, Dec 16, 2013 at 02:30:57AM +0000, Benjamin Kaduk wrote: > bj> >> Author: bjk (doc committer) > bj> >> Date: Mon Dec 16 02:30:56 2013 > bj> >> New Revision: 259449 > bj> >> URL: http://svnweb.freebsd.org/changeset/base/259449 > bj> >> > bj> >> Log: > bj> >> MFC r259286,259424,259425: > bj> >> Apply patch from upstream Heimdal for encoding fix > bj> >> > bj> >> RFC 4402 specifies the implementation of the gss_pseudo_random() > bj> >> function for the krb5 mechanism (and the C bindings therein). > bj> >> The implementation uses a PRF+ function that concatenates the output > bj> >> of individual krb5 pseudo-random operations produced with a counter > bj> >> and seed. The original implementation of this function in Heimdal > bj> >> incorrectly encoded the counter as a little-endian integer, but the > bj> >> RFC specifies the counter encoding as big-endian. The implementation > bj> >> initializes the counter to zero, so the first block of output (16 > bj> >> octets, > bj> >> for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 > bj> >> specifies > bj> >> that the counter should begin at 1, but both existing implementations > bj> >> begin with zero and it looks like the standard will be re-issued, with > bj> >> test vectors, to begin at zero.) > bj> >> > bj> > > bj> > This breaks stable/8 build. > bj> > bj> Looking... > > It seems tsize = min(desired_output_len, output.length) and > /output.length/tsize/ just after the p+= line are missing for > stable/9 and /8. Yes, a difference between heimdal 1.1 and 1.5.1. I was not happy that Nico put an unrelated change in the bug fix, but for head it is best to take upstream's patch as-is, to avoid causing conflicts for future imports. The fix is just to revert the unrelated hunk of the patch to prf.c. -Ben From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 06:41:32 2013 Return-Path: Delivered-To: svn-src-all@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 4A42417E; Mon, 16 Dec 2013 06:41:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 356DF1CC6; Mon, 16 Dec 2013 06:41:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG6fWGL098453; Mon, 16 Dec 2013 06:41:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG6fWiY098452; Mon, 16 Dec 2013 06:41:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312160641.rBG6fWiY098452@svn.freebsd.org> From: Xin LI Date: Mon, 16 Dec 2013 06:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259450 - stable/10/sys/i386/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 06:41:32 -0000 Author: delphij Date: Mon Dec 16 06:41:31 2013 New Revision: 259450 URL: http://svnweb.freebsd.org/changeset/base/259450 Log: MFC r258950: Enable Hyper-V support in i386 GENERIC. Modified: stable/10/sys/i386/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Mon Dec 16 02:30:56 2013 (r259449) +++ stable/10/sys/i386/conf/GENERIC Mon Dec 16 06:41:31 2013 (r259450) @@ -346,6 +346,9 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +# HyperV drivers +device hyperv # HyperV drivers + # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 06:52:31 2013 Return-Path: Delivered-To: svn-src-all@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 78B795EF; Mon, 16 Dec 2013 06:52:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63F0D1D95; Mon, 16 Dec 2013 06:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG6qVhL002120; Mon, 16 Dec 2013 06:52:31 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG6qVnF002119; Mon, 16 Dec 2013 06:52:31 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160652.rBG6qVnF002119@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 06:52:31 +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: r259451 - stable/9/crypto/heimdal/lib/gssapi/krb5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 06:52:31 -0000 Author: bjk (doc committer) Date: Mon Dec 16 06:52:30 2013 New Revision: 259451 URL: http://svnweb.freebsd.org/changeset/base/259451 Log: Fix build breakage after r259448 Approved by: hrs (mentor, src committer) Modified: stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c Modified: stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 06:41:31 2013 (r259450) +++ stable/9/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 06:52:30 2013 (r259451) @@ -129,7 +129,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ return GSS_S_FAILURE; } memcpy(p, output.data, min(desired_output_len, output.length)); - p += tsize; + p += output.length; desired_output_len -= output.length; krb5_data_free(&output); num++; From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 06:56:39 2013 Return-Path: Delivered-To: svn-src-all@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 4ABD677C; Mon, 16 Dec 2013 06:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 351081DBF; Mon, 16 Dec 2013 06:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG6udFQ002693; Mon, 16 Dec 2013 06:56:39 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG6udt2002692; Mon, 16 Dec 2013 06:56:39 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312160656.rBG6udt2002692@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 16 Dec 2013 06:56:39 +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: r259452 - stable/8/crypto/heimdal/lib/gssapi/krb5 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 06:56:39 -0000 Author: bjk (doc committer) Date: Mon Dec 16 06:56:38 2013 New Revision: 259452 URL: http://svnweb.freebsd.org/changeset/base/259452 Log: Fix build breakage after r259449 Approved by: hrs (mentor, src committer) Modified: stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c Modified: stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 06:52:30 2013 (r259451) +++ stable/8/crypto/heimdal/lib/gssapi/krb5/prf.c Mon Dec 16 06:56:38 2013 (r259452) @@ -129,7 +129,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ return GSS_S_FAILURE; } memcpy(p, output.data, min(desired_output_len, output.length)); - p += tsize; + p += output.length; desired_output_len -= output.length; krb5_data_free(&output); num++; From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 07:01:13 2013 Return-Path: Delivered-To: svn-src-all@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 CB11D8F9; Mon, 16 Dec 2013 07:01:13 +0000 (UTC) Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu [18.7.68.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B62401E28; Mon, 16 Dec 2013 07:01:12 +0000 (UTC) X-AuditID: 12074425-b7fd96d000000c39-0a-52aea536c448 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 12.4D.03129.735AEA25; Mon, 16 Dec 2013 02:01:11 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id rBG719J7014145; Mon, 16 Dec 2013 02:01:10 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBG716eT011981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Dec 2013 02:01:08 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id rBG71586012698; Mon, 16 Dec 2013 02:01:05 -0500 (EST) Date: Mon, 16 Dec 2013 02:01:05 -0500 (EST) From: Benjamin Kaduk To: gjb@freebsd.org Subject: Re: svn commit: r259449 - in stable/8: . crypto/heimdal/lib/gssapi/krb5 sys/sys In-Reply-To: Message-ID: References: <201312160230.rBG2UvH5008664@svn.freebsd.org> <20131216034043.GK1446@glenbarber.us> <20131216.130052.128049839311409145.hrs@allbsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IRYrdT0TVfui7IYMsFFotJc16zWuxvPsBm cat9FbPFn/YpLBZ/Ni1ktehZfIbJYtvmvewO7B4zPs1nCWCM4rJJSc3JLEst0rdL4Mq4svAU U8Fx4Yol12YxNTBO4O9i5OSQEDCRWPOzkxnCFpO4cG89WxcjF4eQwGwmid0bfjJBOBsZJf7N 3AblHGKSOLb4GwuE08Ao8XXhZRaQfhYBbYkVizaxgthsAioSM99sZAOxRQSEJdY9OAc2l1ng CKPExbZZQEUcHMICURLX71aA1HAKOEm87LoHVs8r4CjRvbGPHWLBf0aJ/beWgSVEBXQkVu+f wgJRJChxcuYTMJtZwFLi3J/rbBMYBWchSc1CklrAyLSKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI 10IvN7NELzWldBMjOKxdVHcwTjikdIhRgINRiYdX0XJdkBBrYllxZe4hRkkOJiVR3olzgUJ8 SfkplRmJxRnxRaU5qcWHGCU4mJVEeGOurg0S4k1JrKxKLcqHSUlzsCiJ897isA8SEkhPLEnN Tk0tSC2CycpwcChJ8OotARoqWJSanlqRlplTgpBm4uAEGc4DNNwEpIa3uCAxtzgzHSJ/ilFR Spz33WKghABIIqM0D64XlnZeMYoDvSLM6w7SzgNMWXDdr4AGMwEN9t6zCmRwSSJCSqqB0Ue/ 54TWgo8dJwJqjly6p7dQpap610R5x3Xu3FfdT1dNLzlz+cSEiX0mj373vd6+lePd7W/dsRqu NlfzG/jFij7VmzQf3rzs4twapwc7tmbu2S2l+uzGIrXC3kLn7OyfDetFjm52qzaeXfz67SY7 1rtHVeW/eZbtate5V2HWkReunpt8jiVPQYmlOCPRUIu5qDgRAMKJ89MWAwAA Cc: Benjamin Kaduk , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 07:01:13 -0000 On Sun, 15 Dec 2013, Benjamin Kaduk wrote: > On Mon, 16 Dec 2013, Hiroki Sato wrote: > >> Benjamin Kaduk wrote >> in : >> >> bj> On Sun, 15 Dec 2013, Glen Barber wrote: >> bj> >> bj> > On Mon, Dec 16, 2013 at 02:30:57AM +0000, Benjamin Kaduk wrote: >> bj> >> Author: bjk (doc committer) >> bj> >> Date: Mon Dec 16 02:30:56 2013 >> bj> >> New Revision: 259449 >> bj> >> URL: http://svnweb.freebsd.org/changeset/base/259449 >> bj> >> >> bj> >> Log: >> bj> >> MFC r259286,259424,259425: >> bj> >> Apply patch from upstream Heimdal for encoding fix >> bj> >> >> bj> >> RFC 4402 specifies the implementation of the gss_pseudo_random() >> bj> >> function for the krb5 mechanism (and the C bindings therein). >> bj> >> The implementation uses a PRF+ function that concatenates the >> output >> bj> >> of individual krb5 pseudo-random operations produced with a >> counter >> bj> >> and seed. The original implementation of this function in >> Heimdal >> bj> >> incorrectly encoded the counter as a little-endian integer, but >> the >> bj> >> RFC specifies the counter encoding as big-endian. The >> implementation >> bj> >> initializes the counter to zero, so the first block of output >> (16 >> bj> >> octets, >> bj> >> for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 >> bj> >> specifies >> bj> >> that the counter should begin at 1, but both existing >> implementations >> bj> >> begin with zero and it looks like the standard will be >> re-issued, with >> bj> >> test vectors, to begin at zero.) >> bj> >> >> bj> > >> bj> > This breaks stable/8 build. >> bj> >> bj> Looking... >> >> It seems tsize = min(desired_output_len, output.length) and >> /output.length/tsize/ just after the p+= line are missing for >> stable/9 and /8. > > Yes, a difference between heimdal 1.1 and 1.5.1. I was not happy that Nico > put an unrelated change in the bug fix, but for head it is best to take > upstream's patch as-is, to avoid causing conflicts for future imports. > > The fix is just to revert the unrelated hunk of the patch to prf.c. Committed in r259451 and r259452. Sorry for the breakage, and thanks for the prompt report. I guess my eyes failed to differentiate between "Heimdal 1.1" and "Heimdal 1.5.1" while looking at the logs deciding whether the merge was necessary. -Ben From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 08:10:40 2013 Return-Path: Delivered-To: svn-src-all@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 4A704D3B; Mon, 16 Dec 2013 08:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33D0C13DB; Mon, 16 Dec 2013 08:10:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG8AeV5030107; Mon, 16 Dec 2013 08:10:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG8Adg4030099; Mon, 16 Dec 2013 08:10:39 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160810.rBG8Adg4030099@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 08:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259453 - in stable/10: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 08:10:40 -0000 Author: hselasky Date: Mon Dec 16 08:10:38 2013 New Revision: 259453 URL: http://svnweb.freebsd.org/changeset/base/259453 Log: MFC r238274, r246752, r256720, r256721, r256722, r256955, r257409 r257429, r257435, r257712, r257732, r257743, r257748, r257955 r257957, r257958, r258082, r258641, r258643, r258732, r258733, r258840, r258919, r258921, r259029, r259030, r259031, r259032 and r259046: - Add support for the MediaTek/Ralink RT5370/RT5372 chipset. - Various minor USB WLAN fixes and improvements. PR: usb/182936 Modified: stable/10/share/man/man4/run.4 stable/10/share/man/man4/runfw.4 stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rum.c stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_runreg.h stable/10/sys/dev/usb/wlan/if_runvar.h stable/10/sys/dev/usb/wlan/if_uath.c stable/10/sys/dev/usb/wlan/if_upgt.c stable/10/sys/dev/usb/wlan/if_ural.c stable/10/sys/dev/usb/wlan/if_urtw.c stable/10/sys/dev/usb/wlan/if_urtwn.c stable/10/sys/dev/usb/wlan/if_zyd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/run.4 ============================================================================== --- stable/10/share/man/man4/run.4 Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/share/man/man4/run.4 Mon Dec 16 08:10:38 2013 (r259453) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd November 11, 2013 .Dt RUN 4 .Os .Sh NAME @@ -52,7 +52,7 @@ runfw_load="YES" The .Nm driver supports USB 2.0 wireless adapters based on the Ralink RT2700U, -RT2800U and RT3000U chipsets. +RT2800U, RT3000U and RT3900E chipsets. .Pp The RT2700U chipset consists of two integrated chips, an RT2770 MAC/BBP and an RT2720 (1T2R) or RT2750 (dual-band 1T2R) radio transceiver. @@ -64,6 +64,9 @@ The RT3000U is a single-chip solution ba an RT3020 (1T1R), RT3021 (1T2R) or RT3022 (2T2R) single-band radio transceiver. .Pp +The RT3900E is a single-chip solution based on an RT5390 MAC/BBP and +an RT5370 (1T1R) or RT5372 (2T2R) single-band radio transceiver. +.Pp These are the modes the .Nm driver can operate in: @@ -129,7 +132,8 @@ driver supports the following wireless a .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 -.It D-Link DWA-140 rev B1, B2 +.It D-Link DWA-140 rev B1, B2, B3 +.It D-Link DWA-160 rev B2 .It DrayTek Vigor N61 .It Edimax EW-7711UAn .It Edimax EW-7711UTn @@ -156,6 +160,8 @@ driver supports the following wireless a .It SMC SMCWUSBS-N2 .It Sweex LW303 .It Sweex LW313 +.It TP-LINK TL-WDN3200 +.It TP-LINK TL-WN727N v3 .It Unex DNUR-81 .It Unex DNUR-82 .It ZyXEL NWD210N Modified: stable/10/share/man/man4/runfw.4 ============================================================================== --- stable/10/share/man/man4/runfw.4 Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/share/man/man4/runfw.4 Mon Dec 16 08:10:38 2013 (r259453) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2011 +.Dd November 11, 2013 .Dt RUNFW 4 .Os .Sh NAME @@ -43,7 +43,7 @@ runfw_load="YES" .Ed .Sh DESCRIPTION This module provides firmware sets for the Ralink RT2700U, -RT2800U and RT3000U chip based USB WiFi adapters. +RT2800U, RT3000U and RT3900E chip based USB WiFi adapters. Please read Ralink's license, src/sys/contrib/dev/run/LICENSE. .Sh SEE ALSO .Xr run 4 , Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/sys/dev/usb/usbdevs Mon Dec 16 08:10:38 2013 (r259453) @@ -1549,6 +1549,8 @@ product DLINK DWLG122 0x3c00 DWL-G122 b product DLINK DUBE100B1 0x3c05 DUB-E100 rev B1 product DLINK RT2870 0x3c09 RT2870 product DLINK RT3072 0x3c0a RT3072 +product DLINK DWA140B3 0x3c15 DWA-140 rev B3 +product DLINK DWA160B2 0x3c1a DWA-160 rev B2 product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet @@ -3572,6 +3574,7 @@ product RALINK RT3072 0x3072 RT3072 product RALINK RT3370 0x3370 RT3370 product RALINK RT3572 0x3572 RT3572 product RALINK RT5370 0x5370 RT5370 +product RALINK RT5572 0x5572 RT5572 product RALINK RT8070 0x8070 RT8070 product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Mon Dec 16 08:10:38 2013 (r259453) @@ -480,8 +480,13 @@ rsu_vap_create(struct ieee80211com *ic, if (uvp == NULL) return (NULL); vap = &uvp->vap; - ieee80211_vap_setup(ic, vap, name, unit, opmode, - flags, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags, bssid, mac) != 0) { + /* out of memory */ + free(uvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ uvp->newstate = vap->iv_newstate; @@ -1153,7 +1158,7 @@ rsu_event_survey(struct rsu_softc *sc, u wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON; wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; - *(uint16_t *)wh->i_dur = 0; + USETW(wh->i_dur, 0); IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); Modified: stable/10/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rum.c Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/sys/dev/usb/wlan/if_rum.c Mon Dec 16 08:10:38 2013 (r259453) @@ -604,8 +604,13 @@ rum_vap_create(struct ieee80211com *ic, return NULL; vap = &rvp->vap; /* enable s/w bmiss handling for sta mode */ - ieee80211_vap_setup(ic, vap, name, unit, opmode, - flags | IEEE80211_CLONE_NOBEACONS, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags | IEEE80211_CLONE_NOBEACONS, bssid, mac) != 0) { + /* out of memory */ + free(rvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ rvp->newstate = vap->iv_newstate; @@ -1131,7 +1136,7 @@ rum_tx_mgt(struct rum_softc *sc, struct dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); /* tell hardware to add timestamp for probe responses */ if ((wh->i_fc[0] & @@ -1275,7 +1280,7 @@ rum_tx_data(struct rum_softc *sc, struct dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); } rum_setup_tx_desc(sc, &data->desc, flags, 0, m0->m_pkthdr.len, rate); Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 16 06:56:38 2013 (r259452) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 16 08:10:38 2013 (r259453) @@ -2,6 +2,7 @@ * Copyright (c) 2008,2010 Damien Bergamini * ported to FreeBSD by Akinori Furukoshi * USB Consulting, Hans Petter Selasky + * Copyright (c) 2013 Kevin Lo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ __FBSDID("$FreeBSD$"); /*- - * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver. + * Ralink Technology RT2700U/RT2800U/RT3000U/RT3900E chipset driver. * http://www.ralinktech.com/ */ @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define N(_a) ((int)(sizeof((_a)) / sizeof((_a)[0]))) - #ifdef USB_DEBUG #define RUN_DEBUG #endif @@ -173,6 +172,8 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(DLINK, RT2870), RUN_DEV(DLINK, RT3072), RUN_DEV(DLINK, DWA127), + RUN_DEV(DLINK, DWA140B3), + RUN_DEV(DLINK, DWA160B2), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), RUN_DEV(DLINK2, RT2870_2), @@ -256,6 +257,8 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(RALINK, RT3072), RUN_DEV(RALINK, RT3370), RUN_DEV(RALINK, RT3572), + RUN_DEV(RALINK, RT5370), + RUN_DEV(RALINK, RT5572), RUN_DEV(RALINK, RT8070), RUN_DEV(SAMSUNG, WIS09ABGN), RUN_DEV(SAMSUNG2, RT2870_1), @@ -319,7 +322,7 @@ static usb_callback_t run_bulk_tx_callba static usb_callback_t run_bulk_tx_callback5; static void run_bulk_tx_callbackN(struct usb_xfer *xfer, - usb_error_t error, unsigned int index); + usb_error_t error, u_int index); static struct ieee80211vap *run_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -343,13 +346,13 @@ static int run_write_region_1(struct run static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, int); static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *); -static int run_rt2870_rf_write(struct run_softc *, uint8_t, uint32_t); +static int run_rt2870_rf_write(struct run_softc *, uint32_t); static int run_rt3070_rf_read(struct run_softc *, uint8_t, uint8_t *); static int run_rt3070_rf_write(struct run_softc *, uint8_t, uint8_t); static int run_bbp_read(struct run_softc *, uint8_t, uint8_t *); static int run_bbp_write(struct run_softc *, uint8_t, uint8_t); static int run_mcu_cmd(struct run_softc *, uint8_t, uint16_t); -static const char *run_get_rf(int); +static const char *run_get_rf(uint16_t); static int run_read_eeprom(struct run_softc *); static struct ieee80211_node *run_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); @@ -361,7 +364,7 @@ static void run_key_update_begin(struct static void run_key_update_end(struct ieee80211vap *); static void run_key_set_cb(void *); static int run_key_set(struct ieee80211vap *, struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); + const uint8_t mac[IEEE80211_ADDR_LEN]); static void run_key_delete_cb(void *); static int run_key_delete(struct ieee80211vap *, struct ieee80211_key *); static void run_ratectl_to(void *); @@ -393,6 +396,8 @@ static void run_set_rx_antenna(struct ru static void run_rt2870_set_chan(struct run_softc *, u_int); static void run_rt3070_set_chan(struct run_softc *, u_int); static void run_rt3572_set_chan(struct run_softc *, u_int); +static void run_rt5390_set_chan(struct run_softc *, u_int); +static void run_rt5592_set_chan(struct run_softc *, u_int); static int run_set_chan(struct run_softc *, struct ieee80211_channel *); static void run_set_channel(struct ieee80211com *); static void run_scan_start(struct ieee80211com *); @@ -416,16 +421,19 @@ static void run_update_mcast(struct ifne static int8_t run_rssi2dbm(struct run_softc *, uint8_t, uint8_t); static void run_update_promisc_locked(struct ifnet *); static void run_update_promisc(struct ifnet *); +static void run_rt5390_bbp_init(struct run_softc *); static int run_bbp_init(struct run_softc *); static int run_rt3070_rf_init(struct run_softc *); +static void run_rt5390_rf_init(struct run_softc *); static int run_rt3070_filter_calib(struct run_softc *, uint8_t, uint8_t, uint8_t *); static void run_rt3070_rf_setup(struct run_softc *); static int run_txrx_enable(struct run_softc *); +static void run_adjust_freq_offset(struct run_softc *); static void run_init(void *); static void run_init_locked(struct run_softc *); static void run_stop(void *); -static void run_delay(struct run_softc *, unsigned int); +static void run_delay(struct run_softc *, u_int); static const struct { uint16_t reg; @@ -439,6 +447,25 @@ static const struct { uint8_t val; } rt2860_def_bbp[] = { RT2860_DEF_BBP +},rt5390_def_bbp[] = { + RT5390_DEF_BBP +},rt5592_def_bbp[] = { + RT5592_DEF_BBP +}; + +/* + * Default values for BBP register R196 for RT5592. + */ +static const uint8_t rt5592_bbp_r196[] = { + 0xe0, 0x1f, 0x38, 0x32, 0x08, 0x28, 0x19, 0x0a, 0xff, 0x00, + 0x16, 0x10, 0x10, 0x0b, 0x36, 0x2c, 0x26, 0x24, 0x42, 0x36, + 0x30, 0x2d, 0x4c, 0x46, 0x3d, 0x40, 0x3e, 0x42, 0x3d, 0x40, + 0x3c, 0x34, 0x2c, 0x2f, 0x3c, 0x35, 0x2e, 0x2a, 0x49, 0x41, + 0x36, 0x31, 0x30, 0x30, 0x0e, 0x0d, 0x28, 0x21, 0x1c, 0x16, + 0x50, 0x4a, 0x43, 0x40, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7d, 0x14, 0x32, 0x2c, 0x36, 0x4c, 0x43, 0x2c, + 0x2e, 0x36, 0x30, 0x6e }; static const struct rfprog { @@ -454,6 +481,15 @@ struct { RT3070_RF3052 }; +static const struct rt5592_freqs { + uint16_t n; + uint8_t k, m, r; +} rt5592_freqs_20mhz[] = { + RT5592_RF5592_20MHZ +},rt5592_freqs_40mhz[] = { + RT5592_RF5592_40MHZ +}; + static const struct { uint8_t reg; uint8_t val; @@ -461,6 +497,25 @@ static const struct { RT3070_DEF_RF },rt3572_def_rf[] = { RT3572_DEF_RF +},rt5390_def_rf[] = { + RT5390_DEF_RF +},rt5392_def_rf[] = { + RT5392_DEF_RF +},rt5592_def_rf[] = { + RT5592_DEF_RF +},rt5592_2ghz_def_rf[] = { + RT5592_2GHZ_DEF_RF +},rt5592_5ghz_def_rf[] = { + RT5592_5GHZ_DEF_RF +}; + +static const struct { + u_int firstchan; + u_int lastchan; + uint8_t reg; + uint8_t val; +} rt5592_chan_5ghz[] = { + RT5592_CHAN_5GHZ }; static const struct usb_config run_config[RUN_N_XFER] = { @@ -557,7 +612,7 @@ run_attach(device_t self) struct ieee80211com *ic; struct ifnet *ifp; uint32_t ver; - int i, ntries, error; + int ntries, error; uint8_t iface_index, bands; device_set_usb_desc(self); @@ -654,27 +709,11 @@ run_attach(device_t self) bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); + if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || + sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT5592_RF_5592) + setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - /* - * Do this by own because h/w supports - * more channels than ieee80211_init_channels() - */ - if (sc->rf_rev == RT2860_RF_2750 || - sc->rf_rev == RT2860_RF_2850 || - sc->rf_rev == RT3070_RF_3052) { - /* set supported .11a rates */ - for (i = 14; i < N(rt2860_rf2850); i++) { - uint8_t chan = rt2860_rf2850[i].chan; - ic->ic_channels[ic->ic_nchans].ic_freq = - ieee80211_ieee2mhz(chan, IEEE80211_CHAN_A); - ic->ic_channels[ic->ic_nchans].ic_ieee = chan; - ic->ic_channels[ic->ic_nchans].ic_flags = IEEE80211_CHAN_A; - ic->ic_channels[ic->ic_nchans].ic_extieee = 0; - ic->ic_nchans++; - } - } - ieee80211_ifattach(ic, sc->sc_bssid); ic->ic_scan_start = run_scan_start; @@ -699,7 +738,7 @@ run_attach(device_t self) TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc); TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc); - callout_init((struct callout *)&sc->ratectl_ch, 1); + usb_callout_init_mtx(&sc->ratectl_ch, &sc->sc_mtx, 0); if (bootverbose) ieee80211_announce(ic); @@ -803,7 +842,13 @@ run_vap_create(struct ieee80211com *ic, if (rvp == NULL) return (NULL); vap = &rvp->vap; - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, + opmode, flags, bssid, mac) != 0) { + /* out of memory */ + free(rvp, M_80211_VAP); + return (NULL); + } vap->iv_key_update_begin = run_key_update_begin; vap->iv_key_update_end = run_key_update_end; @@ -1009,13 +1054,12 @@ run_load_microcode(struct run_softc *sc) /* cheap sanity check */ temp = fw->data; bytes = *temp; - if (bytes != be64toh(0xffffff0210280210)) { + if (bytes != be64toh(0xffffff0210280210ULL)) { device_printf(sc->sc_dev, "firmware checksum failed\n"); error = EINVAL; goto fail; } - run_read(sc, RT2860_ASIC_VER_ID, &tmp); /* write microcode image */ run_write_region_1(sc, RT2870_FW_BASE, base, 4096); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); @@ -1062,7 +1106,7 @@ fail: return (error); } -int +static int run_reset(struct run_softc *sc) { usb_device_request_t req; @@ -1164,13 +1208,32 @@ run_write_region_1(struct run_softc *sc, return (error); #else usb_device_request_t req; + int error = 0; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = RT2870_WRITE_REGION_1; - USETW(req.wValue, 0); - USETW(req.wIndex, reg); - USETW(req.wLength, len); - return (run_do_request(sc, &req, buf)); + /* + * NOTE: It appears the WRITE_REGION_1 command cannot be + * passed a huge amount of data, which will crash the + * firmware. Limit amount of data passed to 64-bytes at a + * time. + */ + while (len > 0) { + int delta = 64; + if (delta > len) + delta = len; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2870_WRITE_REGION_1; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, delta); + error = run_do_request(sc, &req, __DECONST(uint8_t *, buf)); + if (error != 0) + break; + reg += delta; + buf += delta; + len -= delta; + } + return (error); #endif } @@ -1260,7 +1323,7 @@ run_srom_read(struct run_softc *sc, uint } static int -run_rt2870_rf_write(struct run_softc *sc, uint8_t reg, uint32_t val) +run_rt2870_rf_write(struct run_softc *sc, uint32_t val) { uint32_t tmp; int error, ntries; @@ -1274,10 +1337,7 @@ run_rt2870_rf_write(struct run_softc *sc if (ntries == 10) return (ETIMEDOUT); - /* RF registers are 24-bit on the RT2860 */ - tmp = RT2860_RF_REG_CTRL | 24 << RT2860_RF_REG_WIDTH_SHIFT | - (val & 0x3fffff) << 2 | (reg & 3); - return (run_write(sc, RT2860_RF_CSR_CFG0, tmp)); + return (run_write(sc, RT2860_RF_CSR_CFG0, val)); } static int @@ -1428,7 +1488,7 @@ b4inc(uint32_t b32, int8_t delta) } static const char * -run_get_rf(int rev) +run_get_rf(uint16_t rev) { switch (rev) { case RT2860_RF_2820: return "RT2820"; @@ -1440,11 +1500,14 @@ run_get_rf(int rev) case RT3070_RF_3021: return "RT3021"; case RT3070_RF_3022: return "RT3022"; case RT3070_RF_3052: return "RT3052"; + case RT5592_RF_5592: return "RT5592"; + case RT5390_RF_5370: return "RT5370"; + case RT5390_RF_5372: return "RT5372"; } return ("unknown"); } -int +static int run_read_eeprom(struct run_softc *sc) { int8_t delta_2ghz, delta_5ghz; @@ -1476,21 +1539,25 @@ run_read_eeprom(struct run_softc *sc) sc->sc_bssid[4] = val & 0xff; sc->sc_bssid[5] = val >> 8; - /* read vender BBP settings */ - for (i = 0; i < 10; i++) { - run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val); - sc->bbp[i].val = val & 0xff; - sc->bbp[i].reg = val >> 8; - DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val); - } - if (sc->mac_ver >= 0x3071) { - /* read vendor RF settings */ + if (sc->mac_ver < 0x5390) { + /* read vender BBP settings */ for (i = 0; i < 10; i++) { - run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, &val); - sc->rf[i].val = val & 0xff; - sc->rf[i].reg = val >> 8; - DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg, - sc->rf[i].val); + run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val); + sc->bbp[i].val = val & 0xff; + sc->bbp[i].reg = val >> 8; + DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, + sc->bbp[i].val); + } + if (sc->mac_ver >= 0x3071) { + /* read vendor RF settings */ + for (i = 0; i < 10; i++) { + run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, + &val); + sc->rf[i].val = val & 0xff; + sc->rf[i].reg = val >> 8; + DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg, + sc->rf[i].val); + } } } @@ -1516,7 +1583,11 @@ run_read_eeprom(struct run_softc *sc) sc->leds, sc->led[0], sc->led[1], sc->led[2]); /* read RF information */ - run_srom_read(sc, RT2860_EEPROM_ANTENNA, &val); + if (sc->mac_ver == 0x5390 || sc->mac_ver ==0x5392) + run_srom_read(sc, 0x00, &val); + else + run_srom_read(sc, RT2860_EEPROM_ANTENNA, &val); + if (val == 0xffff) { DPRINTF("invalid EEPROM antenna info, using default\n"); if (sc->mac_ver == 0x3572) { @@ -1536,11 +1607,15 @@ run_read_eeprom(struct run_softc *sc) sc->nrxchains = 2; } } else { - sc->rf_rev = (val >> 8) & 0xf; + if (sc->mac_ver == 0x5390 || sc->mac_ver ==0x5392) { + sc->rf_rev = val; + run_srom_read(sc, RT2860_EEPROM_ANTENNA, &val); + } else + sc->rf_rev = (val >> 8) & 0xf; sc->ntxchains = (val >> 4) & 0xf; sc->nrxchains = val & 0xf; } - DPRINTF("EEPROM RF rev=0x%02x chains=%dT%dR\n", + DPRINTF("EEPROM RF rev=0x%04x chains=%dT%dR\n", sc->rf_rev, sc->ntxchains, sc->nrxchains); /* check if RF supports automatic Tx access gain control */ @@ -1564,16 +1639,29 @@ run_read_eeprom(struct run_softc *sc) sc->txpow1[i + 0] = (int8_t)(val & 0xff); sc->txpow1[i + 1] = (int8_t)(val >> 8); - run_srom_read(sc, RT2860_EEPROM_PWR2GHZ_BASE2 + i / 2, &val); - sc->txpow2[i + 0] = (int8_t)(val & 0xff); - sc->txpow2[i + 1] = (int8_t)(val >> 8); + if (sc->mac_ver != 0x5390) { + run_srom_read(sc, + RT2860_EEPROM_PWR2GHZ_BASE2 + i / 2, &val); + sc->txpow2[i + 0] = (int8_t)(val & 0xff); + sc->txpow2[i + 1] = (int8_t)(val >> 8); + } } /* fix broken Tx power entries */ for (i = 0; i < 14; i++) { - if (sc->txpow1[i] < 0 || sc->txpow1[i] > 31) - sc->txpow1[i] = 5; - if (sc->txpow2[i] < 0 || sc->txpow2[i] > 31) - sc->txpow2[i] = 5; + if (sc->mac_ver >= 0x5390) { + if (sc->txpow1[i] < 0 || sc->txpow1[i] > 27) + sc->txpow1[i] = 5; + } else { + if (sc->txpow1[i] < 0 || sc->txpow1[i] > 31) + sc->txpow1[i] = 5; + } + if (sc->mac_ver > 0x5390) { + if (sc->txpow2[i] < 0 || sc->txpow2[i] > 27) + sc->txpow2[i] = 5; + } else if (sc->mac_ver < 0x5390) { + if (sc->txpow2[i] < 0 || sc->txpow2[i] > 31) + sc->txpow2[i] = 5; + } DPRINTF("chan %d: power1=%d, power2=%d\n", rt2860_rf2850[i].chan, sc->txpow1[i], sc->txpow2[i]); } @@ -1588,11 +1676,13 @@ run_read_eeprom(struct run_softc *sc) sc->txpow2[i + 15] = (int8_t)(val >> 8); } /* fix broken Tx power entries */ - for (i = 0; i < 40; i++) { - if (sc->txpow1[14 + i] < -7 || sc->txpow1[14 + i] > 15) - sc->txpow1[14 + i] = 5; - if (sc->txpow2[14 + i] < -7 || sc->txpow2[14 + i] > 15) - sc->txpow2[14 + i] = 5; + for (i = 0; i < 40; i++ ) { + if (sc->mac_ver != 0x5592) { + if (sc->txpow1[14 + i] < -7 || sc->txpow1[14 + i] > 15) + sc->txpow1[14 + i] = 5; + if (sc->txpow2[14 + i] < -7 || sc->txpow2[14 + i] > 15) + sc->txpow2[14 + i] = 5; + } DPRINTF("chan %d: power1=%d, power2=%d\n", rt2860_rf2850[14 + i].chan, sc->txpow1[14 + i], sc->txpow2[14 + i]); @@ -2236,8 +2326,10 @@ run_ratectl_cb(void *arg, int pending) ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); } + RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_UNLOCK(sc); } static void @@ -2472,12 +2564,15 @@ run_rx_frame(struct run_softc *sc, struc struct rt2870_rxd *rxd; struct rt2860_rxwi *rxwi; uint32_t flags; - uint16_t len, phy; + uint16_t len, rxwisize; uint8_t ant, rssi; int8_t nf; rxwi = mtod(m, struct rt2860_rxwi *); len = le16toh(rxwi->len) & 0xfff; + rxwisize = (sc->mac_ver == 0x5592) ? + sizeof(struct rt2860_rxwi) + sizeof(uint64_t) : + sizeof(struct rt2860_rxwi); if (__predict_false(len > dmalen)) { m_freem(m); ifp->if_ierrors++; @@ -2495,8 +2590,8 @@ run_rx_frame(struct run_softc *sc, struc return; } - m->m_data += sizeof(struct rt2860_rxwi); - m->m_pkthdr.len = m->m_len -= sizeof(struct rt2860_rxwi); + m->m_data += rxwisize; + m->m_pkthdr.len = m->m_len -= rxwisize; wh = mtod(m, struct ieee80211_frame *); @@ -2516,7 +2611,8 @@ run_rx_frame(struct run_softc *sc, struc if (__predict_false(flags & RT2860_RX_MICERR)) { /* report MIC failures to net80211 for TKIP */ if (ni != NULL) - ieee80211_notify_michael_failure(ni->ni_vap, wh, rxwi->keyidx); + ieee80211_notify_michael_failure(ni->ni_vap, wh, + rxwi->keyidx); m_freem(m); ifp->if_ierrors++; DPRINTF("MIC error. Someone is lying.\n"); @@ -2539,6 +2635,7 @@ run_rx_frame(struct run_softc *sc, struc if (__predict_false(ieee80211_radiotap_active(ic))) { struct run_rx_radiotap_header *tap = &sc->sc_rxtap; + uint16_t phy; tap->wr_flags = 0; tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); @@ -2583,8 +2680,13 @@ run_bulk_rx_callback(struct usb_xfer *xf struct mbuf *m = NULL; struct mbuf *m0; uint32_t dmalen; + uint16_t rxwisize; int xferlen; + rxwisize = (sc->mac_ver == 0x5592) ? + sizeof(struct rt2860_rxwi) + sizeof(uint64_t) : + sizeof(struct rt2860_rxwi); + usbd_xfer_status(xfer, &xferlen, NULL, NULL, NULL); switch (USB_GET_STATE(xfer)) { @@ -2592,8 +2694,8 @@ run_bulk_rx_callback(struct usb_xfer *xf DPRINTFN(15, "rx done, actlen=%d\n", xferlen); - if (xferlen < (int)(sizeof(uint32_t) + - sizeof(struct rt2860_rxwi) + sizeof(struct rt2870_rxd))) { + if (xferlen < (int)(sizeof(uint32_t) + rxwisize + + sizeof(struct rt2870_rxd))) { DPRINTF("xfer too short %d\n", xferlen); goto tr_setup; } @@ -2675,6 +2777,7 @@ tr_setup: m->m_data += 4; m->m_pkthdr.len = m->m_len -= 4; run_rx_frame(sc, m, dmalen); + m = NULL; /* don't free source buffer */ break; } @@ -2696,6 +2799,9 @@ tr_setup: m->m_pkthdr.len = m->m_len -= dmalen + 8; } + /* make sure we free the source buffer, if any */ + m_freem(m); + RUN_LOCK(sc); } @@ -2723,7 +2829,7 @@ run_tx_free(struct run_endpoint_queue *p } static void -run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, unsigned int index) +run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, u_int index) { struct run_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = sc->sc_ifp; @@ -2763,8 +2869,10 @@ tr_setup: STAILQ_REMOVE_HEAD(&pq->tx_qh, next); m = data->m; + size = (sc->mac_ver == 0x5592) ? + RUN_MAX_TXSZ + sizeof(uint32_t) : RUN_MAX_TXSZ; if ((m->m_pkthdr.len + - sizeof(data->desc) + 3 + 8) > RUN_MAX_TXSZ) { + sizeof(data->desc) + 3 + 8) > size) { DPRINTF("data overflow, %u bytes\n", m->m_pkthdr.len); @@ -2776,7 +2884,8 @@ tr_setup: } pc = usbd_xfer_get_frame(xfer, 0); - size = sizeof(data->desc); + size = (sc->mac_ver == 0x5592) ? + sizeof(data->desc) + sizeof(uint32_t) : sizeof(data->desc); usbd_copy_in(pc, 0, &data->desc, size); usbd_m_copy_in(pc, size, m, 0, m->m_pkthdr.len); size += m->m_pkthdr.len; @@ -2791,9 +2900,8 @@ tr_setup: vap = data->ni->ni_vap; if (ieee80211_radiotap_active_vap(vap)) { struct run_tx_radiotap_header *tap = &sc->sc_txtap; - struct rt2860_txwi *txwi = + struct rt2860_txwi *txwi = (struct rt2860_txwi *)(&data->desc + sizeof(struct rt2870_txd)); - tap->wt_flags = 0; tap->wt_rate = rt2860_rates[data->ridx].rate; tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); @@ -2903,7 +3011,7 @@ run_set_tx_desc(struct run_softc *sc, st struct ieee80211_frame *wh; struct rt2870_txd *txd; struct rt2860_txwi *txwi; - uint16_t xferlen; + uint16_t xferlen, txwisize; uint16_t mcs; uint8_t ridx = data->ridx; uint8_t pad; @@ -2911,7 +3019,9 @@ run_set_tx_desc(struct run_softc *sc, st /* get MCS code from rate index */ mcs = rt2860_rates[ridx].mcs; - xferlen = sizeof(*txwi) + m->m_pkthdr.len; + txwisize = (sc->mac_ver == 0x5592) ? + sizeof(*txwi) + sizeof(uint32_t) : sizeof(*txwi); + xferlen = txwisize + m->m_pkthdr.len; /* roundup to 32-bit alignment */ xferlen = (xferlen + 3) & ~3; @@ -3037,7 +3147,7 @@ run_tx(struct run_softc *sc, struct mbuf dur = rt2860_rates[ctl_ridx].sp_ack_dur; else dur = rt2860_rates[ctl_ridx].lp_ack_dur; - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); } /* reserve slots for mgmt packets, just in case */ @@ -3054,12 +3164,12 @@ run_tx(struct run_softc *sc, struct mbuf txd->flags = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) txwi->wcid = 0; - } else { + else txwi->wcid = (vap->iv_opmode == IEEE80211_M_STA) ? 1 : RUN_AID2WCID(ni->ni_associd); - } + /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; @@ -3117,9 +3227,9 @@ run_tx(struct run_softc *sc, struct mbuf usbd_transfer_start(sc->sc_xfer[qid]); - DPRINTFN(8, "sending data frame len=%d rate=%d qid=%d\n", m->m_pkthdr.len + - (int)(sizeof (struct rt2870_txd) + sizeof (struct rt2860_rxwi)), - rt2860_rates[ridx].rate, qid); + DPRINTFN(8, "sending data frame len=%d rate=%d qid=%d\n", + m->m_pkthdr.len + (int)(sizeof(struct rt2870_txd) + + sizeof(struct rt2860_txwi)), rt2860_rates[ridx].rate, qid); return (0); } @@ -3156,7 +3266,7 @@ run_tx_mgt(struct run_softc *sc, struct dur = ieee80211_ack_duration(ic->ic_rt, rt2860_rates[ridx].rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); } if (sc->sc_epq[0].tx_nfree == 0) { @@ -3183,7 +3293,7 @@ run_tx_mgt(struct run_softc *sc, struct run_set_tx_desc(sc, data); DPRINTFN(10, "sending mgt frame len=%d rate=%d\n", m->m_pkthdr.len + - (int)(sizeof (struct rt2870_txd) + sizeof (struct rt2860_rxwi)), + (int)(sizeof(struct rt2870_txd) + sizeof(struct rt2860_txwi)), rt2860_rates[ridx].rate); STAILQ_INSERT_TAIL(&sc->sc_epq[0].tx_qh, data, next); @@ -3513,18 +3623,63 @@ run_select_chan_group(struct run_softc * run_bbp_write(sc, 62, 0x37 - sc->lna[group]); run_bbp_write(sc, 63, 0x37 - sc->lna[group]); run_bbp_write(sc, 64, 0x37 - sc->lna[group]); - run_bbp_write(sc, 86, 0x00); + if (sc->mac_ver < 0x3572) + run_bbp_write(sc, 86, 0x00); if (group == 0) { if (sc->ext_2ghz_lna) { - run_bbp_write(sc, 82, 0x62); - run_bbp_write(sc, 75, 0x46); + if (sc->mac_ver >= 0x5390) + run_bbp_write(sc, 75, 0x52); + else { + run_bbp_write(sc, 82, 0x62); + run_bbp_write(sc, 75, 0x46); + } } else { - run_bbp_write(sc, 82, 0x84); - run_bbp_write(sc, 75, 0x50); + if (sc->mac_ver == 0x5592) { + run_bbp_write(sc, 79, 0x1c); + run_bbp_write(sc, 80, 0x0e); + run_bbp_write(sc, 81, 0x3a); + run_bbp_write(sc, 82, 0x62); + + run_bbp_write(sc, 195, 0x80); + run_bbp_write(sc, 196, 0xe0); + run_bbp_write(sc, 195, 0x81); + run_bbp_write(sc, 196, 0x1f); + run_bbp_write(sc, 195, 0x82); + run_bbp_write(sc, 196, 0x38); + run_bbp_write(sc, 195, 0x83); + run_bbp_write(sc, 196, 0x32); + run_bbp_write(sc, 195, 0x85); + run_bbp_write(sc, 196, 0x28); + run_bbp_write(sc, 195, 0x86); + run_bbp_write(sc, 196, 0x19); + } else if (sc->mac_ver >= 0x5390) + run_bbp_write(sc, 75, 0x50); + else { + run_bbp_write(sc, 82, 0x84); + run_bbp_write(sc, 75, 0x50); + } } } else { - if (sc->mac_ver == 0x3572) + if (sc->mac_ver == 0x5592) { + run_bbp_write(sc, 79, 0x18); + run_bbp_write(sc, 80, 0x08); + run_bbp_write(sc, 81, 0x38); + run_bbp_write(sc, 82, 0x92); + + run_bbp_write(sc, 195, 0x80); + run_bbp_write(sc, 196, 0xf0); + run_bbp_write(sc, 195, 0x81); + run_bbp_write(sc, 196, 0x1e); + run_bbp_write(sc, 195, 0x82); + run_bbp_write(sc, 196, 0x28); + run_bbp_write(sc, 195, 0x83); + run_bbp_write(sc, 196, 0x20); + run_bbp_write(sc, 195, 0x85); + run_bbp_write(sc, 196, 0x7f); + run_bbp_write(sc, 195, 0x86); + run_bbp_write(sc, 196, 0x7f); + } else if (sc->mac_ver == 0x3572) run_bbp_write(sc, 82, 0x94); else run_bbp_write(sc, 82, 0xf2); @@ -3559,6 +3714,11 @@ run_select_chan_group(struct run_softc * } else run_write(sc, RT2860_TX_PIN_CFG, tmp); + if (sc->mac_ver == 0x5592) { + run_bbp_write(sc, 195, 0x8d); + run_bbp_write(sc, 196, 0x1a); + } + /* set initial AGC value */ if (group == 0) { /* 2GHz band */ if (sc->mac_ver >= 0x3070) @@ -3566,7 +3726,9 @@ run_select_chan_group(struct run_softc * else agc = 0x2e + sc->lna[0]; } else { /* 5GHz band */ - if (sc->mac_ver == 0x3572) + if (sc->mac_ver == 0x5592) + agc = 0x24 + sc->lna[group] * 2; + else if (sc->mac_ver == 0x3572) agc = 0x22 + (sc->lna[group] * 5) / 3; else agc = 0x32 + (sc->lna[group] * 5) / 3; @@ -3575,7 +3737,7 @@ run_select_chan_group(struct run_softc * } static void -run_rt2870_set_chan(struct run_softc *sc, uint32_t chan) +run_rt2870_set_chan(struct run_softc *sc, u_int chan) { const struct rfprog *rfprog = rt2860_rf2850; uint32_t r2, r3, r4; @@ -3587,58 +3749,71 @@ run_rt2870_set_chan(struct run_softc *sc r2 = rfprog[i].r2; if (sc->ntxchains == 1) - r2 |= 1 << 12; /* 1T: disable Tx chain 2 */ + r2 |= 1 << 14; /* 1T: disable Tx chain 2 */ if (sc->nrxchains == 1) - r2 |= 1 << 15 | 1 << 4; /* 1R: disable Rx chains 2 & 3 */ + r2 |= 1 << 17 | 1 << 6; /* 1R: disable Rx chains 2 & 3 */ else if (sc->nrxchains == 2) - r2 |= 1 << 4; /* 2R: disable Rx chain 3 */ + r2 |= 1 << 6; /* 2R: disable Rx chain 3 */ /* use Tx power values from EEPROM */ txpow1 = sc->txpow1[i]; txpow2 = sc->txpow2[i]; + + /* Initialize RF R3 and R4. */ + r3 = rfprog[i].r3 & 0xffffc1ff; + r4 = (rfprog[i].r4 & ~(0x001f87c0)) | (sc->freq << 15); if (chan > 14) { - if (txpow1 >= 0) - txpow1 = txpow1 << 1 | 1; - else - txpow1 = (7 + txpow1) << 1; - if (txpow2 >= 0) - txpow2 = txpow2 << 1 | 1; - else - txpow2 = (7 + txpow2) << 1; + if (txpow1 >= 0) { + txpow1 = (txpow1 > 0xf) ? (0xf) : (txpow1); + r3 |= (txpow1 << 10) | (1 << 9); + } else { + txpow1 += 7; + + /* txpow1 is not possible larger than 15. */ + r3 |= (txpow1 << 10); + } + if (txpow2 >= 0) { + txpow2 = (txpow2 > 0xf) ? (0xf) : (txpow2); + r4 |= (txpow2 << 7) | (1 << 6); + } else { + txpow2 += 7; + r4 |= (txpow2 << 7); + } + } else { + /* Set Tx0 power. */ + r3 |= (txpow1 << 9); + + /* Set frequency offset and Tx1 power. */ + r4 |= (txpow2 << 6); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 08:51:59 2013 Return-Path: Delivered-To: svn-src-all@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 701029B1; Mon, 16 Dec 2013 08:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59C7D177B; Mon, 16 Dec 2013 08:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG8pxV1044684; Mon, 16 Dec 2013 08:51:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG8pw9i044678; Mon, 16 Dec 2013 08:51:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160851.rBG8pw9i044678@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 08:51:58 +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: r259454 - in stable/9/sys/dev/usb: . storage 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 08:51:59 -0000 Author: hselasky Date: Mon Dec 16 08:51:58 2013 New Revision: 259454 URL: http://svnweb.freebsd.org/changeset/base/259454 Log: MFC r244503 and r246565: Make sure all USB drivers allocate buffer memory through the USB API and/or busdma. The following assumptions have been made: umass - buffers passed from CAM/SCSI layer are OK network - mbufs are OK. Some other nits while at it. Modified: stable/9/sys/dev/usb/storage/ustorage_fs.c stable/9/sys/dev/usb/usb_msctest.c stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_uathvar.h stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_upgtvar.h stable/9/sys/dev/usb/wlan/if_urtw.c stable/9/sys/dev/usb/wlan/if_urtwvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- stable/9/sys/dev/usb/storage/ustorage_fs.c Mon Dec 16 08:10:38 2013 (r259453) +++ stable/9/sys/dev/usb/storage/ustorage_fs.c Mon Dec 16 08:51:58 2013 (r259454) @@ -74,7 +74,7 @@ SYSCTL_INT(_hw_usb_ustorage_fs, OID_AUTO /* Define some limits */ #ifndef USTORAGE_FS_BULK_SIZE -#define USTORAGE_FS_BULK_SIZE (1UL << 17) /* bytes */ +#define USTORAGE_FS_BULK_SIZE (1U << 17) /* bytes */ #endif #ifndef USTORAGE_FS_MAX_LUN @@ -85,8 +85,6 @@ SYSCTL_INT(_hw_usb_ustorage_fs, OID_AUTO #define USTORAGE_QDATA_MAX 40 /* bytes */ #endif -#define sc_cmd_data sc_cbw.CBWCDB - /* * The SCSI ID string must be exactly 28 characters long * exluding the terminating zero. @@ -176,8 +174,9 @@ struct ustorage_fs_lun { struct ustorage_fs_softc { - ustorage_fs_bbb_cbw_t sc_cbw; /* Command Wrapper Block */ - ustorage_fs_bbb_csw_t sc_csw; /* Command Status Block */ + ustorage_fs_bbb_cbw_t *sc_cbw; /* Command Wrapper Block */ + ustorage_fs_bbb_csw_t *sc_csw; /* Command Status Block */ + void *sc_dma_ptr; /* Main data buffer */ struct mtx sc_mtx; @@ -275,7 +274,6 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = sizeof(ustorage_fs_bbb_cbw_t), - .flags = {.ext_buffer = 1,}, .callback = &ustorage_fs_t_bbb_command_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -295,7 +293,7 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = USTORAGE_FS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1}, .callback = &ustorage_fs_t_bbb_data_read_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -315,7 +313,7 @@ static struct usb_config ustorage_fs_bbb .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = sizeof(ustorage_fs_bbb_csw_t), - .flags = {.short_xfer_ok = 1,.ext_buffer = 1,}, + .flags = {.short_xfer_ok = 1}, .callback = &ustorage_fs_t_bbb_status_callback, .usb_mode = USB_MODE_DEVICE, }, @@ -409,6 +407,14 @@ ustorage_fs_attach(device_t dev) "transfers, %s\n", usbd_errstr(err)); goto detach; } + + sc->sc_cbw = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_COMMAND], 0); + sc->sc_csw = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_STATUS], 0); + sc->sc_dma_ptr = usbd_xfer_get_frame_buffer(sc->sc_xfer[ + USTORAGE_FS_T_BBB_DATA_READ], 0); + /* start Mass Storage State Machine */ mtx_lock(&sc->sc_mtx); @@ -518,44 +524,44 @@ ustorage_fs_t_bbb_command_callback(struc switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - tag = UGETDW(sc->sc_cbw.dCBWSignature); + tag = UGETDW(sc->sc_cbw->dCBWSignature); if (tag != CBWSIGNATURE) { /* do nothing */ DPRINTF("invalid signature 0x%08x\n", tag); break; } - tag = UGETDW(sc->sc_cbw.dCBWTag); + tag = UGETDW(sc->sc_cbw->dCBWTag); /* echo back tag */ - USETDW(sc->sc_csw.dCSWTag, tag); + USETDW(sc->sc_csw->dCSWTag, tag); /* reset status */ - sc->sc_csw.bCSWStatus = 0; + sc->sc_csw->bCSWStatus = 0; /* reset data offset, data length and data remainder */ sc->sc_transfer.offset = 0; sc->sc_transfer.data_rem = - UGETDW(sc->sc_cbw.dCBWDataTransferLength); + UGETDW(sc->sc_cbw->dCBWDataTransferLength); /* reset data flags */ sc->sc_transfer.data_short = 0; /* extract LUN */ - sc->sc_transfer.lun = sc->sc_cbw.bCBWLUN; + sc->sc_transfer.lun = sc->sc_cbw->bCBWLUN; if (sc->sc_transfer.data_rem == 0) { sc->sc_transfer.cbw_dir = DIR_NONE; } else { - if (sc->sc_cbw.bCBWFlags & CBWFLAGS_IN) { + if (sc->sc_cbw->bCBWFlags & CBWFLAGS_IN) { sc->sc_transfer.cbw_dir = DIR_WRITE; } else { sc->sc_transfer.cbw_dir = DIR_READ; } } - sc->sc_transfer.cmd_len = sc->sc_cbw.bCDBLength; - if ((sc->sc_transfer.cmd_len > sizeof(sc->sc_cbw.CBWCDB)) || + sc->sc_transfer.cmd_len = sc->sc_cbw->bCDBLength; + if ((sc->sc_transfer.cmd_len > sizeof(sc->sc_cbw->CBWCDB)) || (sc->sc_transfer.cmd_len == 0)) { /* just halt - this is invalid */ DPRINTF("invalid command length %d bytes\n", @@ -597,9 +603,6 @@ tr_setup: usbd_xfer_set_stall(xfer); DPRINTF("stall pipe\n"); } - - usbd_xfer_set_frame_data(xfer, 0, &sc->sc_cbw, - sizeof(sc->sc_cbw)); usbd_transfer_submit(xfer); break; @@ -616,9 +619,9 @@ tr_setup: goto tr_setup; } if (err) { - if (sc->sc_csw.bCSWStatus == 0) { + if (sc->sc_csw->bCSWStatus == 0) { /* set some default error code */ - sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; + sc->sc_csw->bCSWStatus = CSWSTATUS_FAILED; } if (sc->sc_transfer.cbw_dir == DIR_READ) { /* dump all data */ @@ -699,6 +702,9 @@ ustorage_fs_t_bbb_data_read_callback(str switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: + /* XXX copy data from DMA buffer */ + memcpy(sc->sc_transfer.data_ptr, sc->sc_dma_ptr, actlen); + sc->sc_transfer.data_rem -= actlen; sc->sc_transfer.data_ptr += actlen; sc->sc_transfer.offset += actlen; @@ -721,8 +727,7 @@ tr_setup: usbd_xfer_set_stall(xfer); } - usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, - max_bulk); + usbd_xfer_set_frame_data(xfer, 0, sc->sc_dma_ptr, max_bulk); usbd_transfer_submit(xfer); break; @@ -778,8 +783,10 @@ tr_setup: usbd_xfer_set_stall(xfer); } - usbd_xfer_set_frame_data(xfer, 0, sc->sc_transfer.data_ptr, - max_bulk); + /* XXX copy data to DMA buffer */ + memcpy(sc->sc_dma_ptr, sc->sc_transfer.data_ptr, max_bulk); + + usbd_xfer_set_frame_data(xfer, 0, sc->sc_dma_ptr, max_bulk); usbd_transfer_submit(xfer); break; @@ -813,16 +820,13 @@ ustorage_fs_t_bbb_status_callback(struct case USB_ST_SETUP: tr_setup: - USETDW(sc->sc_csw.dCSWSignature, CSWSIGNATURE); - USETDW(sc->sc_csw.dCSWDataResidue, sc->sc_transfer.data_rem); + USETDW(sc->sc_csw->dCSWSignature, CSWSIGNATURE); + USETDW(sc->sc_csw->dCSWDataResidue, sc->sc_transfer.data_rem); if (sc->sc_transfer.data_error) { sc->sc_transfer.data_error = 0; usbd_xfer_set_stall(xfer); } - - usbd_xfer_set_frame_data(xfer, 0, &sc->sc_csw, - sizeof(sc->sc_csw)); usbd_transfer_submit(xfer); break; @@ -934,17 +938,17 @@ ustorage_fs_verify(struct ustorage_fs_so /* * Get the starting Logical Block Address */ - lba = get_be32(&sc->sc_cmd_data[2]); + lba = get_be32(&sc->sc_cbw->CBWCDB[2]); /* * We allow DPO (Disable Page Out = don't save data in the cache) * but we don't implement it. */ - if ((sc->sc_cmd_data[1] & ~0x10) != 0) { + if ((sc->sc_cbw->CBWCDB[1] & ~0x10) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - vlen = get_be16(&sc->sc_cmd_data[7]); + vlen = get_be16(&sc->sc_cbw->CBWCDB[7]); if (vlen == 0) { goto done; } @@ -1092,8 +1096,8 @@ ustorage_fs_read_capacity(struct ustorag { uint8_t *buf = sc->sc_transfer.data_ptr; struct ustorage_fs_lun *currlun = sc->sc_transfer.currlun; - uint32_t lba = get_be32(&sc->sc_cmd_data[2]); - uint8_t pmi = sc->sc_cmd_data[8]; + uint32_t lba = get_be32(&sc->sc_cbw->CBWCDB[2]); + uint8_t pmi = sc->sc_cbw->CBWCDB[8]; /* Check the PMI and LBA fields */ if ((pmi > 1) || ((pmi == 0) && (lba != 0))) { @@ -1126,7 +1130,7 @@ ustorage_fs_mode_sense(struct ustorage_f uint8_t *buf0; uint16_t len; uint16_t limit; - uint8_t mscmnd = sc->sc_cmd_data[0]; + uint8_t mscmnd = sc->sc_cbw->CBWCDB[0]; uint8_t pc; uint8_t page_code; uint8_t changeable_values; @@ -1134,13 +1138,13 @@ ustorage_fs_mode_sense(struct ustorage_f buf0 = buf; - if ((sc->sc_cmd_data[1] & ~0x08) != 0) { + if ((sc->sc_cbw->CBWCDB[1] & ~0x08) != 0) { /* Mask away DBD */ currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - pc = sc->sc_cmd_data[2] >> 6; - page_code = sc->sc_cmd_data[2] & 0x3f; + pc = sc->sc_cbw->CBWCDB[2] >> 6; + page_code = sc->sc_cbw->CBWCDB[2] & 0x3f; if (pc == 3) { currlun->sense_data = SS_SAVING_PARAMETERS_NOT_SUPPORTED; return (1); @@ -1237,9 +1241,9 @@ ustorage_fs_start_stop(struct ustorage_f currlun->sense_data = SS_INVALID_COMMAND; return (1); } - immed = sc->sc_cmd_data[1] & 0x01; - loej = sc->sc_cmd_data[4] & 0x02; - start = sc->sc_cmd_data[4] & 0x01; + immed = sc->sc_cbw->CBWCDB[1] & 0x01; + loej = sc->sc_cbw->CBWCDB[4] & 0x02; + start = sc->sc_cbw->CBWCDB[4] & 0x01; if (immed || loej || start) { /* compile fix */ @@ -1264,8 +1268,8 @@ ustorage_fs_prevent_allow(struct ustorag currlun->sense_data = SS_INVALID_COMMAND; return (1); } - prevent = sc->sc_cmd_data[4] & 0x01; - if ((sc->sc_cmd_data[4] & ~0x01) != 0) { + prevent = sc->sc_cbw->CBWCDB[4] & 0x01; + if ((sc->sc_cbw->CBWCDB[4] & ~0x01) != 0) { /* Mask away Prevent */ currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); @@ -1369,18 +1373,18 @@ ustorage_fs_read(struct ustorage_fs_soft * Get the starting Logical Block Address and check that it's not * too big */ - if (sc->sc_cmd_data[0] == SC_READ_6) { - lba = (((uint32_t)sc->sc_cmd_data[1]) << 16) | - get_be16(&sc->sc_cmd_data[2]); + if (sc->sc_cbw->CBWCDB[0] == SC_READ_6) { + lba = (((uint32_t)sc->sc_cbw->CBWCDB[1]) << 16) | + get_be16(&sc->sc_cbw->CBWCDB[2]); } else { - lba = get_be32(&sc->sc_cmd_data[2]); + lba = get_be32(&sc->sc_cbw->CBWCDB[2]); /* * We allow DPO (Disable Page Out = don't save data in the * cache) and FUA (Force Unit Access = don't read from the * cache), but we don't implement them. */ - if ((sc->sc_cmd_data[1] & ~0x18) != 0) { + if ((sc->sc_cbw->CBWCDB[1] & ~0x18) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } @@ -1427,11 +1431,11 @@ ustorage_fs_write(struct ustorage_fs_sof * Get the starting Logical Block Address and check that it's not * too big. */ - if (sc->sc_cmd_data[0] == SC_WRITE_6) - lba = (((uint32_t)sc->sc_cmd_data[1]) << 16) | - get_be16(&sc->sc_cmd_data[2]); + if (sc->sc_cbw->CBWCDB[0] == SC_WRITE_6) + lba = (((uint32_t)sc->sc_cbw->CBWCDB[1]) << 16) | + get_be16(&sc->sc_cbw->CBWCDB[2]); else { - lba = get_be32(&sc->sc_cmd_data[2]); + lba = get_be32(&sc->sc_cbw->CBWCDB[2]); /* * We allow DPO (Disable Page Out = don't save data in the @@ -1439,11 +1443,11 @@ ustorage_fs_write(struct ustorage_fs_sof * medium). We don't implement DPO; we implement FUA by * performing synchronous output. */ - if ((sc->sc_cmd_data[1] & ~0x18) != 0) { + if ((sc->sc_cbw->CBWCDB[1] & ~0x18) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - if (sc->sc_cmd_data[1] & 0x08) { + if (sc->sc_cbw->CBWCDB[1] & 0x08) { /* FUA */ /* XXX set SYNC flag here */ } @@ -1483,7 +1487,7 @@ ustorage_fs_min_len(struct ustorage_fs_s * there must be something wrong about this SCSI * command */ - sc->sc_csw.bCSWStatus = CSWSTATUS_PHASE; + sc->sc_csw->bCSWStatus = CSWSTATUS_PHASE; return (1); } /* compute the minimum length */ @@ -1519,18 +1523,18 @@ ustorage_fs_check_cmd(struct ustorage_fs uint16_t mask, uint8_t needs_medium) { struct ustorage_fs_lun *currlun; - uint8_t lun = (sc->sc_cmd_data[1] >> 5); + uint8_t lun = (sc->sc_cbw->CBWCDB[1] >> 5); uint8_t i; /* Verify the length of the command itself */ if (min_cmd_size > sc->sc_transfer.cmd_len) { DPRINTF("%u > %u\n", min_cmd_size, sc->sc_transfer.cmd_len); - sc->sc_csw.bCSWStatus = CSWSTATUS_PHASE; + sc->sc_csw->bCSWStatus = CSWSTATUS_PHASE; return (1); } /* Mask away the LUN */ - sc->sc_cmd_data[1] &= 0x1f; + sc->sc_cbw->CBWCDB[1] &= 0x1f; /* Check if LUN is correct */ if (lun != sc->sc_transfer.lun) { @@ -1540,7 +1544,7 @@ ustorage_fs_check_cmd(struct ustorage_fs if (sc->sc_transfer.lun <= sc->sc_last_lun) { sc->sc_transfer.currlun = currlun = sc->sc_lun + sc->sc_transfer.lun; - if (sc->sc_cmd_data[0] != SC_REQUEST_SENSE) { + if (sc->sc_cbw->CBWCDB[0] != SC_REQUEST_SENSE) { currlun->sense_data = SS_NO_SENSE; currlun->sense_data_info = 0; currlun->info_valid = 0; @@ -1551,8 +1555,8 @@ ustorage_fs_check_cmd(struct ustorage_fs * else must fail! */ if ((currlun->unit_attention_data != SS_NO_SENSE) && - (sc->sc_cmd_data[0] != SC_INQUIRY) && - (sc->sc_cmd_data[0] != SC_REQUEST_SENSE)) { + (sc->sc_cbw->CBWCDB[0] != SC_INQUIRY) && + (sc->sc_cbw->CBWCDB[0] != SC_REQUEST_SENSE)) { currlun->sense_data = currlun->unit_attention_data; currlun->unit_attention_data = SS_NO_SENSE; return (1); @@ -1564,8 +1568,8 @@ ustorage_fs_check_cmd(struct ustorage_fs * INQUIRY and REQUEST SENSE commands are explicitly allowed * to use unsupported LUNs; all others may not. */ - if ((sc->sc_cmd_data[0] != SC_INQUIRY) && - (sc->sc_cmd_data[0] != SC_REQUEST_SENSE)) { + if ((sc->sc_cbw->CBWCDB[0] != SC_INQUIRY) && + (sc->sc_cbw->CBWCDB[0] != SC_REQUEST_SENSE)) { return (1); } } @@ -1575,7 +1579,7 @@ ustorage_fs_check_cmd(struct ustorage_fs * non-zero. */ for (i = 0; i != min_cmd_size; i++) { - if (sc->sc_cmd_data[i] && !(mask & (1UL << i))) { + if (sc->sc_cbw->CBWCDB[i] && !(mask & (1UL << i))) { if (currlun) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; } @@ -1613,12 +1617,12 @@ ustorage_fs_do_cmd(struct ustorage_fs_so sc->sc_transfer.data_ptr = sc->sc_qdata; DPRINTF("cmd_data[0]=0x%02x, data_rem=0x%08x\n", - sc->sc_cmd_data[0], sc->sc_transfer.data_rem); + sc->sc_cbw->CBWCDB[0], sc->sc_transfer.data_rem); - switch (sc->sc_cmd_data[0]) { + switch (sc->sc_cbw->CBWCDB[0]) { case SC_INQUIRY: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); + error = ustorage_fs_min_len(sc, sc->sc_cbw->CBWCDB[4], -1U); if (error) { break; } @@ -1633,7 +1637,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_6: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); + error = ustorage_fs_min_len(sc, sc->sc_cbw->CBWCDB[4], -1U); if (error) { break; } @@ -1649,7 +1653,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_10: sc->sc_transfer.cmd_dir = DIR_READ; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), -1U); + get_be16(&sc->sc_cbw->CBWCDB[7]), -1U); if (error) { break; } @@ -1664,7 +1668,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SENSE_6: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); + error = ustorage_fs_min_len(sc, sc->sc_cbw->CBWCDB[4], -1U); if (error) { break; } @@ -1680,7 +1684,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SENSE_10: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), -1U); + get_be16(&sc->sc_cbw->CBWCDB[7]), -1U); if (error) { break; } @@ -1708,7 +1712,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; case SC_READ_6: - i = sc->sc_cmd_data[4]; + i = sc->sc_cbw->CBWCDB[4]; sc->sc_transfer.cmd_dir = DIR_WRITE; temp = ((i == 0) ? 256UL : i); error = ustorage_fs_min_len(sc, temp << 9, mask9); @@ -1726,7 +1730,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_10: sc->sc_transfer.cmd_dir = DIR_WRITE; - temp = get_be16(&sc->sc_cmd_data[7]); + temp = get_be16(&sc->sc_cbw->CBWCDB[7]); error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; @@ -1742,10 +1746,10 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_12: sc->sc_transfer.cmd_dir = DIR_WRITE; - temp = get_be32(&sc->sc_cmd_data[6]); + temp = get_be32(&sc->sc_cbw->CBWCDB[6]); if (temp >= (1UL << (32 - 9))) { /* numerical overflow */ - sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; + sc->sc_csw->bCSWStatus = CSWSTATUS_FAILED; error = 1; break; } @@ -1776,7 +1780,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_FORMAT_CAPACITIES: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_cmd_data[7]), -1U); + get_be16(&sc->sc_cbw->CBWCDB[7]), -1U); if (error) { break; } @@ -1791,7 +1795,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_REQUEST_SENSE: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U); + error = ustorage_fs_min_len(sc, sc->sc_cbw->CBWCDB[4], -1U); if (error) { break; } @@ -1860,7 +1864,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; case SC_WRITE_6: - i = sc->sc_cmd_data[4]; + i = sc->sc_cbw->CBWCDB[4]; sc->sc_transfer.cmd_dir = DIR_READ; temp = ((i == 0) ? 256UL : i); error = ustorage_fs_min_len(sc, temp << 9, mask9); @@ -1878,7 +1882,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_10: sc->sc_transfer.cmd_dir = DIR_READ; - temp = get_be16(&sc->sc_cmd_data[7]); + temp = get_be16(&sc->sc_cbw->CBWCDB[7]); error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; @@ -1894,10 +1898,10 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_12: sc->sc_transfer.cmd_dir = DIR_READ; - temp = get_be32(&sc->sc_cmd_data[6]); + temp = get_be32(&sc->sc_cbw->CBWCDB[6]); if (temp > (mask9 >> 9)) { /* numerical overflow */ - sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; + sc->sc_csw->bCSWStatus = CSWSTATUS_FAILED; error = 1; break; } Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Mon Dec 16 08:10:38 2013 (r259453) +++ stable/9/sys/dev/usb/usb_msctest.c Mon Dec 16 08:51:58 2013 (r259454) @@ -139,8 +139,8 @@ struct bbb_csw { struct bbb_transfer { struct mtx mtx; struct cv cv; - struct bbb_cbw cbw; - struct bbb_csw csw; + struct bbb_cbw *cbw; + struct bbb_csw *csw; struct usb_xfer *xfer[ST_MAX]; @@ -158,7 +158,7 @@ struct bbb_transfer { uint8_t status_try; int error; - uint8_t buffer[SCSI_MAX_LEN] __aligned(4); + uint8_t *buffer; }; static usb_callback_t bbb_command_callback; @@ -184,7 +184,6 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = sizeof(struct bbb_cbw), - .flags = {.ext_buffer = 1,}, .callback = &bbb_command_callback, .timeout = 4 * USB_MS_HZ, /* 4 seconds */ }, @@ -193,8 +192,8 @@ static const struct usb_config bbb_confi .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = BULK_SIZE, - .flags = {.ext_buffer = 1,.proxy_buffer = 1,.short_xfer_ok = 1,}, + .bufsize = MAX(SCSI_MAX_LEN, BULK_SIZE), + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, .callback = &bbb_data_read_callback, .timeout = 4 * USB_MS_HZ, /* 4 seconds */ }, @@ -232,7 +231,7 @@ static const struct usb_config bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = sizeof(struct bbb_csw), - .flags = {.ext_buffer = 1,.short_xfer_ok = 1,}, + .flags = {.short_xfer_ok = 1,}, .callback = &bbb_status_callback, .timeout = 1 * USB_MS_HZ, /* 1 second */ }, @@ -241,7 +240,6 @@ static const struct usb_config bbb_confi static void bbb_done(struct bbb_transfer *sc, int error) { - sc->error = error; sc->state = ST_COMMAND; sc->status_try = 1; @@ -290,18 +288,17 @@ bbb_command_callback(struct usb_xfer *xf case USB_ST_SETUP: sc->status_try = 0; - tag = UGETDW(sc->cbw.dCBWTag) + 1; - USETDW(sc->cbw.dCBWSignature, CBWSIGNATURE); - USETDW(sc->cbw.dCBWTag, tag); - USETDW(sc->cbw.dCBWDataTransferLength, (uint32_t)sc->data_len); - sc->cbw.bCBWFlags = ((sc->dir == DIR_IN) ? CBWFLAGS_IN : CBWFLAGS_OUT); - sc->cbw.bCBWLUN = sc->lun; - sc->cbw.bCDBLength = sc->cmd_len; - if (sc->cbw.bCDBLength > sizeof(sc->cbw.CBWCDB)) { - sc->cbw.bCDBLength = sizeof(sc->cbw.CBWCDB); + tag = UGETDW(sc->cbw->dCBWTag) + 1; + USETDW(sc->cbw->dCBWSignature, CBWSIGNATURE); + USETDW(sc->cbw->dCBWTag, tag); + USETDW(sc->cbw->dCBWDataTransferLength, (uint32_t)sc->data_len); + sc->cbw->bCBWFlags = ((sc->dir == DIR_IN) ? CBWFLAGS_IN : CBWFLAGS_OUT); + sc->cbw->bCBWLUN = sc->lun; + sc->cbw->bCDBLength = sc->cmd_len; + if (sc->cbw->bCDBLength > sizeof(sc->cbw->CBWCDB)) { + sc->cbw->bCDBLength = sizeof(sc->cbw->CBWCDB); DPRINTFN(0, "Truncating long command\n"); } - usbd_xfer_set_frame_data(xfer, 0, &sc->cbw, sizeof(sc->cbw)); usbd_transfer_submit(xfer); break; @@ -430,9 +427,9 @@ bbb_status_callback(struct usb_xfer *xfe /* very simple status check */ - if (actlen < (int)sizeof(sc->csw)) { + if (actlen < (int)sizeof(struct bbb_csw)) { bbb_done(sc, USB_ERR_SHORT_XFER); - } else if (sc->csw.bCSWStatus == CSWSTATUS_GOOD) { + } else if (sc->csw->bCSWStatus == CSWSTATUS_GOOD) { bbb_done(sc, 0); /* success */ } else { bbb_done(sc, ERR_CSW_FAILED); /* error */ @@ -440,7 +437,6 @@ bbb_status_callback(struct usb_xfer *xfe break; case USB_ST_SETUP: - usbd_xfer_set_frame_data(xfer, 0, &sc->csw, sizeof(sc->csw)); usbd_transfer_submit(xfer); break; @@ -478,9 +474,9 @@ bbb_command_start(struct bbb_transfer *s sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; sc->cmd_len = cmd_len; - memset(&sc->cbw.CBWCDB, 0, sizeof(sc->cbw.CBWCDB)); - memcpy(&sc->cbw.CBWCDB, cmd_ptr, cmd_len); - DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, (char *)sc->cbw.CBWCDB, ":"); + memset(&sc->cbw->CBWCDB, 0, sizeof(sc->cbw->CBWCDB)); + memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); + DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, (char *)sc->cbw->CBWCDB, ":"); mtx_lock(&sc->mtx); usbd_transfer_start(sc->xfer[sc->state]); @@ -549,6 +545,14 @@ bbb_attach(struct usb_device *udev, uint bbb_detach(sc); return (NULL); } + /* store pointer to DMA buffers */ + sc->buffer = usbd_xfer_get_frame_buffer( + sc->xfer[ST_DATA_RD], 0); + sc->cbw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_COMMAND], 0); + sc->csw = usbd_xfer_get_frame_buffer( + sc->xfer[ST_STATUS], 0); + return (sc); } Modified: stable/9/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uath.c Mon Dec 16 08:10:38 2013 (r259453) +++ stable/9/sys/dev/usb/wlan/if_uath.c Mon Dec 16 08:51:58 2013 (r259454) @@ -217,9 +217,8 @@ static const struct usb_config uath_usbc .type = UE_BULK, .endpoint = 0x1, .direction = UE_DIR_OUT, - .bufsize = UATH_MAX_CMDSZ, + .bufsize = UATH_MAX_CMDSZ * UATH_CMD_LIST_COUNT, .flags = { - .ext_buffer = 1, .force_short_xfer = 1, .pipe_bof = 1, }, @@ -242,9 +241,8 @@ static const struct usb_config uath_usbc .type = UE_BULK, .endpoint = 0x2, .direction = UE_DIR_OUT, - .bufsize = UATH_MAX_TXBUFSZ, + .bufsize = UATH_MAX_TXBUFSZ * UATH_TX_DATA_LIST_COUNT, .flags = { - .ext_buffer = 1, .force_short_xfer = 1, .pipe_bof = 1 }, @@ -258,10 +256,8 @@ static struct ieee80211vap *uath_vap_cre const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void uath_vap_delete(struct ieee80211vap *); -static int uath_alloc_cmd_list(struct uath_softc *, struct uath_cmd [], - int, int); -static void uath_free_cmd_list(struct uath_softc *, struct uath_cmd [], - int); +static int uath_alloc_cmd_list(struct uath_softc *, struct uath_cmd []); +static void uath_free_cmd_list(struct uath_softc *, struct uath_cmd []); static int uath_host_available(struct uath_softc *); static int uath_get_capability(struct uath_softc *, uint32_t, uint32_t *); static int uath_get_devcap(struct uath_softc *); @@ -362,22 +358,26 @@ uath_attach(device_t dev) callout_init(&sc->stat_ch, 0); callout_init_mtx(&sc->watchdog_ch, &sc->sc_mtx, 0); - /* - * Allocate xfers for firmware commands. - */ - error = uath_alloc_cmd_list(sc, sc->sc_cmd, UATH_CMD_LIST_COUNT, - UATH_MAX_CMDSZ); - if (error != 0) { - device_printf(sc->sc_dev, - "could not allocate Tx command list\n"); - goto fail; - } - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, uath_usbconfig, UATH_N_XFERS, sc, &sc->sc_mtx); if (error) { device_printf(dev, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); + goto fail; + } + + sc->sc_cmd_dma_buf = + usbd_xfer_get_frame_buffer(sc->sc_xfer[UATH_INTR_TX], 0); + sc->sc_tx_dma_buf = + usbd_xfer_get_frame_buffer(sc->sc_xfer[UATH_BULK_TX], 0); + + /* + * Setup buffers for firmware commands. + */ + error = uath_alloc_cmd_list(sc, sc->sc_cmd); + if (error != 0) { + device_printf(sc->sc_dev, + "could not allocate Tx command list\n"); goto fail1; } @@ -492,8 +492,8 @@ uath_attach(device_t dev) fail4: if_free(ifp); fail3: UATH_UNLOCK(sc); -fail2: usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); -fail1: uath_free_cmd_list(sc, sc->sc_cmd, UATH_CMD_LIST_COUNT); +fail2: uath_free_cmd_list(sc, sc->sc_cmd); +fail1: usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); fail: return (error); } @@ -524,7 +524,7 @@ uath_detach(device_t dev) UATH_LOCK(sc); uath_free_rx_data_list(sc); uath_free_tx_data_list(sc); - uath_free_cmd_list(sc, sc->sc_cmd, UATH_CMD_LIST_COUNT); + uath_free_cmd_list(sc, sc->sc_cmd); UATH_UNLOCK(sc); if_free(ifp); @@ -533,45 +533,35 @@ uath_detach(device_t dev) } static void -uath_free_cmd_list(struct uath_softc *sc, struct uath_cmd cmds[], int ncmd) +uath_free_cmd_list(struct uath_softc *sc, struct uath_cmd cmds[]) { int i; - for (i = 0; i < ncmd; i++) - if (cmds[i].buf != NULL) - free(cmds[i].buf, M_USBDEV); + for (i = 0; i != UATH_CMD_LIST_COUNT; i++) + cmds[i].buf = NULL; } static int -uath_alloc_cmd_list(struct uath_softc *sc, struct uath_cmd cmds[], - int ncmd, int maxsz) +uath_alloc_cmd_list(struct uath_softc *sc, struct uath_cmd cmds[]) { - int i, error; + int i; STAILQ_INIT(&sc->sc_cmd_active); STAILQ_INIT(&sc->sc_cmd_pending); STAILQ_INIT(&sc->sc_cmd_waiting); STAILQ_INIT(&sc->sc_cmd_inactive); - for (i = 0; i < ncmd; i++) { + for (i = 0; i != UATH_CMD_LIST_COUNT; i++) { struct uath_cmd *cmd = &cmds[i]; cmd->sc = sc; /* backpointer for callbacks */ cmd->msgid = i; - cmd->buf = malloc(maxsz, M_USBDEV, M_NOWAIT); - if (cmd->buf == NULL) { - device_printf(sc->sc_dev, - "could not allocate xfer buffer\n"); - error = ENOMEM; - goto fail; - } + cmd->buf = ((uint8_t *)sc->sc_cmd_dma_buf) + + (i * UATH_MAX_CMDSZ); STAILQ_INSERT_TAIL(&sc->sc_cmd_inactive, cmd, next); UATH_STAT_INC(sc, st_cmd_inactive); } return (0); - -fail: uath_free_cmd_list(sc, cmds, ncmd); - return (error); } static int @@ -942,10 +932,7 @@ uath_free_data_list(struct uath_softc *s dp->buf = NULL; } } else { - if (dp->buf != NULL) { - free(dp->buf, M_USBDEV); - dp->buf = NULL; - } + dp->buf = NULL; } #ifdef UATH_DEBUG if (dp->ni != NULL) @@ -956,7 +943,7 @@ uath_free_data_list(struct uath_softc *s static int uath_alloc_data_list(struct uath_softc *sc, struct uath_data data[], - int ndata, int maxsz, int fillmbuf) + int ndata, int maxsz, void *dma_buf) { int i, error; @@ -964,7 +951,7 @@ uath_alloc_data_list(struct uath_softc * struct uath_data *dp = &data[i]; dp->sc = sc; - if (fillmbuf) { + if (dma_buf == NULL) { /* XXX check maxsz */ dp->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (dp->m == NULL) { @@ -976,20 +963,14 @@ uath_alloc_data_list(struct uath_softc * dp->buf = mtod(dp->m, uint8_t *); } else { dp->m = NULL; - dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT); - if (dp->buf == NULL) { - device_printf(sc->sc_dev, - "could not allocate buffer\n"); - error = ENOMEM; - goto fail; - } + dp->buf = ((uint8_t *)dma_buf) + (i * maxsz); } dp->ni = NULL; } return (0); -fail: uath_free_data_list(sc, data, ndata, fillmbuf); +fail: uath_free_data_list(sc, data, ndata, 1 /* free mbufs */); return (error); } @@ -1001,7 +982,7 @@ uath_alloc_rx_data_list(struct uath_soft /* XXX is it enough to store the RX packet with MCLBYTES bytes? */ error = uath_alloc_data_list(sc, sc->sc_rx, UATH_RX_DATA_LIST_COUNT, MCLBYTES, - 1 /* setup mbufs */); + NULL /* setup mbufs */); if (error != 0) return (error); @@ -1024,7 +1005,7 @@ uath_alloc_tx_data_list(struct uath_soft error = uath_alloc_data_list(sc, sc->sc_tx, UATH_TX_DATA_LIST_COUNT, UATH_MAX_TXBUFSZ, - 0 /* no mbufs */); + sc->sc_tx_dma_buf); if (error != 0) return (error); @@ -2741,8 +2722,7 @@ setup: UATH_STAT_DEC(sc, st_rx_inactive); STAILQ_INSERT_TAIL(&sc->sc_rx_active, data, next); UATH_STAT_INC(sc, st_rx_active); - usbd_xfer_set_frame_data(xfer, 0, data->buf, - usbd_xfer_max_len(xfer)); + usbd_xfer_set_frame_data(xfer, 0, data->buf, MCLBYTES); usbd_transfer_submit(xfer); /* @@ -2890,7 +2870,7 @@ static device_method_t uath_methods[] = DEVMETHOD(device_probe, uath_match), DEVMETHOD(device_attach, uath_attach), DEVMETHOD(device_detach, uath_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t uath_driver = { .name = "uath", Modified: stable/9/sys/dev/usb/wlan/if_uathvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uathvar.h Mon Dec 16 08:10:38 2013 (r259453) +++ stable/9/sys/dev/usb/wlan/if_uathvar.h Mon Dec 16 08:51:58 2013 (r259454) @@ -186,6 +186,8 @@ struct uath_softc { struct ifnet *sc_ifp; device_t sc_dev; struct usb_device *sc_udev; + void *sc_cmd_dma_buf; + void *sc_tx_dma_buf; struct mtx sc_mtx; uint32_t sc_debug; Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:10:38 2013 (r259453) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:51:58 2013 (r259454) @@ -201,9 +201,8 @@ static const struct usb_config upgt_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .bufsize = MCLBYTES, + .bufsize = MCLBYTES * UPGT_TX_MAXCOUNT, .flags = { - .ext_buffer = 1, .force_short_xfer = 1, .pipe_bof = 1 }, @@ -214,9 +213,8 @@ static const struct usb_config upgt_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = MCLBYTES, + .bufsize = MCLBYTES * UPGT_RX_MAXCOUNT, .flags = { - .ext_buffer = 1, .pipe_bof = 1, .short_xfer_ok = 1 }, @@ -261,22 +259,27 @@ upgt_attach(device_t dev) callout_init(&sc->sc_led_ch, 0); callout_init(&sc->sc_watchdog_ch, 0); - /* Allocate TX and RX xfers. */ - error = upgt_alloc_tx(sc); - if (error) - goto fail1; - error = upgt_alloc_rx(sc); - if (error) - goto fail2; - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, upgt_config, UPGT_N_XFERS, sc, &sc->sc_mtx); if (error) { device_printf(dev, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); - goto fail3; + goto fail1; } + sc->sc_rx_dma_buf = usbd_xfer_get_frame_buffer( + sc->sc_xfer[UPGT_BULK_RX], 0); + sc->sc_tx_dma_buf = usbd_xfer_get_frame_buffer( + sc->sc_xfer[UPGT_BULK_TX], 0); + + /* Setup TX and RX buffers */ + error = upgt_alloc_tx(sc); + if (error) + goto fail2; + error = upgt_alloc_rx(sc); + if (error) + goto fail3; + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -379,9 +382,9 @@ upgt_attach(device_t dev) return (0); fail5: if_free(ifp); -fail4: usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); -fail3: upgt_free_rx(sc); -fail2: upgt_free_tx(sc); +fail4: upgt_free_rx(sc); +fail3: upgt_free_tx(sc); +fail2: usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); fail1: mtx_destroy(&sc->sc_mtx); return (error); @@ -1978,13 +1981,7 @@ upgt_alloc_tx(struct upgt_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 08:54:25 2013 Return-Path: Delivered-To: svn-src-all@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 4AA04E56; Mon, 16 Dec 2013 08:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35E3C17A8; Mon, 16 Dec 2013 08:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG8sPdv045016; Mon, 16 Dec 2013 08:54:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG8sOPJ045011; Mon, 16 Dec 2013 08:54:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160854.rBG8sOPJ045011@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 08:54:24 +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: r259455 - stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 08:54:25 -0000 Author: hselasky Date: Mon Dec 16 08:54:24 2013 New Revision: 259455 URL: http://svnweb.freebsd.org/changeset/base/259455 Log: MFC r246765: Remove unused variable. Modified: stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_upgtvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:51:58 2013 (r259454) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:54:24 2013 (r259455) @@ -1586,7 +1586,6 @@ upgt_tx_done(struct upgt_softc *sc, uint data_tx->ni = NULL; data_tx->addr = 0; data_tx->m = NULL; - data_tx->use = 0; DPRINTF(sc, UPGT_DEBUG_TX_PROC, "TX done: memaddr=0x%08x, status=0x%04x, rssi=%d, ", Modified: stable/9/sys/dev/usb/wlan/if_upgtvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 08:51:58 2013 (r259454) +++ stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 08:54:24 2013 (r259455) @@ -352,7 +352,6 @@ struct upgt_data { struct ieee80211_node *ni; struct mbuf *m; uint32_t addr; - uint8_t use; STAILQ_ENTRY(upgt_data) next; }; typedef STAILQ_HEAD(, upgt_data) upgt_datahead; From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 08:56:49 2013 Return-Path: Delivered-To: svn-src-all@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 184351CC; Mon, 16 Dec 2013 08:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01F8917C8; Mon, 16 Dec 2013 08:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG8umFO045384; Mon, 16 Dec 2013 08:56:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG8ukRO045368; Mon, 16 Dec 2013 08:56:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160856.rBG8ukRO045368@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 08:56:46 +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: r259456 - stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 08:56:49 -0000 Author: hselasky Date: Mon Dec 16 08:56:45 2013 New Revision: 259456 URL: http://svnweb.freebsd.org/changeset/base/259456 Log: MFC r246614: - Streamline detach logic in wlan drivers, so that freed memory cannot be used during detach. - Remove all panic() calls from the urtw driver because panic() is not appropriate here. - Remove redundant checks for device detached in device detach callbacks. - Use DEVMETHOD_END to mark end of device methods. Modified: stable/9/sys/dev/usb/wlan/if_rum.c stable/9/sys/dev/usb/wlan/if_rumvar.h stable/9/sys/dev/usb/wlan/if_run.c stable/9/sys/dev/usb/wlan/if_runvar.h stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_upgtvar.h stable/9/sys/dev/usb/wlan/if_ural.c stable/9/sys/dev/usb/wlan/if_uralvar.h stable/9/sys/dev/usb/wlan/if_urtw.c stable/9/sys/dev/usb/wlan/if_urtwvar.h stable/9/sys/dev/usb/wlan/if_zyd.c stable/9/sys/dev/usb/wlan/if_zydreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_rum.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_rum.c Mon Dec 16 08:56:45 2013 (r259456) @@ -543,6 +543,11 @@ rum_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic; + /* Prevent further ioctls */ + RUM_LOCK(sc); + sc->sc_detached = 1; + RUM_UNLOCK(sc); + /* stop all USB transfers */ usbd_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); @@ -557,7 +562,6 @@ rum_detach(device_t self) if_free(ifp); } mtx_destroy(&sc->sc_mtx); - return (0); } @@ -1322,7 +1326,14 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, struct rum_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + int error; + int startall = 0; + + RUM_LOCK(sc); + error = sc->sc_detached ? ENXIO : 0; + RUM_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: @@ -2366,8 +2377,7 @@ static device_method_t rum_methods[] = { DEVMETHOD(device_probe, rum_match), DEVMETHOD(device_attach, rum_attach), DEVMETHOD(device_detach, rum_detach), - - { 0, 0 } + DEVMETHOD_END }; static driver_t rum_driver = { Modified: stable/9/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_rumvar.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_rumvar.h Mon Dec 16 08:56:45 2013 (r259456) @@ -106,6 +106,7 @@ struct rum_softc { uint32_t rf_regs[4]; uint8_t txpow[44]; uint8_t sc_bssid[6]; + uint8_t sc_detached; struct { uint8_t val; Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 16 08:56:45 2013 (r259456) @@ -718,11 +718,14 @@ run_detach(device_t self) struct ieee80211com *ic; int i; + RUN_LOCK(sc); + sc->sc_detached = 1; + RUN_UNLOCK(sc); + /* stop all USB transfers */ usbd_transfer_unsetup(sc->sc_xfer, RUN_N_XFER); RUN_LOCK(sc); - sc->ratectl_run = RUN_RATECTL_OFF; sc->cmdq_run = sc->cmdq_key_set = RUN_CMDQ_ABORT; @@ -3443,7 +3446,13 @@ run_ioctl(struct ifnet *ifp, u_long cmd, struct ieee80211com *ic = sc->sc_ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; int startall = 0; - int error = 0; + int error; + + RUN_LOCK(sc); + error = sc->sc_detached ? ENXIO : 0; + RUN_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: @@ -4965,8 +4974,7 @@ static device_method_t run_methods[] = { DEVMETHOD(device_probe, run_match), DEVMETHOD(device_attach, run_attach), DEVMETHOD(device_detach, run_detach), - - { 0, 0 } + DEVMETHOD_END }; static driver_t run_driver = { Modified: stable/9/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_runvar.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_runvar.h Mon Dec 16 08:56:45 2013 (r259456) @@ -239,6 +239,7 @@ struct run_softc { uint8_t sta_running; uint8_t rvp_cnt; uint8_t rvp_bmap; + uint8_t sc_detached; union { struct run_rx_radiotap_header th; Modified: stable/9/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uath.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_uath.c Mon Dec 16 08:56:45 2013 (r259456) @@ -504,29 +504,48 @@ uath_detach(device_t dev) struct uath_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + unsigned int x; - if (!device_is_attached(dev)) - return (0); - + /* + * Prevent further allocations from RX/TX/CMD + * data lists and ioctls + */ UATH_LOCK(sc); sc->sc_flags |= UATH_FLAG_INVALID; + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + + STAILQ_INIT(&sc->sc_cmd_active); + STAILQ_INIT(&sc->sc_cmd_pending); + STAILQ_INIT(&sc->sc_cmd_waiting); + STAILQ_INIT(&sc->sc_cmd_inactive); UATH_UNLOCK(sc); - ieee80211_ifdetach(ic); uath_stop(ifp); callout_drain(&sc->stat_ch); callout_drain(&sc->watchdog_ch); - usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); + /* drain USB transfers */ + for (x = 0; x != UATH_N_XFERS; x++) + usbd_transfer_drain(sc->sc_xfer[x]); - /* free buffers */ + /* free data buffers */ UATH_LOCK(sc); uath_free_rx_data_list(sc); uath_free_tx_data_list(sc); uath_free_cmd_list(sc, sc->sc_cmd); UATH_UNLOCK(sc); + /* free USB transfers and some data buffers */ + usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); + + ieee80211_ifdetach(ic); if_free(ifp); mtx_destroy(&sc->sc_mtx); return (0); @@ -934,10 +953,10 @@ uath_free_data_list(struct uath_softc *s } else { dp->buf = NULL; } -#ifdef UATH_DEBUG - if (dp->ni != NULL) - device_printf(sc->sc_dev, "Node isn't NULL\n"); -#endif + if (dp->ni != NULL) { + ieee80211_free_node(dp->ni); + dp->ni = NULL; + } } } @@ -1025,10 +1044,6 @@ uath_alloc_tx_data_list(struct uath_soft static void uath_free_rx_data_list(struct uath_softc *sc) { - - STAILQ_INIT(&sc->sc_rx_active); - STAILQ_INIT(&sc->sc_rx_inactive); - uath_free_data_list(sc, sc->sc_rx, UATH_RX_DATA_LIST_COUNT, 1 /* free mbufs */); } @@ -1036,11 +1051,6 @@ uath_free_rx_data_list(struct uath_softc static void uath_free_tx_data_list(struct uath_softc *sc) { - - STAILQ_INIT(&sc->sc_tx_active); - STAILQ_INIT(&sc->sc_tx_inactive); - STAILQ_INIT(&sc->sc_tx_pending); - uath_free_data_list(sc, sc->sc_tx, UATH_TX_DATA_LIST_COUNT, 0 /* no mbufs */); } @@ -1543,7 +1553,15 @@ uath_ioctl(struct ifnet *ifp, u_long cmd { struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + struct uath_softc *sc = ifp->if_softc; + int error; + int startall = 0; + + UATH_LOCK(sc); + error = (sc->sc_flags & UATH_FLAG_INVALID) ? ENXIO : 0; + UATH_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 16 08:56:45 2013 (r259456) @@ -466,7 +466,14 @@ upgt_ioctl(struct ifnet *ifp, u_long cmd struct upgt_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + int error; + int startall = 0; + + UPGT_LOCK(sc); + error = (sc->sc_flags & UPGT_FLAG_DETACHED) ? ENXIO : 0; + UPGT_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: @@ -2001,7 +2008,6 @@ upgt_alloc_rx(struct upgt_softc *sc) data->buf = ((uint8_t *)sc->sc_rx_dma_buf) + (i * MCLBYTES); STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); } - return (0); } @@ -2011,22 +2017,42 @@ upgt_detach(device_t dev) struct upgt_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + unsigned int x; - if (!device_is_attached(dev)) - return 0; + /* + * Prevent further allocations from RX/TX/CMD + * data lists and ioctls + */ + UPGT_LOCK(sc); + sc->sc_flags |= UPGT_FLAG_DETACHED; + + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + UPGT_UNLOCK(sc); upgt_stop(sc); callout_drain(&sc->sc_led_ch); callout_drain(&sc->sc_watchdog_ch); - ieee80211_ifdetach(ic); - - usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); + /* drain USB transfers */ + for (x = 0; x != UPGT_N_XFERS; x++) + usbd_transfer_drain(sc->sc_xfer[x]); + /* free data buffers */ + UPGT_LOCK(sc); upgt_free_rx(sc); upgt_free_tx(sc); + UPGT_UNLOCK(sc); + + /* free USB transfers and some data buffers */ + usbd_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); + ieee80211_ifdetach(ic); if_free(ifp); mtx_destroy(&sc->sc_mtx); @@ -2054,6 +2080,9 @@ upgt_free_tx(struct upgt_softc *sc) for (i = 0; i < UPGT_TX_MAXCOUNT; i++) { struct upgt_data *data = &sc->sc_tx_data[i]; + if (data->ni != NULL) + ieee80211_free_node(data->ni); + data->buf = NULL; data->ni = NULL; } Modified: stable/9/sys/dev/usb/wlan/if_upgtvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 08:56:45 2013 (r259456) @@ -428,6 +428,7 @@ struct upgt_softc { int sc_flags; #define UPGT_FLAG_FWLOADED (1 << 0) #define UPGT_FLAG_INITDONE (1 << 1) +#define UPGT_FLAG_DETACHED (1 << 2) int sc_if_flags; int sc_debug; Modified: stable/9/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_ural.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_ural.c Mon Dec 16 08:56:45 2013 (r259456) @@ -385,8 +385,7 @@ static device_method_t ural_methods[] = DEVMETHOD(device_probe, ural_match), DEVMETHOD(device_attach, ural_attach), DEVMETHOD(device_detach, ural_detach), - - { 0, 0 } + DEVMETHOD_END }; static driver_t ural_driver = { @@ -528,6 +527,11 @@ ural_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic; + /* prevent further ioctls */ + RAL_LOCK(sc); + sc->sc_detached = 1; + RAL_UNLOCK(sc); + /* stop all USB transfers */ usbd_transfer_unsetup(sc->sc_xfer, URAL_N_TRANSFER); @@ -1371,7 +1375,14 @@ ural_ioctl(struct ifnet *ifp, u_long cmd struct ural_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + int error; + int startall = 0; + + RAL_LOCK(sc); + error = sc->sc_detached ? ENXIO : 0; + RAL_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: Modified: stable/9/sys/dev/usb/wlan/if_uralvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uralvar.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_uralvar.h Mon Dec 16 08:56:45 2013 (r259456) @@ -110,6 +110,7 @@ struct ural_softc { uint32_t rf_regs[4]; uint8_t txpow[14]; uint8_t sc_bssid[6]; + uint8_t sc_detached; struct { uint8_t val; Modified: stable/9/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_urtw.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_urtw.c Mon Dec 16 08:56:45 2013 (r259456) @@ -651,8 +651,8 @@ static struct ieee80211vap *urtw_vap_cre const uint8_t [IEEE80211_ADDR_LEN]); static void urtw_vap_delete(struct ieee80211vap *); static void urtw_init(void *); -static void urtw_stop(struct ifnet *, int); -static void urtw_stop_locked(struct ifnet *, int); +static void urtw_stop(struct ifnet *); +static void urtw_stop_locked(struct ifnet *); static int urtw_ioctl(struct ifnet *, u_long, caddr_t); static void urtw_start(struct ifnet *); static int urtw_alloc_rx_data_list(struct urtw_softc *); @@ -933,42 +933,63 @@ urtw_detach(device_t dev) struct urtw_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + unsigned int x; + unsigned int n_xfers; - if (!device_is_attached(dev)) - return (0); + /* Prevent further ioctls */ + URTW_LOCK(sc); + sc->sc_flags |= URTW_DETACHED; + URTW_UNLOCK(sc); + + urtw_stop(ifp); - urtw_stop(ifp, 1); ieee80211_draintask(ic, &sc->sc_updateslot_task); ieee80211_draintask(ic, &sc->sc_led_task); usb_callout_drain(&sc->sc_led_ch); callout_drain(&sc->sc_watchdog_ch); - ieee80211_ifdetach(ic); + n_xfers = (sc->sc_flags & URTW_RTL8187B) ? + URTW_8187B_N_XFERS : URTW_8187L_N_XFERS; - usbd_transfer_unsetup(sc->sc_xfer, (sc->sc_flags & URTW_RTL8187B) ? - URTW_8187B_N_XFERS : URTW_8187L_N_XFERS); + /* prevent further allocations from RX/TX data lists */ + URTW_LOCK(sc); + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + URTW_UNLOCK(sc); + + /* drain USB transfers */ + for (x = 0; x != n_xfers; x++) + usbd_transfer_drain(sc->sc_xfer[x]); + + /* free data buffers */ + URTW_LOCK(sc); urtw_free_tx_data_list(sc); urtw_free_rx_data_list(sc); + URTW_UNLOCK(sc); + + /* free USB transfers and some data buffers */ + usbd_transfer_unsetup(sc->sc_xfer, n_xfers); + ieee80211_ifdetach(ic); if_free(ifp); mtx_destroy(&sc->sc_mtx); - return (0); } static void urtw_free_tx_data_list(struct urtw_softc *sc) { - urtw_free_data_list(sc, sc->sc_tx, URTW_TX_DATA_LIST_COUNT, 0); } static void urtw_free_rx_data_list(struct urtw_softc *sc) { - urtw_free_data_list(sc, sc->sc_rx, URTW_RX_DATA_LIST_COUNT, 1); } @@ -1046,7 +1067,7 @@ urtw_init_locked(void *arg) usb_error_t error; if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtw_stop_locked(ifp, 0); + urtw_stop_locked(ifp); error = (sc->sc_flags & URTW_RTL8187B) ? urtw_adapter_start_b(sc) : urtw_adapter_start(sc); @@ -1309,13 +1330,12 @@ urtw_do_request(struct urtw_softc *sc, } static void -urtw_stop_locked(struct ifnet *ifp, int disable) +urtw_stop_locked(struct ifnet *ifp) { struct urtw_softc *sc = ifp->if_softc; uint8_t data8; usb_error_t error; - (void)disable; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); error = urtw_intr_disable(sc); @@ -1349,12 +1369,12 @@ fail: } static void -urtw_stop(struct ifnet *ifp, int disable) +urtw_stop(struct ifnet *ifp) { struct urtw_softc *sc = ifp->if_softc; URTW_LOCK(sc); - urtw_stop_locked(ifp, disable); + urtw_stop_locked(ifp); URTW_UNLOCK(sc); } @@ -1379,7 +1399,14 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd struct urtw_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + int error; + int startall = 0; + + URTW_LOCK(sc); + error = (sc->sc_flags & URTW_DETACHED) ? ENXIO : 0; + URTW_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: @@ -1394,7 +1421,7 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtw_stop(ifp, 1); + urtw_stop(ifp); } sc->sc_if_flags = ifp->if_flags; if (startall) @@ -1410,7 +1437,6 @@ urtw_ioctl(struct ifnet *ifp, u_long cmd error = EINVAL; break; } - return (error); } @@ -1991,9 +2017,11 @@ urtw_update_msr(struct urtw_softc *sc) data |= URTW_MSR_LINK_HOSTAP; break; default: - panic("unsupported operation mode 0x%x\n", + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported operation mode 0x%x\n", ic->ic_opmode); - /* never reach */ + error = USB_ERR_INVAL; + goto fail; } } else data |= URTW_MSR_LINK_NONE; @@ -2424,8 +2452,10 @@ urtw_get_rfchip(struct urtw_softc *sc) sc->sc_rf_stop = urtw_8225_rf_stop; break; default: - panic("unsupported RF chip %d\n", data & 0xff); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported RF chip %d\n", data & 0xff); + error = USB_ERR_INVAL; + goto fail; } device_printf(sc->sc_dev, "%s rf %s hwrev %s\n", @@ -3605,8 +3635,10 @@ urtw_led_ctl(struct urtw_softc *sc, int error = urtw_led_mode3(sc, mode); break; default: - panic("unsupported LED mode %d\n", sc->sc_strategy); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED mode %d\n", sc->sc_strategy); + error = USB_ERR_INVAL; + break; } return (error); @@ -3631,8 +3663,9 @@ urtw_led_mode0(struct urtw_softc *sc, in sc->sc_gpio_ledstate = URTW_LED_ON; break; default: - panic("unsupported LED mode 0x%x", mode); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED mode 0x%x", mode); + return (USB_ERR_INVAL); } switch (sc->sc_gpio_ledstate) { @@ -3655,8 +3688,9 @@ urtw_led_mode0(struct urtw_softc *sc, in urtw_led_off(sc, URTW_LED_GPIO); break; default: - panic("unknown LED status 0x%x", sc->sc_gpio_ledstate); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unknown LED status 0x%x", sc->sc_gpio_ledstate); + return (USB_ERR_INVAL); } return (0); } @@ -3664,21 +3698,18 @@ urtw_led_mode0(struct urtw_softc *sc, in static usb_error_t urtw_led_mode1(struct urtw_softc *sc, int mode) { - return (USB_ERR_INVAL); } static usb_error_t urtw_led_mode2(struct urtw_softc *sc, int mode) { - return (USB_ERR_INVAL); } static usb_error_t urtw_led_mode3(struct urtw_softc *sc, int mode) { - return (USB_ERR_INVAL); } @@ -3694,13 +3725,17 @@ urtw_led_on(struct urtw_softc *sc, int t urtw_write8_m(sc, URTW_GP_ENABLE, 0x00); break; default: - panic("unsupported LED PIN type 0x%x", + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED PIN type 0x%x", sc->sc_gpio_ledpin); - /* never reach */ + error = USB_ERR_INVAL; + goto fail; } } else { - panic("unsupported LED type 0x%x", type); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED type 0x%x", type); + error = USB_ERR_INVAL; + goto fail; } sc->sc_gpio_ledon = 1; @@ -3721,13 +3756,17 @@ urtw_led_off(struct urtw_softc *sc, int URTW_GP_ENABLE, URTW_GP_ENABLE_DATA_MAGIC1); break; default: - panic("unsupported LED PIN type 0x%x", + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED PIN type 0x%x", sc->sc_gpio_ledpin); - /* never reach */ + error = USB_ERR_INVAL; + goto fail; } } else { - panic("unsupported LED type 0x%x", type); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unsupported LED type 0x%x", type); + error = USB_ERR_INVAL; + goto fail; } sc->sc_gpio_ledon = 0; @@ -3751,8 +3790,12 @@ urtw_ledtask(void *arg, int pending) { struct urtw_softc *sc = arg; - if (sc->sc_strategy != URTW_SW_LED_MODE0) - panic("could not process a LED strategy 0x%x", sc->sc_strategy); + if (sc->sc_strategy != URTW_SW_LED_MODE0) { + DPRINTF(sc, URTW_DEBUG_STATE, + "could not process a LED strategy 0x%x", + sc->sc_strategy); + return; + } URTW_LOCK(sc); urtw_led_blink(sc); @@ -3799,8 +3842,10 @@ urtw_led_blink(struct urtw_softc *sc) usb_callout_reset(&sc->sc_led_ch, hz, urtw_led_ch, sc); break; default: - panic("unknown LED status 0x%x", sc->sc_gpio_ledstate); - /* never reach */ + DPRINTF(sc, URTW_DEBUG_STATE, + "unknown LED status 0x%x", + sc->sc_gpio_ledstate); + return (USB_ERR_INVAL); } return (0); } Modified: stable/9/sys/dev/usb/wlan/if_urtwvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_urtwvar.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_urtwvar.h Mon Dec 16 08:56:45 2013 (r259456) @@ -107,6 +107,7 @@ struct urtw_softc { #define URTW_RTL8187B_REV_B (1 << 3) #define URTW_RTL8187B_REV_D (1 << 4) #define URTW_RTL8187B_REV_E (1 << 5) +#define URTW_DETACHED (1 << 6) enum ieee80211_state sc_state; int sc_epromtype; Modified: stable/9/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_zyd.c Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_zyd.c Mon Dec 16 08:56:45 2013 (r259456) @@ -438,12 +438,29 @@ zyd_detach(device_t dev) struct zyd_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic; + unsigned int x; - /* stop all USB transfers */ - usbd_transfer_unsetup(sc->sc_xfer, ZYD_N_TRANSFER); + /* + * Prevent further allocations from RX/TX data + * lists and ioctls: + */ + ZYD_LOCK(sc); + sc->sc_flags |= ZYD_FLAG_DETACHED; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + ZYD_UNLOCK(sc); + + /* drain USB transfers */ + for (x = 0; x != ZYD_N_TRANSFER; x++) + usbd_transfer_drain(sc->sc_xfer[x]); /* free TX list, if any */ + ZYD_LOCK(sc); zyd_unsetup_tx_list(sc); + ZYD_UNLOCK(sc); + + /* free USB transfers and some data buffers */ + usbd_transfer_unsetup(sc->sc_xfer, ZYD_N_TRANSFER); if (ifp) { ic = ifp->if_l2com; @@ -2637,7 +2654,14 @@ zyd_ioctl(struct ifnet *ifp, u_long cmd, struct zyd_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 0; + int error; + int startall = 0; + + ZYD_LOCK(sc); + error = (sc->sc_flags & ZYD_FLAG_DETACHED) ? ENXIO : 0; + ZYD_UNLOCK(sc); + if (error) + return (error); switch (cmd) { case SIOCSIFFLAGS: @@ -2928,8 +2952,7 @@ static device_method_t zyd_methods[] = { DEVMETHOD(device_probe, zyd_match), DEVMETHOD(device_attach, zyd_attach), DEVMETHOD(device_detach, zyd_detach), - - { 0, 0 } + DEVMETHOD_END }; static driver_t zyd_driver = { Modified: stable/9/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_zydreg.h Mon Dec 16 08:54:24 2013 (r259455) +++ stable/9/sys/dev/usb/wlan/if_zydreg.h Mon Dec 16 08:56:45 2013 (r259456) @@ -1259,6 +1259,7 @@ struct zyd_softc { #define ZYD_FLAG_FWLOADED (1 << 0) #define ZYD_FLAG_INITONCE (1 << 1) #define ZYD_FLAG_INITDONE (1 << 2) +#define ZYD_FLAG_DETACHED (1 << 3) struct zyd_rf sc_rf; From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 09:07:10 2013 Return-Path: Delivered-To: svn-src-all@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 7BF165A9; Mon, 16 Dec 2013 09:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66CAA18B8; Mon, 16 Dec 2013 09:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG97A3m049101; Mon, 16 Dec 2013 09:07:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG979QD049097; Mon, 16 Dec 2013 09:07:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160907.rBG979QD049097@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 09:07:09 +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: r259457 - in stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 09:07:10 -0000 Author: hselasky Date: Mon Dec 16 09:07:09 2013 New Revision: 259457 URL: http://svnweb.freebsd.org/changeset/base/259457 Log: MFC r238274, r246752, r256720, r256721, r256722, r256955, r257409 r257429, r257435, r257712, r257732, r257743, r257748, r257955 r257957, r257958, r258082, r258641, r258643, r258732, r258733, r258840, r258919, r258921, r259029, r259030, r259031, r259032 and r259046: - Add support for the MediaTek/Ralink RT5370/RT5372 chipset. - Various minor USB WLAN fixes and improvements. PR: usb/182936 Modified: stable/9/sys/dev/usb/usbdevs stable/9/sys/dev/usb/wlan/if_rum.c stable/9/sys/dev/usb/wlan/if_run.c stable/9/sys/dev/usb/wlan/if_runreg.h stable/9/sys/dev/usb/wlan/if_runvar.h stable/9/sys/dev/usb/wlan/if_uath.c stable/9/sys/dev/usb/wlan/if_upgt.c stable/9/sys/dev/usb/wlan/if_ural.c stable/9/sys/dev/usb/wlan/if_urtw.c stable/9/sys/dev/usb/wlan/if_zyd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Dec 16 08:56:45 2013 (r259456) +++ stable/9/sys/dev/usb/usbdevs Mon Dec 16 09:07:09 2013 (r259457) @@ -569,10 +569,12 @@ vendor FALCOM 0x0f94 Falcom Wireless Co vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations vendor LARSENBRUSGAARD 0x0fd8 Larsen and Brusgaard +vendor OWL 0x0fde OWL vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer vendor MOTOROLA4 0x100d Motorola +vendor HP3 0x103c Hewlett Packard vendor AIRPLUS 0x1011 Airplus vendor DESKNOTE 0x1019 Desknote vendor NEC3 0x1033 NEC @@ -584,6 +586,7 @@ vendor CCYU 0x1065 CCYU Technology vendor CURITEL 0x106c Curitel Communications Inc vendor SILABS2 0x10a6 SILABS2 vendor USI 0x10ab USI +vendor LIEBERT2 0x10af Liebert vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante vendor SILABS 0x10c4 Silicon Labs @@ -652,6 +655,8 @@ vendor OWEN 0x1555 Owen vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline +vendor FREESCALE 0x15a2 Freescale Semiconductor, Inc. +vendor AFATECH 0x15a4 Afatech Technologies, Inc. vendor SPARKLAN 0x15a9 SparkLAN vendor OLIMEX 0x15ba Olimex vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. @@ -692,8 +697,9 @@ vendor QUALCOMMINC 0x19d2 Qualcomm, Inco vendor BAYER 0x1a79 Bayer vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor SEL 0x1adb Schweitzer Engineering Laboratories vendor CORSAIR 0x1b1c Corsair -vendor MATRIXORBITAL 0x1b3d Matrix Orbital +vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TML 0x1b91 The Mobility Lab vendor TCTMOBILE 0x1bbb TCT Mobile @@ -712,6 +718,7 @@ vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies vendor FESTO 0x1e29 Festo +vendor LAKESHORE 0x1fb9 Lake Shore Cryotronics, Inc. vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -721,10 +728,13 @@ vendor ENCORE 0x203d Encore vendor QIHARDWARE 0x20b7 QI-hardware vendor PARA 0x20b8 PARA Industrial vendor SIMTEC 0x20df Simtec Electronics +vendor TRENDNET 0x20f4 TRENDnet vendor RTSYSTEMS 0x2100 RTSYSTEMS vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola +vendor WETELECOM 0x22de WeTelecom +vendor WESTMOUNTAIN 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ @@ -742,6 +752,7 @@ vendor IRIVER 0x4102 iRiver vendor DELL 0x413c Dell vendor WCH 0x4348 QinHeng Electronics vendor ACEECA 0x4766 Aceeca +vendor FEIXUN 0x4855 FeiXun Communication vendor PAPOUCH 0x5050 Papouch products vendor AVERATEC 0x50c2 Averatec vendor SWEEX 0x5173 Sweex @@ -757,6 +768,7 @@ vendor INTEL2 0x8087 Intel vendor ALLWIN 0x8516 ALLWIN Tech vendor SITECOM2 0x9016 Sitecom vendor MOSCHIP 0x9710 MosChip Semiconductor +vendor NETGEAR4 0x9846 Netgear vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com vendor EVOLUTION 0xdeee Evolution Robotics products @@ -814,6 +826,9 @@ product ABOCOM HWU54DM 0xb21b HWU54DM product ABOCOM RT2573_2 0xb21c RT2573 product ABOCOM RT2573_3 0xb21d RT2573 product ABOCOM RT2573_4 0xb21e RT2573 +product ABOCOM RTL8188CU_1 0x8188 RTL8188CU +product ABOCOM RTL8188CU_2 0x8189 RTL8188CU +product ABOCOM RTL8192CU 0x8178 RTL8192CU product ABOCOM WUG2700 0xb21f WUG2700 /* Acton Research Corp. */ @@ -841,6 +856,7 @@ product ACCTON RT3070_2 0xa702 RT3070 product ACCTON RT2870_1 0xb522 RT2870 product ACCTON RT3070_3 0xc522 RT3070 product ACCTON RT3070_5 0xd522 RT3070 +product ACCTON RTL8192SU 0xc512 RTL8192SU product ACCTON ZD1211B 0xe501 ZD1211B /* Aceeca products */ @@ -918,6 +934,9 @@ product ADS UBS10BTX 0x0009 UBS-10BT Et /* AEI products */ product AEI FASTETHERNET 0x1701 Fast Ethernet +/* Afatech Technologies, Inc. */ +product AFATECH AFATECH1336 0x1336 Flash Card Reader + /* Agate Technologies products */ product AGATE QDRIVE 0x0378 Q-Drive @@ -1123,6 +1142,9 @@ product ASUS RT2870_4 0x1760 RT2870 product ASUS RT2870_5 0x1761 RT2870 product ASUS USBN13 0x1784 USB-N13 product ASUS RT3070_1 0x1790 RT3070 +product ASUS USBN10 0x1786 USB-N10 +product ASUS RTL8192CU 0x17ab RTL8192CU +product ASUS RTL8192SU 0x1791 RTL8192SU product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA product ASUS GMSC 0x422f ASUS Generic Mass Storage @@ -1170,6 +1192,14 @@ product AZUREWAVE RT2870_2 0x3262 RT2870 product AZUREWAVE RT3070_1 0x3273 RT3070 product AZUREWAVE RT3070_2 0x3284 RT3070 product AZUREWAVE RT3070_3 0x3305 RT3070 +product AZUREWAVE RTL8188CU 0x3357 RTL8188CU +product AZUREWAVE RTL8188CE_1 0x3358 RTL8188CE +product AZUREWAVE RTL8188CE_2 0x3359 RTL8188CE +product AZUREWAVE RTL8192SU_1 0x3306 RTL8192SU +product AZUREWAVE RTL8192SU_2 0x3309 RTL8192SU +product AZUREWAVE RTL8192SU_3 0x3310 RTL8192SU +product AZUREWAVE RTL8192SU_4 0x3311 RTL8192SU +product AZUREWAVE RTL8192SU_5 0x3325 RTL8192SU /* Baltech products */ product BALTECH CARDREADER 0x9999 Card reader @@ -1212,6 +1242,9 @@ product BELKIN F5U257 0x0257 F5U257 Ser product BELKIN F5U409 0x0409 F5U409 Serial product BELKIN F6C550AVR 0x0551 F6C550-AVR UPS product BELKIN F5U120 0x1203 F5U120-PC Hub +product BELKIN RTL8188CU 0x1102 RTL8188CU Wireless Adapter +product BELKIN RTL8192CU 0x2102 RTL8192CU Wireless Adapter +product BELKIN F7D2102 0x2103 F7D2102 Wireless Adapter product BELKIN ZD1211B 0x4050 ZD1211B product BELKIN F5D5055 0x5055 F5D5055 product BELKIN F5D7050 0x7050 F5D7050 Wireless Adapter @@ -1223,6 +1256,9 @@ product BELKIN F5D7050E 0x705e F5D7050E product BELKIN RT2870_1 0x8053 RT2870 product BELKIN RT2870_2 0x805c RT2870 product BELKIN F5D8053V3 0x815c F5D8053 v3 +product BELKIN RTL8192SU_1 0x815f RTL8192SU +product BELKIN RTL8192SU_2 0x845a RTL8192SU +product BELKIN RTL8192SU_3 0x945a RTL8192SU product BELKIN F5D8055 0x825a F5D8055 product BELKIN F5D8055V2 0x825b F5D8055 v2 product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter @@ -1292,6 +1328,11 @@ product CHIC CYPRESS 0x0003 Cypress USB product CHICONY KB8933 0x0001 KB-8933 keyboard product CHICONY KU0325 0x0116 KU-0325 keyboard product CHICONY CNF7129 0xb071 Notebook Web Camera +product CHICONY RTL8188CUS_1 0xaff7 RTL8188CUS +product CHICONY RTL8188CUS_2 0xaff8 RTL8188CUS +product CHICONY RTL8188CUS_3 0xaff9 RTL8188CUS +product CHICONY RTL8188CUS_4 0xaffa RTL8188CUS +product CHICONY RTL8188CUS_5 0xaffa RTL8188CUS product CHICONY2 TWINKLECAM 0x600d TwinkleCam USB camera /* CH Products */ @@ -1345,6 +1386,9 @@ product CONCEPTRONIC AR5523_1 0x7801 AR5 product CONCEPTRONIC AR5523_1_NF 0x7802 AR5523 (no firmware) product CONCEPTRONIC AR5523_2 0x7811 AR5523 product CONCEPTRONIC AR5523_2_NF 0x7812 AR5523 (no firmware) +product CONCEPTRONIC2 RTL8192SU_1 0x3300 RTL8192SU +product CONCEPTRONIC2 RTL8192SU_2 0x3301 RTL8192SU +product CONCEPTRONIC2 RTL8192SU_3 0x3302 RTL8192SU product CONCEPTRONIC2 C54RU 0x3c02 C54RU WLAN product CONCEPTRONIC2 C54RU2 0x3c22 C54RU product CONCEPTRONIC2 RT3070_1 0x3c08 RT3070 @@ -1381,6 +1425,8 @@ product COREGA RT2870_2 0x003c RT2870 product COREGA RT2870_3 0x003f RT2870 product COREGA RT3070 0x0041 RT3070 product COREGA CGWLUSB300GNM 0x0042 CG-WLUSB300GNM +product COREGA RTL8192SU 0x0047 RTL8192SU +product COREGA RTL8192CU 0x0056 RTL8192CU product COREGA WLUSB_11_STICK 0x7613 WLAN USB Stick 11 product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC @@ -1491,6 +1537,7 @@ product DIGIANSWER ZIGBEE802154 0x000a Z /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial*/ product DLINK DUBE100 0x1a00 10/100 Ethernet +product DLINK DUBE100C1 0x1a02 DUB-E100 rev C1 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWL122 0x3700 DWL-122 @@ -1506,6 +1553,9 @@ product DLINK DWLG122 0x3c00 DWL-G122 b product DLINK DUBE100B1 0x3c05 DUB-E100 rev B1 product DLINK RT2870 0x3c09 RT2870 product DLINK RT3072 0x3c0a RT3072 +product DLINK DWA140B3 0x3c15 DWA-140 rev B3 +product DLINK DWA160B2 0x3c1a DWA-160 rev B2 +product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet product DLINK DSB650TX 0x4002 10/100 Ethernet @@ -1516,6 +1566,14 @@ product DLINK DSB650 0xabc1 10/100 Ethe product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode product DLINK DWR510 0x7e12 DWR-510 +product DLINK RTL8188CU 0x3308 RTL8188CU +product DLINK RTL8192CU_1 0x3307 RTL8192CU +product DLINK RTL8192CU_2 0x3309 RTL8192CU +product DLINK RTL8192CU_3 0x330a RTL8192CU +product DLINK DWA131B 0x330d DWA-131 rev B +product DLINK2 RTL8192SU_1 0x3300 RTL8192SU +product DLINK2 RTL8192SU_2 0x3302 RTL8192SU +product DLINK2 DWA131A1 0x3303 DWA-131 A1 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 @@ -1552,9 +1610,14 @@ product DYNASTREAM ANTDEVBOARD2 0x1006 A /* Edimax products */ product EDIMAX EW7318USG 0x7318 USB Wireless dongle +product EDIMAX RTL8192SU_1 0x7611 RTL8192SU +product EDIMAX RTL8192SU_2 0x7612 RTL8192SU +product EDIMAX RTL8192SU_3 0x7622 RTL8192SU product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 +product EDIMAX EW7811UN 0x7811 EW-7811Un +product EDIMAX RTL8192CU 0x7822 RTL8192CU /* eGalax Products */ product EGALAX TPANEL 0x0001 Touch Panel @@ -1687,6 +1750,10 @@ product FEIYA 5IN1 0x1132 5-in-1 Card R product FEIYA ELANGO 0x6200 MicroSDHC Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader +/* FeiXun Communication products */ +product FEIXUN RTL8188CU 0x0090 RTL8188CU +product FEIXUN RTL8192CU 0x0091 RTL8192CU + /* Festo */ product FESTO CPX_USB 0x0102 CPX-USB product FESTO CMSP 0x0501 CMSP @@ -1718,6 +1785,7 @@ product FTDI SERIAL_8U232AM4 0x6004 8U23 product FTDI SERIAL_232RL 0x6006 FT232RL Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI 232H 0x6014 FTDI compatible adapter +product FTDI 232EX 0x6015 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial product FTDI BEAGLEBONE 0xa6d0 BeagleBone @@ -1875,6 +1943,7 @@ product FTDI IRTRANS 0xfc60 FTDI compat product FTDI LENZ_LIUSB 0xd780 FTDI compatible adapter product FTDI LM3S_DEVEL_BOARD 0xbcd8 FTDI compatible adapter product FTDI LM3S_EVAL_BOARD 0xbcd9 FTDI compatible adapter +product FTDI LM3S_ICDI_B_BOARD 0xbcda FTDI compatible adapter product FTDI MASTERDEVEL2 0xf449 FTDI compatible adapter product FTDI MHAM_DB9 0xeeed FTDI compatible adapter product FTDI MHAM_IC 0xeeec FTDI compatible adapter @@ -2038,6 +2107,9 @@ product GUILLEMOT HWGUSB254 0xe000 HWGUS product GUILLEMOT HWGUSB254LB 0xe010 HWGUSB2-54-LB product GUILLEMOT HWGUSB254V2AP 0xe020 HWGUSB2-54V2-AP product GUILLEMOT HWNU300 0xe030 HWNU-300 +product GUILLEMOT HWNUM300 0xe031 HWNUm-300 +product GUILLEMOT HWGUN54 0xe032 HWGUn-54 +product GUILLEMOT HWNUP150 0xe033 HWNUP-150 /* Hagiwara products */ product HAGIWARA FGSM 0x0002 FlashGate SmartMedia Card Reader @@ -2061,7 +2133,10 @@ product HAWKING RT2870_1 0x0001 RT2870 product HAWKING RT2870_2 0x0003 RT2870 product HAWKING HWUN2 0x0009 HWUN2 product HAWKING RT3070 0x000b RT3070 +product HAWKING RTL8192CU 0x0019 RTL8192CU product HAWKING UF100 0x400c 10/100 USB Ethernet +product HAWKING RTL8192SU_1 0x0015 RTL8192SU +product HAWKING RTL8192SU_2 0x0016 RTL8192SU /* HID Global GmbH products */ product HIDGLOBAL CM2020 0x0596 Omnikey Cardman 2020 @@ -2110,6 +2185,7 @@ product HP 5400C 0x1005 Scanjet 5400C product HP 2215 0x1016 iPAQ 22xx/Jornada 548 product HP 568J 0x1116 Jornada 568 product HP 930C 0x1204 DeskJet 930c +product HP3 RTL8188CU 0x1629 RTL8188CU product HP P2000U 0x1801 Inkjet P-2000U product HP HS2300 0x1e1d HS2300 HSDPA (aka MC8775) product HP 640C 0x2004 DeskJet 640c @@ -2418,6 +2494,27 @@ product KYOCERA2 KPC680 0x180a Qualcomm product LACIE HD 0xa601 Hard Disk product LACIE CDRW 0xa602 CD R/W +/* Lake Shore Cryotronics products */ +product LAKESHORE 121 0x0100 121 Current Source +product LAKESHORE 218A 0x0200 218A Temperature Monitor +product LAKESHORE 219 0x0201 219 Temperature Monitor +product LAKESHORE 233 0x0202 233 Temperature Transmitter +product LAKESHORE 235 0x0203 235 Temperature Transmitter +product LAKESHORE 335 0x0300 335 Temperature Controller +product LAKESHORE 336 0x0301 336 Temperature Controller +product LAKESHORE 350 0x0302 350 Temperature Controller +product LAKESHORE 371 0x0303 371 AC Bridge +product LAKESHORE 411 0x0400 411 Handheld Gaussmeter +product LAKESHORE 425 0x0401 425 Gaussmeter +product LAKESHORE 455A 0x0402 455A DSP Gaussmeter +product LAKESHORE 475A 0x0403 475A DSP Gaussmeter +product LAKESHORE 465 0x0404 465 Gaussmeter +product LAKESHORE 625A 0x0600 625A Magnet PSU +product LAKESHORE 642A 0x0601 642A Magnet PSU +product LAKESHORE 648 0x0602 648 Magnet PSU +product LAKESHORE 737 0x0700 737 VSM Controller +product LAKESHORE 776 0x0701 776 Matrix Switch + /* Larsen and Brusgaard products */ product LARSENBRUSGAARD ALTITRACK 0x0001 FTDI compatible adapter @@ -2436,6 +2533,7 @@ product LEXMARK S2450 0x0009 Optra S 24 /* Liebert products */ product LIEBERT POWERSURE_PXT 0xffff PowerSure Personal XT +product LIEBERT2 PSI1000 0x0004 UPS PSI 1000 FW:08 /* Link Instruments Inc. products */ product LINKINSTRUMENTS MSO19 0xf190 Link Instruments MSO-19 @@ -2471,6 +2569,7 @@ product LOGITECH M4848 0x0301 M4848 mou product LOGITECH PAGESCAN 0x040f PageScan product LOGITECH QUICKCAMWEB 0x0801 QuickCam Web product LOGITECH QUICKCAMPRO 0x0810 QuickCam Pro +product LOGITECH WEBCAMC100 0X0817 Webcam C100 product LOGITECH QUICKCAMEXP 0x0840 QuickCam Express product LOGITECH QUICKCAM 0x0850 QuickCam product LOGITECH QUICKCAMPRO3 0x0990 QuickCam Pro 9000 @@ -3007,6 +3106,7 @@ product NETAC ONLYDISK 0x0003 OnlyDisk /* NetChip Technology Products */ product NETCHIP TURBOCONNECT 0x1080 Turbo-Connect product NETCHIP CLIK_40 0xa140 USB Clik! 40 +product NETCHIP GADGETZERO 0xa4a0 Linux Gadget Zero product NETCHIP ETHERNETGADGET 0xa4a2 Linux Ethernet/RNDIS gadget on pxa210/25x/26x /* Netgear products */ @@ -3014,11 +3114,14 @@ product NETGEAR EA101 0x1001 Ethernet product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet +product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 +product NETGEAR RTL8192CU 0x9021 RTL8192CU +product NETGEAR WNA1000M 0x9041 WNA1000M product NETGEAR2 MA101 0x4100 MA101 product NETGEAR2 MA101B 0x4102 MA101 Rev B product NETGEAR3 WG111T 0x4250 WG111T @@ -3026,6 +3129,7 @@ product NETGEAR3 WG111T_NF 0x4251 WG111T product NETGEAR3 WPN111 0x5f00 WPN111 product NETGEAR3 WPN111_NF 0x5f01 WPN111 (no firmware) product NETGEAR3 WPN111_2 0x5f02 WPN111 +product NETGEAR4 RTL8188CU 0x9041 RTL8188CU /* NetIndex products */ product NETINDEX WS002IN 0x2001 Willcom WS002IN @@ -3041,6 +3145,7 @@ product NIKON D300 0x041a Digital Came /* NovaTech Products */ product NOVATECH NV902 0x9020 NovaTech NV-902W product NOVATECH RT2573 0x9021 RT2573 +product NOVATECH RTL8188CU 0x9071 RTL8188CU /* Nokia products */ product NOKIA N958GB 0x0070 Nokia N95 8GBc @@ -3146,6 +3251,7 @@ product OPTION GMT382 0x7501 Globetrott product OPTION GE40X_1 0x7301 Globetrotter HSUPA product OPTION GE40X_2 0x7361 Globetrotter HSUPA product OPTION GE40X_3 0x7381 Globetrotter HSUPA +product OPTION GTM661W 0x9000 GTM661W product OPTION ICONEDGE 0xc031 GlobeSurfer iCON EDGE product OPTION MODHSXPA 0xd013 Globetrotter HSUPA product OPTION ICON321 0xd031 Globetrotter HSUPA @@ -3174,6 +3280,9 @@ product OTI DKU5 0x6858 DKU-5 Serial /* Owen.ru products */ product OWEN AC4 0x0004 AC4 USB-RS485 converter +/* OWL producs */ +product OWL CM_160 0xca05 OWL CM-160 power monitor + /* Palm Computing, Inc. product */ product PALM SERIAL 0x0080 USB Serial product PALM M500 0x0001 Palm m500 @@ -3269,8 +3378,14 @@ product PIENGINEERING PS2USB 0x020b PS2 /* Planex Communications products */ product PLANEX GW_US11H 0x14ea GW-US11H WLAN +product PLANEX2 RTL8188CUS 0x1201 RTL8188CUS product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN product PLANEX2 GW_US54GXS 0x5303 GW-US54GXS WLAN +product PLANEX2 RTL8188CU_1 0xab2a RTL8188CU +product PLANEX2 RTL8188CU_2 0xed17 RTL8188CU +product PLANEX2 RTL8188CU_3 0x4902 RTL8188CU +product PLANEX2 RTL8188CU_4 0xab2e RTL8188CU +product PLANEX2 RTL8192CU 0xab2b RTL8192CU product PLANEX2 GWUS54HP 0xab01 GW-US54HP product PLANEX2 GWUS300MINIS 0xab24 GW-US300MiniS product PLANEX2 RT3070 0xab25 RT3070 @@ -3286,6 +3401,7 @@ product PLANEX2 GWUSVALUEEZ 0xed17 GW-US product PLANEX3 GWUS54GZ 0xab10 GW-US54GZ product PLANEX3 GU1000T 0xab11 GU-1000T product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini +product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U @@ -3488,6 +3604,7 @@ product RALINK RT3072 0x3072 RT3072 product RALINK RT3370 0x3370 RT3370 product RALINK RT3572 0x3572 RT3572 product RALINK RT5370 0x5370 RT5370 +product RALINK RT5572 0x5572 RT5572 product RALINK RT8070 0x8070 RT8070 product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter @@ -3496,15 +3613,35 @@ product RALINK RT2573_2 0x9021 RT2501US product RATOC REXUSB60 0xb000 USB serial adapter REX-USB60 product RATOC REXUSB60F 0xb020 USB serial adapter REX-USB60F -/* ReakTek products */ +/* Realtek products */ /* Green House and CompUSA OEM this part */ product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader +product REALTEK RTL8188CTV 0x018a RTL8188CTV product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet +product REALTEK RTL8188CE_0 0x8170 RTL8188CE +product REALTEK RTL8171 0x8171 RTL8171 +product REALTEK RTL8172 0x8172 RTL8172 +product REALTEK RTL8173 0x8173 RTL8173 +product REALTEK RTL8174 0x8174 RTL8174 +product REALTEK RTL8188CE_1 0x817e RTL8188CE +product REALTEK RTL8188CU_0 0x8176 RTL8188CU +product REALTEK RTL8188CU_1 0x817a RTL8188CU +product REALTEK RTL8188CU_2 0x817b RTL8188CU product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter +product REALTEK RTL8188CUS 0x818a RTL8188CUS +product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU +product REALTEK RTL8191CU 0x8177 RTL8191CU +product REALTEK RTL8192CU 0x8178 RTL8192CU +product REALTEK RTL8192CE 0x817c RTL8192CE +product REALTEK RTL8188RU_1 0x817d RTL8188RU +product REALTEK RTL8712 0x8712 RTL8712 +product REALTEK RTL8713 0x8712 RTL8713 +product REALTEK RTL8188RU_2 0x317f RTL8188RU +product REALTEK RTL8192SU 0xc512 RTL8192SU /* RedOctane products */ product REDOCTANE DUMMY 0x0000 Dummy product @@ -3593,6 +3730,9 @@ product SANYO SCP4900 0x0701 Sanyo SCP product SCANLOGIC SL11R 0x0002 SL11R IDE Adapter product SCANLOGIC 336CX 0x0300 Phantom 336CX - C3 scanner +/* Schweitzer Engineering Laboratories products */ +product SEL C662 0x0001 C662 Cable + /* Sealevel products */ product SEALEVEL 2101 0x2101 FTDI compatible adapter product SEALEVEL 2102 0x2102 FTDI compatible adapter @@ -3655,6 +3795,8 @@ product SENAO RT3072_2 0x9707 RT3072 product SENAO RT3072_3 0x9708 RT3072 product SENAO RT3072_4 0x9709 RT3072 product SENAO RT3072_5 0x9801 RT3072 +product SENAO RTL8192SU_1 0x9603 RTL8192SU +product SENAO RTL8192SU_2 0x9605 RTL8192SU /* ShanTou products */ product SHANTOU ST268 0x0268 ST268 @@ -3831,8 +3973,11 @@ product SILABS BEI_VCP 0x846e BEI USB S product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS V_PREON32 0x85f8 Virtenio Preon32 product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface +product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee +product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial @@ -3875,10 +4020,15 @@ product SITECOMEU WL608 0x003f WL-608 product SITECOMEU RT3071 0x0040 RT3071 product SITECOMEU RT3072_1 0x0041 RT3072 product SITECOMEU RT3072_2 0x0042 RT3072 +product SITECOMEU WL353 0x0045 WL-353 product SITECOMEU RT3072_3 0x0047 RT3072 product SITECOMEU RT3072_4 0x0048 RT3072 product SITECOMEU RT3072_5 0x004a RT3072 +product SITECOMEU WL349V1 0x004b WL-349 v1 product SITECOMEU RT3072_6 0x004d RT3072 +product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU +product SITECOMEU RTL8188CU_2 0x005c RTL8188CU +product SITECOMEU RTL8192CU 0x0061 RTL8192CU product SITECOMEU LN028 0x061c LN-028 product SITECOMEU WL113 0x9071 WL-113 product SITECOMEU ZD1211B 0x9075 ZD1211B @@ -3904,6 +4054,7 @@ product SMC 2862WG 0xee13 EZ Connect Wi product SMC2 2020HUB 0x2020 USB Hub product SMC2 2514HUB 0x2514 USB Hub product SMC3 2662WUSB 0xa002 2662W-AR Wireless +product SMC2 LAN9514_ETH 0xec00 USB/Ethernet /* SOHOware products */ product SOHOWARE NUB100 0x9100 10/100 USB Ethernet @@ -4004,6 +4155,7 @@ product SUNPLUS USBMOUSE 0x0007 USB Opti /* Super Top products */ product SUPERTOP IDE 0x6600 USB-IDE +product SUPERTOP FLASHDRIVE 0x121c extrememory Snippy /* Syntech products */ product SYNTECH CPT8001C 0x0001 CPT-8001C Barcode scanner @@ -4040,6 +4192,7 @@ product SURECOM RT2573 0x31f3 RT2573 /* Sweex products */ product SWEEX ZD1211 0x1809 ZD1211 product SWEEX2 LW153 0x0153 LW153 +product SWEEX2 LW154 0x0154 LW154 product SWEEX2 LW303 0x0302 LW303 product SWEEX2 LW313 0x0313 LW313 @@ -4106,6 +4259,10 @@ product TREK THUMBDRIVE 0x1111 ThumbDri product TREK MEMKEY 0x8888 IBM USB Memory Key product TREK THUMBDRIVE_8MB 0x9988 ThumbDrive_8MB +/* TRENDnet products */ +product TRENDNET RTL8192CU 0x624d RTL8192CU +product TRENDNET RTL8188CU 0x648b RTL8188CU + /* Tripp-Lite products */ product TRIPPLITE U209 0x2008 Serial @@ -4210,12 +4367,19 @@ product WCH2 CH341SER_2 0x5523 CH341/CH product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge product WCH2 U2M 0X752d CH345 USB2.0-MIDI +/* West Mountain Radio products */ +product WESTMOUNTAIN RIGBLASTER_ADVANTAGE 0x0003 RIGblaster Advantage + /* Western Digital products */ product WESTERN COMBO 0x0200 Firewire USB Combo product WESTERN EXTHDD 0x0400 External HDD product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD product WESTERN MYPASSWORD 0x0704 MyPassword External HDD +product WESTERN MYPASSPORT 0x0748 MyPassport External HDD + +/* WeTelecom products */ +product WETELECOM WM_D200 0x6801 WM-D200 /* WIENER Plein & Baus GmbH products */ product WIENERPLEINBAUS PL512 0x0010 PL512 PSU @@ -4311,3 +4475,4 @@ product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL RT2870_2 0x341a RT2870 +product ZYXEL RTL8192CU 0x341f RTL8192CU Modified: stable/9/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_rum.c Mon Dec 16 08:56:45 2013 (r259456) +++ stable/9/sys/dev/usb/wlan/if_rum.c Mon Dec 16 09:07:09 2013 (r259457) @@ -604,8 +604,13 @@ rum_vap_create(struct ieee80211com *ic, return NULL; vap = &rvp->vap; /* enable s/w bmiss handling for sta mode */ - ieee80211_vap_setup(ic, vap, name, unit, opmode, - flags | IEEE80211_CLONE_NOBEACONS, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags | IEEE80211_CLONE_NOBEACONS, bssid, mac) != 0) { + /* out of memory */ + free(rvp, M_80211_VAP); + return (NULL); + } /* override state transition machine */ rvp->newstate = vap->iv_newstate; @@ -1131,7 +1136,7 @@ rum_tx_mgt(struct rum_softc *sc, struct dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); /* tell hardware to add timestamp for probe responses */ if ((wh->i_fc[0] & @@ -1275,7 +1280,7 @@ rum_tx_data(struct rum_softc *sc, struct dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); - *(uint16_t *)wh->i_dur = htole16(dur); + USETW(wh->i_dur, dur); } rum_setup_tx_desc(sc, &data->desc, flags, 0, m0->m_pkthdr.len, rate); Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 16 08:56:45 2013 (r259456) +++ stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 16 09:07:09 2013 (r259457) @@ -2,6 +2,7 @@ * Copyright (c) 2008,2010 Damien Bergamini * ported to FreeBSD by Akinori Furukoshi * USB Consulting, Hans Petter Selasky + * Copyright (c) 2013 Kevin Lo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ __FBSDID("$FreeBSD$"); /*- - * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver. + * Ralink Technology RT2700U/RT2800U/RT3000U/RT3900E chipset driver. * http://www.ralinktech.com/ */ @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define N(_a) ((int)(sizeof((_a)) / sizeof((_a)[0]))) - #ifdef USB_DEBUG #define RUN_DEBUG #endif @@ -172,6 +171,8 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(CYBERTAN, RT2870), RUN_DEV(DLINK, RT2870), RUN_DEV(DLINK, RT3072), + RUN_DEV(DLINK, DWA140B3), + RUN_DEV(DLINK, DWA160B2), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), RUN_DEV(DLINK2, RT2870_2), @@ -255,6 +256,8 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(RALINK, RT3072), RUN_DEV(RALINK, RT3370), RUN_DEV(RALINK, RT3572), + RUN_DEV(RALINK, RT5370), + RUN_DEV(RALINK, RT5572), RUN_DEV(RALINK, RT8070), RUN_DEV(SAMSUNG, WIS09ABGN), RUN_DEV(SAMSUNG2, RT2870_1), @@ -318,7 +321,7 @@ static usb_callback_t run_bulk_tx_callba static usb_callback_t run_bulk_tx_callback5; static void run_bulk_tx_callbackN(struct usb_xfer *xfer, - usb_error_t error, unsigned int index); + usb_error_t error, u_int index); static struct ieee80211vap *run_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -342,13 +345,13 @@ static int run_write_region_1(struct run static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, int); static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *); -static int run_rt2870_rf_write(struct run_softc *, uint8_t, uint32_t); +static int run_rt2870_rf_write(struct run_softc *, uint32_t); static int run_rt3070_rf_read(struct run_softc *, uint8_t, uint8_t *); static int run_rt3070_rf_write(struct run_softc *, uint8_t, uint8_t); static int run_bbp_read(struct run_softc *, uint8_t, uint8_t *); static int run_bbp_write(struct run_softc *, uint8_t, uint8_t); static int run_mcu_cmd(struct run_softc *, uint8_t, uint16_t); -static const char *run_get_rf(int); +static const char *run_get_rf(uint16_t); static int run_read_eeprom(struct run_softc *); static struct ieee80211_node *run_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); @@ -360,7 +363,7 @@ static void run_key_update_begin(struct static void run_key_update_end(struct ieee80211vap *); static void run_key_set_cb(void *); static int run_key_set(struct ieee80211vap *, struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); + const uint8_t mac[IEEE80211_ADDR_LEN]); static void run_key_delete_cb(void *); static int run_key_delete(struct ieee80211vap *, struct ieee80211_key *); static void run_ratectl_to(void *); @@ -392,6 +395,8 @@ static void run_set_rx_antenna(struct ru static void run_rt2870_set_chan(struct run_softc *, u_int); static void run_rt3070_set_chan(struct run_softc *, u_int); static void run_rt3572_set_chan(struct run_softc *, u_int); +static void run_rt5390_set_chan(struct run_softc *, u_int); +static void run_rt5592_set_chan(struct run_softc *, u_int); static int run_set_chan(struct run_softc *, struct ieee80211_channel *); static void run_set_channel(struct ieee80211com *); static void run_scan_start(struct ieee80211com *); @@ -415,16 +420,19 @@ static void run_update_mcast(struct ifne static int8_t run_rssi2dbm(struct run_softc *, uint8_t, uint8_t); static void run_update_promisc_locked(struct ifnet *); static void run_update_promisc(struct ifnet *); +static void run_rt5390_bbp_init(struct run_softc *); static int run_bbp_init(struct run_softc *); static int run_rt3070_rf_init(struct run_softc *); +static void run_rt5390_rf_init(struct run_softc *); static int run_rt3070_filter_calib(struct run_softc *, uint8_t, uint8_t, uint8_t *); static void run_rt3070_rf_setup(struct run_softc *); static int run_txrx_enable(struct run_softc *); +static void run_adjust_freq_offset(struct run_softc *); static void run_init(void *); static void run_init_locked(struct run_softc *); static void run_stop(void *); -static void run_delay(struct run_softc *, unsigned int); +static void run_delay(struct run_softc *, u_int); static const struct { uint16_t reg; @@ -438,6 +446,25 @@ static const struct { uint8_t val; } rt2860_def_bbp[] = { RT2860_DEF_BBP +},rt5390_def_bbp[] = { + RT5390_DEF_BBP +},rt5592_def_bbp[] = { + RT5592_DEF_BBP +}; + +/* + * Default values for BBP register R196 for RT5592. + */ +static const uint8_t rt5592_bbp_r196[] = { + 0xe0, 0x1f, 0x38, 0x32, 0x08, 0x28, 0x19, 0x0a, 0xff, 0x00, + 0x16, 0x10, 0x10, 0x0b, 0x36, 0x2c, 0x26, 0x24, 0x42, 0x36, + 0x30, 0x2d, 0x4c, 0x46, 0x3d, 0x40, 0x3e, 0x42, 0x3d, 0x40, + 0x3c, 0x34, 0x2c, 0x2f, 0x3c, 0x35, 0x2e, 0x2a, 0x49, 0x41, + 0x36, 0x31, 0x30, 0x30, 0x0e, 0x0d, 0x28, 0x21, 0x1c, 0x16, + 0x50, 0x4a, 0x43, 0x40, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7d, 0x14, 0x32, 0x2c, 0x36, 0x4c, 0x43, 0x2c, + 0x2e, 0x36, 0x30, 0x6e }; static const struct rfprog { @@ -453,6 +480,15 @@ struct { RT3070_RF3052 }; +static const struct rt5592_freqs { + uint16_t n; + uint8_t k, m, r; +} rt5592_freqs_20mhz[] = { + RT5592_RF5592_20MHZ +},rt5592_freqs_40mhz[] = { + RT5592_RF5592_40MHZ +}; + static const struct { uint8_t reg; uint8_t val; @@ -460,6 +496,25 @@ static const struct { RT3070_DEF_RF },rt3572_def_rf[] = { RT3572_DEF_RF +},rt5390_def_rf[] = { + RT5390_DEF_RF +},rt5392_def_rf[] = { + RT5392_DEF_RF +},rt5592_def_rf[] = { + RT5592_DEF_RF +},rt5592_2ghz_def_rf[] = { + RT5592_2GHZ_DEF_RF +},rt5592_5ghz_def_rf[] = { + RT5592_5GHZ_DEF_RF +}; + +static const struct { + u_int firstchan; + u_int lastchan; + uint8_t reg; + uint8_t val; +} rt5592_chan_5ghz[] = { + RT5592_CHAN_5GHZ }; static const struct usb_config run_config[RUN_N_XFER] = { @@ -556,7 +611,7 @@ run_attach(device_t self) struct ieee80211com *ic; struct ifnet *ifp; uint32_t ver; - int i, ntries, error; + int ntries, error; uint8_t iface_index, bands; device_set_usb_desc(self); @@ -653,27 +708,11 @@ run_attach(device_t self) bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); + if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || + sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT5592_RF_5592) + setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - /* - * Do this by own because h/w supports - * more channels than ieee80211_init_channels() - */ - if (sc->rf_rev == RT2860_RF_2750 || - sc->rf_rev == RT2860_RF_2850 || - sc->rf_rev == RT3070_RF_3052) { - /* set supported .11a rates */ - for (i = 14; i < N(rt2860_rf2850); i++) { - uint8_t chan = rt2860_rf2850[i].chan; - ic->ic_channels[ic->ic_nchans].ic_freq = - ieee80211_ieee2mhz(chan, IEEE80211_CHAN_A); - ic->ic_channels[ic->ic_nchans].ic_ieee = chan; - ic->ic_channels[ic->ic_nchans].ic_flags = IEEE80211_CHAN_A; - ic->ic_channels[ic->ic_nchans].ic_extieee = 0; - ic->ic_nchans++; - } - } - ieee80211_ifattach(ic, sc->sc_bssid); ic->ic_scan_start = run_scan_start; @@ -698,7 +737,7 @@ run_attach(device_t self) TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc); TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc); - callout_init((struct callout *)&sc->ratectl_ch, 1); + usb_callout_init_mtx(&sc->ratectl_ch, &sc->sc_mtx, 0); if (bootverbose) ieee80211_announce(ic); @@ -802,7 +841,13 @@ run_vap_create(struct ieee80211com *ic, if (rvp == NULL) return (NULL); vap = &rvp->vap; - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); + + if (ieee80211_vap_setup(ic, vap, name, unit, + opmode, flags, bssid, mac) != 0) { + /* out of memory */ + free(rvp, M_80211_VAP); + return (NULL); + } vap->iv_key_update_begin = run_key_update_begin; vap->iv_key_update_end = run_key_update_end; @@ -1008,13 +1053,12 @@ run_load_microcode(struct run_softc *sc) /* cheap sanity check */ temp = fw->data; bytes = *temp; - if (bytes != be64toh(0xffffff0210280210)) { + if (bytes != be64toh(0xffffff0210280210ULL)) { device_printf(sc->sc_dev, "firmware checksum failed\n"); error = EINVAL; goto fail; } - run_read(sc, RT2860_ASIC_VER_ID, &tmp); /* write microcode image */ run_write_region_1(sc, RT2870_FW_BASE, base, 4096); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); @@ -1061,7 +1105,7 @@ fail: return (error); } -int +static int run_reset(struct run_softc *sc) { usb_device_request_t req; @@ -1163,13 +1207,32 @@ run_write_region_1(struct run_softc *sc, return (error); #else usb_device_request_t req; + int error = 0; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = RT2870_WRITE_REGION_1; - USETW(req.wValue, 0); - USETW(req.wIndex, reg); - USETW(req.wLength, len); - return (run_do_request(sc, &req, buf)); + /* + * NOTE: It appears the WRITE_REGION_1 command cannot be + * passed a huge amount of data, which will crash the + * firmware. Limit amount of data passed to 64-bytes at a + * time. + */ + while (len > 0) { + int delta = 64; + if (delta > len) + delta = len; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2870_WRITE_REGION_1; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, delta); + error = run_do_request(sc, &req, __DECONST(uint8_t *, buf)); + if (error != 0) + break; + reg += delta; + buf += delta; + len -= delta; + } + return (error); #endif } @@ -1259,7 +1322,7 @@ run_srom_read(struct run_softc *sc, uint } static int -run_rt2870_rf_write(struct run_softc *sc, uint8_t reg, uint32_t val) +run_rt2870_rf_write(struct run_softc *sc, uint32_t val) { uint32_t tmp; int error, ntries; @@ -1273,10 +1336,7 @@ run_rt2870_rf_write(struct run_softc *sc if (ntries == 10) return (ETIMEDOUT); - /* RF registers are 24-bit on the RT2860 */ - tmp = RT2860_RF_REG_CTRL | 24 << RT2860_RF_REG_WIDTH_SHIFT | - (val & 0x3fffff) << 2 | (reg & 3); - return (run_write(sc, RT2860_RF_CSR_CFG0, tmp)); + return (run_write(sc, RT2860_RF_CSR_CFG0, val)); } static int @@ -1427,7 +1487,7 @@ b4inc(uint32_t b32, int8_t delta) } static const char * -run_get_rf(int rev) +run_get_rf(uint16_t rev) { switch (rev) { case RT2860_RF_2820: return "RT2820"; @@ -1439,11 +1499,14 @@ run_get_rf(int rev) case RT3070_RF_3021: return "RT3021"; case RT3070_RF_3022: return "RT3022"; case RT3070_RF_3052: return "RT3052"; + case RT5592_RF_5592: return "RT5592"; + case RT5390_RF_5370: return "RT5370"; + case RT5390_RF_5372: return "RT5372"; } return ("unknown"); } -int +static int run_read_eeprom(struct run_softc *sc) { int8_t delta_2ghz, delta_5ghz; @@ -1475,21 +1538,25 @@ run_read_eeprom(struct run_softc *sc) sc->sc_bssid[4] = val & 0xff; sc->sc_bssid[5] = val >> 8; - /* read vender BBP settings */ - for (i = 0; i < 10; i++) { - run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val); - sc->bbp[i].val = val & 0xff; - sc->bbp[i].reg = val >> 8; - DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val); - } - if (sc->mac_ver >= 0x3071) { - /* read vendor RF settings */ + if (sc->mac_ver < 0x5390) { + /* read vender BBP settings */ for (i = 0; i < 10; i++) { - run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, &val); - sc->rf[i].val = val & 0xff; - sc->rf[i].reg = val >> 8; - DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg, - sc->rf[i].val); + run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val); + sc->bbp[i].val = val & 0xff; + sc->bbp[i].reg = val >> 8; + DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, + sc->bbp[i].val); + } + if (sc->mac_ver >= 0x3071) { + /* read vendor RF settings */ + for (i = 0; i < 10; i++) { + run_srom_read(sc, RT3071_EEPROM_RF_BASE + i, + &val); + sc->rf[i].val = val & 0xff; + sc->rf[i].reg = val >> 8; + DPRINTF("RF%d=0x%02x\n", sc->rf[i].reg, + sc->rf[i].val); + } } } @@ -1515,7 +1582,11 @@ run_read_eeprom(struct run_softc *sc) sc->leds, sc->led[0], sc->led[1], sc->led[2]); /* read RF information */ - run_srom_read(sc, RT2860_EEPROM_ANTENNA, &val); + if (sc->mac_ver == 0x5390 || sc->mac_ver ==0x5392) + run_srom_read(sc, 0x00, &val); + else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 09:23:22 2013 Return-Path: Delivered-To: svn-src-all@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 5039A9C9; Mon, 16 Dec 2013 09:23:22 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3251A24; Mon, 16 Dec 2013 09:23:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG9NMsR055635; Mon, 16 Dec 2013 09:23:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG9NMRn055634; Mon, 16 Dec 2013 09:23:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160923.rBG9NMRn055634@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 09:23:22 +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: r259458 - stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 09:23:22 -0000 Author: hselasky Date: Mon Dec 16 09:23:21 2013 New Revision: 259458 URL: http://svnweb.freebsd.org/changeset/base/259458 Log: MFC r258083: Remove a couple of unused macros. Modified: stable/9/sys/dev/usb/wlan/if_runreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:07:09 2013 (r259457) +++ stable/9/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:23:21 2013 (r259458) @@ -932,31 +932,6 @@ static const struct rt2860_rate { }; /* - * Control and status registers access macros. - */ -#define RAL_READ(sc, reg) \ - bus_space_read_4((sc)->sc_st, (sc)->sc_sh, (reg)) - -#define RAL_WRITE(sc, reg, val) \ - bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (reg), (val)) - -#define RAL_BARRIER_WRITE(sc) \ - bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, 0x1800, \ - BUS_SPACE_BARRIER_WRITE) - -#define RAL_BARRIER_READ_WRITE(sc) \ - bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, 0x1800, \ - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE) - -#define RAL_WRITE_REGION_1(sc, offset, datap, count) \ - bus_space_write_region_1((sc)->sc_st, (sc)->sc_sh, (offset), \ - (datap), (count)) - -#define RAL_SET_REGION_4(sc, offset, val, count) \ - bus_space_set_region_4((sc)->sc_st, (sc)->sc_sh, (offset), \ - (val), (count)) - -/* * EEPROM access macro. */ #define RT2860_EEPROM_CTL(sc, val) do { \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 09:31:16 2013 Return-Path: Delivered-To: svn-src-all@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 11E03BA8; Mon, 16 Dec 2013 09:31:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1AD81AB4; Mon, 16 Dec 2013 09:31:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG9VF7n058918; Mon, 16 Dec 2013 09:31:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG9VFiS058917; Mon, 16 Dec 2013 09:31:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160931.rBG9VFiS058917@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 09:31:15 +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: r259459 - stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 09:31:16 -0000 Author: hselasky Date: Mon Dec 16 09:31:15 2013 New Revision: 259459 URL: http://svnweb.freebsd.org/changeset/base/259459 Log: MFC r256718, r257410 and r257411: - Fix RF registers for RT3070. - Initialize BBP68 to improve RX sensitivity. - Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to match with the vendor driver. While here, remove unused RT2860_DEF_MAC definition. Modified: stable/9/sys/dev/usb/wlan/if_runreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:23:21 2013 (r259458) +++ stable/9/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:31:15 2013 (r259459) @@ -943,39 +943,9 @@ static const struct rt2860_rate { /* * Default values for MAC registers; values taken from the reference driver. */ -#define RT2860_DEF_MAC \ - { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ - { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ - { RT2860_HT_BASIC_RATE, 0x00008003 }, \ - { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ - { RT2860_BKOFF_SLOT_CFG, 0x00000209 }, \ - { RT2860_TX_SW_CFG0, 0x00000000 }, \ - { RT2860_TX_SW_CFG1, 0x00080606 }, \ - { RT2860_TX_LINK_CFG, 0x00001020 }, \ - { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ - { RT2860_LED_CFG, 0x7f031e46 }, \ - { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ - { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ - { RT2860_WMM_CWMAX_CFG, 0x000034aa }, \ - { RT2860_MAX_PCNT, 0x1f3fbf9f }, \ - { RT2860_TX_RTY_CFG, 0x47d01f0f }, \ - { RT2860_AUTO_RSP_CFG, 0x00000013 }, \ - { RT2860_CCK_PROT_CFG, 0x05740003 }, \ - { RT2860_OFDM_PROT_CFG, 0x05740003 }, \ - { RT2860_GF20_PROT_CFG, 0x01744004 }, \ - { RT2860_GF40_PROT_CFG, 0x03f44084 }, \ - { RT2860_MM20_PROT_CFG, 0x01744004 }, \ - { RT2860_MM40_PROT_CFG, 0x03f54084 }, \ - { RT2860_TXOP_CTRL_CFG, 0x0000583f }, \ - { RT2860_TXOP_HLDR_ET, 0x00000002 }, \ - { RT2860_TX_RTS_CFG, 0x00092b20 }, \ - { RT2860_EXP_ACK_TIME, 0x002400ca }, \ - { RT2860_XIFS_TIME_CFG, 0x33a41010 }, \ - { RT2860_PWR_PIN_CFG, 0x00000003 } - -/* XXX only a few registers differ from above, try to merge? */ #define RT2870_DEF_MAC \ { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ + { RT2860_BCN_OFFSET1, 0x6f77d0c8 }, \ { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ { RT2860_HT_BASIC_RATE, 0x00008003 }, \ { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ @@ -984,6 +954,7 @@ static const struct rt2860_rate { { RT2860_TX_SW_CFG1, 0x00080606 }, \ { RT2860_TX_LINK_CFG, 0x00001020 }, \ { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ + { RT2860_MAX_LEN_CFG, 0x00001f00 }, \ { RT2860_LED_CFG, 0x7f031e46 }, \ { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ @@ -1012,6 +983,7 @@ static const struct rt2860_rate { #define RT2860_DEF_BBP \ { 65, 0x2c }, \ { 66, 0x38 }, \ + { 68, 0x0b }, \ { 69, 0x12 }, \ { 70, 0x0a }, \ { 73, 0x10 }, \ @@ -1316,7 +1288,7 @@ static const struct rt2860_rate { { 4, 0x40 }, \ { 5, 0x03 }, \ { 6, 0x02 }, \ - { 7, 0x70 }, \ + { 7, 0x60 }, \ { 9, 0x0f }, \ { 10, 0x41 }, \ { 11, 0x21 }, \ @@ -1330,7 +1302,7 @@ static const struct rt2860_rate { { 20, 0xba }, \ { 21, 0xdb }, \ { 24, 0x16 }, \ - { 25, 0x01 }, \ + { 25, 0x03 }, \ { 29, 0x1f } #define RT3572_DEF_RF \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 09:34:03 2013 Return-Path: Delivered-To: svn-src-all@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 13CA3D40; Mon, 16 Dec 2013 09:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9E911AE3; Mon, 16 Dec 2013 09:34:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG9Y2DF059316; Mon, 16 Dec 2013 09:34:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG9Y1pK059306; Mon, 16 Dec 2013 09:34:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160934.rBG9Y1pK059306@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 09:34:01 +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: r259460 - stable/9/sys/dev/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 09:34:03 -0000 Author: hselasky Date: Mon Dec 16 09:34:01 2013 New Revision: 259460 URL: http://svnweb.freebsd.org/changeset/base/259460 Log: MFC r253757: Fix alignment of USB WLAN radiotap headers. This makes USB WLAN adapters work on ARM, MIPS and similar platforms, where alignment matters. Modified: stable/9/sys/dev/usb/wlan/if_rumvar.h stable/9/sys/dev/usb/wlan/if_runvar.h stable/9/sys/dev/usb/wlan/if_uathvar.h stable/9/sys/dev/usb/wlan/if_upgtvar.h stable/9/sys/dev/usb/wlan/if_uralvar.h stable/9/sys/dev/usb/wlan/if_urtwvar.h stable/9/sys/dev/usb/wlan/if_zydreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_rumvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_rumvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -29,7 +29,7 @@ struct rum_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RT2573_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -47,7 +47,7 @@ struct rum_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RT2573_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: stable/9/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_runvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_runvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -52,7 +52,7 @@ struct run_rx_radiotap_header { int8_t wr_dbm_antsignal; uint8_t wr_antenna; uint8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define RUN_RX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ @@ -69,7 +69,7 @@ struct run_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_hwqueue; -} __packed; +} __packed __aligned(8); #define IEEE80211_RADIOTAP_HWQUEUE 15 Modified: stable/9/sys/dev/usb/wlan/if_uathvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uathvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_uathvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -52,7 +52,7 @@ struct uath_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; u_int8_t wr_antenna; -} __packed; +} __packed __aligned(8); #define UATH_RX_RADIOTAP_PRESENT ( \ (1 << IEEE80211_RADIOTAP_TSFT) | \ @@ -69,7 +69,7 @@ struct uath_tx_radiotap_header { uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UATH_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: stable/9/sys/dev/usb/wlan/if_upgtvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_upgtvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -380,7 +380,7 @@ struct upgt_rx_radiotap_header { uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define UPGT_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -394,7 +394,7 @@ struct upgt_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UPGT_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: stable/9/sys/dev/usb/wlan/if_uralvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_uralvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_uralvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -34,7 +34,7 @@ struct ural_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RAL_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -51,7 +51,7 @@ struct ural_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RAL_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: stable/9/sys/dev/usb/wlan/if_urtwvar.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_urtwvar.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_urtwvar.h Mon Dec 16 09:34:01 2013 (r259460) @@ -63,7 +63,7 @@ struct urtw_rx_radiotap_header { uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_dbm_antsignal; -} __packed; +} __packed __aligned(8); #define URTW_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -75,7 +75,7 @@ struct urtw_tx_radiotap_header { uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define URTW_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ Modified: stable/9/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- stable/9/sys/dev/usb/wlan/if_zydreg.h Mon Dec 16 09:31:15 2013 (r259459) +++ stable/9/sys/dev/usb/wlan/if_zydreg.h Mon Dec 16 09:34:01 2013 (r259460) @@ -1185,7 +1185,7 @@ struct zyd_rx_radiotap_header { uint16_t wr_chan_flags; int8_t wr_antsignal; int8_t wr_antnoise; -} __packed; +} __packed __aligned(8); #define ZYD_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -1200,7 +1200,7 @@ struct zyd_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define ZYD_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 09:48:09 2013 Return-Path: Delivered-To: svn-src-all@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 537EC2A0; Mon, 16 Dec 2013 09:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DE0E1CEC; Mon, 16 Dec 2013 09:48:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBG9m9WQ063318; Mon, 16 Dec 2013 09:48:09 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBG9m9aZ063317; Mon, 16 Dec 2013 09:48:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312160948.rBG9m9aZ063317@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 09:48: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: r259461 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 09:48:09 -0000 Author: hselasky Date: Mon Dec 16 09:48:08 2013 New Revision: 259461 URL: http://svnweb.freebsd.org/changeset/base/259461 Log: MFC r256718, r257410 and r257411: - Fix RF registers for RT3070. - Initialize BBP68 to improve RX sensitivity. - Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to match with the vendor driver. While here, remove unused RT2860_DEF_MAC definition. Modified: stable/10/sys/dev/usb/wlan/if_runreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- stable/10/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:34:01 2013 (r259460) +++ stable/10/sys/dev/usb/wlan/if_runreg.h Mon Dec 16 09:48:08 2013 (r259461) @@ -968,39 +968,9 @@ static const struct rt2860_rate { /* * Default values for MAC registers; values taken from the reference driver. */ -#define RT2860_DEF_MAC \ - { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ - { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ - { RT2860_HT_BASIC_RATE, 0x00008003 }, \ - { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ - { RT2860_BKOFF_SLOT_CFG, 0x00000209 }, \ - { RT2860_TX_SW_CFG0, 0x00000000 }, \ - { RT2860_TX_SW_CFG1, 0x00080606 }, \ - { RT2860_TX_LINK_CFG, 0x00001020 }, \ - { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ - { RT2860_LED_CFG, 0x7f031e46 }, \ - { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ - { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ - { RT2860_WMM_CWMAX_CFG, 0x000034aa }, \ - { RT2860_MAX_PCNT, 0x1f3fbf9f }, \ - { RT2860_TX_RTY_CFG, 0x47d01f0f }, \ - { RT2860_AUTO_RSP_CFG, 0x00000013 }, \ - { RT2860_CCK_PROT_CFG, 0x05740003 }, \ - { RT2860_OFDM_PROT_CFG, 0x05740003 }, \ - { RT2860_GF20_PROT_CFG, 0x01744004 }, \ - { RT2860_GF40_PROT_CFG, 0x03f44084 }, \ - { RT2860_MM20_PROT_CFG, 0x01744004 }, \ - { RT2860_MM40_PROT_CFG, 0x03f54084 }, \ - { RT2860_TXOP_CTRL_CFG, 0x0000583f }, \ - { RT2860_TXOP_HLDR_ET, 0x00000002 }, \ - { RT2860_TX_RTS_CFG, 0x00092b20 }, \ - { RT2860_EXP_ACK_TIME, 0x002400ca }, \ - { RT2860_XIFS_TIME_CFG, 0x33a41010 }, \ - { RT2860_PWR_PIN_CFG, 0x00000003 } - -/* XXX only a few registers differ from above, try to merge? */ #define RT2870_DEF_MAC \ { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ + { RT2860_BCN_OFFSET1, 0x6f77d0c8 }, \ { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ { RT2860_HT_BASIC_RATE, 0x00008003 }, \ { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ @@ -1009,6 +979,7 @@ static const struct rt2860_rate { { RT2860_TX_SW_CFG1, 0x00080606 }, \ { RT2860_TX_LINK_CFG, 0x00001020 }, \ { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ + { RT2860_MAX_LEN_CFG, 0x00001f00 }, \ { RT2860_LED_CFG, 0x7f031e46 }, \ { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ @@ -1037,6 +1008,7 @@ static const struct rt2860_rate { #define RT2860_DEF_BBP \ { 65, 0x2c }, \ { 66, 0x38 }, \ + { 68, 0x0b }, \ { 69, 0x12 }, \ { 70, 0x0a }, \ { 73, 0x10 }, \ @@ -1341,7 +1313,7 @@ static const struct rt2860_rate { { 4, 0x40 }, \ { 5, 0x03 }, \ { 6, 0x02 }, \ - { 7, 0x70 }, \ + { 7, 0x60 }, \ { 9, 0x0f }, \ { 10, 0x41 }, \ { 11, 0x21 }, \ @@ -1355,7 +1327,7 @@ static const struct rt2860_rate { { 20, 0xba }, \ { 21, 0xdb }, \ { 24, 0x16 }, \ - { 25, 0x01 }, \ + { 25, 0x03 }, \ { 29, 0x1f } #define RT3572_DEF_RF \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 10:50:14 2013 Return-Path: Delivered-To: svn-src-all@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 3222734F; Mon, 16 Dec 2013 10:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E74E1158; Mon, 16 Dec 2013 10:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGAoD79085135; Mon, 16 Dec 2013 10:50:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGAoDYk085134; Mon, 16 Dec 2013 10:50:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312161050.rBGAoDYk085134@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Dec 2013 10:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259462 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 10:50:14 -0000 Author: hselasky Date: Mon Dec 16 10:50:13 2013 New Revision: 259462 URL: http://svnweb.freebsd.org/changeset/base/259462 Log: Fix regression issue after r259248: Some Intel XHCI controlles timeout processing so-called "TRBs" when the final LINK TRB of a so-called "TD" has the CHAIN-BIT set. MFC after: 1 week Tested by: glebius @ Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Dec 16 09:48:08 2013 (r259461) +++ head/sys/dev/usb/controller/xhci.c Mon Dec 16 10:50:13 2013 (r259462) @@ -1942,6 +1942,8 @@ restart: /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); + /* remove CHAIN-BIT from last LINK TRB */ + td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 11:04:00 2013 Return-Path: Delivered-To: svn-src-all@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 76F2A9CB; Mon, 16 Dec 2013 11:04:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6366C12A2; Mon, 16 Dec 2013 11:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGB40nV091816; Mon, 16 Dec 2013 11:04:00 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGB3xm4091806; Mon, 16 Dec 2013 11:03:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312161103.rBGB3xm4091806@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 16 Dec 2013 11:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259463 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 11:04:00 -0000 Author: pjd Date: Mon Dec 16 11:03:59 2013 New Revision: 259463 URL: http://svnweb.freebsd.org/changeset/base/259463 Log: Start-up script for casperd daemon. Sponsored by: The FreeBSD Foundation Added: head/etc/rc.d/casperd (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Dec 16 10:50:13 2013 (r259462) +++ head/etc/defaults/rc.conf Mon Dec 16 11:03:59 2013 (r259463) @@ -658,6 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off +casperd_enable="NO" # casperd(8) daemon ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Dec 16 10:50:13 2013 (r259462) +++ head/etc/rc.d/Makefile Mon Dec 16 11:03:59 2013 (r259463) @@ -26,6 +26,7 @@ FILES= DAEMON \ bridge \ bsnmpd \ ${_bthidd} \ + casperd \ ccd \ cleanvar \ cleartmp \ Added: head/etc/rc.d/casperd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/casperd Mon Dec 16 11:03:59 2013 (r259463) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: casperd +# REQUIRE: NETWORKING syslogd +# BEFORE: DAEMON +# KEYWORD: shutdown + +. /etc/rc.subr + +name="casperd" +rcvar="casperd_enable" +pidfile="/var/run/${name}.pid" +command="/sbin/${name}" + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 12:20:20 2013 Return-Path: Delivered-To: svn-src-all@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 50FFF1A4; Mon, 16 Dec 2013 12:20:20 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1C641ABD; Mon, 16 Dec 2013 12:20:19 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBGCK9Ig035890; Mon, 16 Dec 2013 14:20:09 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBGCK9Ig035890 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBGCK9F0035889; Mon, 16 Dec 2013 14:20:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Dec 2013 14:20:09 +0200 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r259422 - head/sys/conf Message-ID: <20131216122009.GR59496@kib.kiev.ua> References: <201312151813.rBFIDhgW024562@svn.freebsd.org> <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jLvNI2QOEej4S1S5" Content-Disposition: inline In-Reply-To: <3C4952C0-C198-499F-828A-F3F67A72FA74@felyko.com> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 12:20:20 -0000 --jLvNI2QOEej4S1S5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 15, 2013 at 10:33:47AM -0800, Rui Paulo wrote: > On 15 Dec 2013, at 10:13, Konstantin Belousov wrote: >=20 > > Author: kib > > Date: Sun Dec 15 18:13:42 2013 > > New Revision: 259422 > > URL: http://svnweb.freebsd.org/changeset/base/259422 > >=20 > > Log: > > Revert r259045. > >=20 > > It seems that clang miscompiles code related to UDP with -fno-strict-o= verflow. >=20 > Could you please file a bug report if you haven't already? I do not intend to do any further analysis of the issue. --jLvNI2QOEej4S1S5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSru/4AAoJEJDCuSvBvK1BWEQP/1XZk3H8Bqv++FwHoIOIwYs7 X475QgZd7ENEWMNxLuvWa2kccqbuGQVbTxcHGRlWLbTxFuEDEkNxGnEGTo5juim0 ZLjIlLBCrL7c2YPyEHYoYXSH/ghr7t7hOmICkcnQg3dVHy9cDj7Q7/qqP3zKasUQ 5yi4oF3cQNNZDqH2aqcHNagKAMB+2wzubq0ZA1XOejYGiHZgOPhG/2HSDbGHCSgp TdqH35f0OfHmUUU5YTJ9HurJS+9qEzQRic2Kh/TZaxpMzMgjaCa4yjKXMNFzk+4R Gk4+Bdi+8fJHRpctcWmGU2ZYAra1rz/AyWkgRjz8GpXYbs2cHjmCJ8hDpaRzTOTE 8nZ5FL3Y9Ghpu0tHBqyDusJiAHL0T08oJgxiM6F0x2XfNyGSwcPMtxIMm9pWWif1 cGuS1H0UpKONmmerVUvinhxRL31lzvTYyGzxBp8qiUDZQXQ3kDLFCfGm2aX/VIyK Ap0KECaDTib/i6WxV8XhIRdrCLe84ofsdTQpXoFlzrXTC2ySZcyGdVcOvzUfVf2q TyOhPMi3TzCr351J44dS5zCyKSQYCTtyQWzL121I89CsGZfjk4+4eKf6UwSgA0x8 VD/2uaTf4KXYcNcE6q+oe6m9Ovwe/89AypvKqbAsMY3MLOeIoKynt0hTqU9AGOTG /4r3BmSiih7JDhsv3nkh =GdOM -----END PGP SIGNATURE----- --jLvNI2QOEej4S1S5-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 13:32:47 2013 Return-Path: Delivered-To: svn-src-all@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 9EE42583; Mon, 16 Dec 2013 13:32:47 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3E71047; Mon, 16 Dec 2013 13:32:47 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 112137E6A; Mon, 16 Dec 2013 13:32:40 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id E3A191D55; Mon, 16 Dec 2013 14:32:39 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312051650.26379.jhb@freebsd.org> <86a9g5uofn.fsf@nine.des.no> <201312131231.04749.jhb@freebsd.org> Date: Mon, 16 Dec 2013 14:32:39 +0100 In-Reply-To: <201312131231.04749.jhb@freebsd.org> (John Baldwin's message of "Fri, 13 Dec 2013 12:31:04 -0500") Message-ID: <86k3f4kjk8.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 13:32:47 -0000 John Baldwin writes: > Dag-Erling Sm=C3=B8rgrav writes: > > John Baldwin writes: > > > LINT64 is yet another kernel config covered by 'make tinderbox', > > > but not by the periodic tinderbox. It is probably worth adding to > > > the periodic tinderbox (someday it'd be nice if the two > > > tinderboxes built the same set of things). > > Some day it would be nice if people talked to me directly instead of > > sniping from the sidelines. > Ah, but when people have raised this exact issue before (that tcbuild > and 'make tinderbox' build different things), you have blown them off > repeatedly. I have no idea what tcbuild is. I blow people off when they complain that the tinderbox doesn't work exactly like 'make tinderbox' because it's not intended to. > > Oh, and 'make tinderbox' should die. > No, it is very developer friendly as it Just Works(tm) as a single > command from an existing source tree checkout. We already had 'make universe'. The story behind 'make tinderbox' is that Alfred threw a fit over a tinderbox breakage and insisted, despite being provided with ample proof to the contrary, that my tinderbox was a black box which nobody knew how worked and nobody could reproduce and that tinderbox reports were therefore worthless. He then proceeded to implement 'make tinderbox' purely to piss me off. It serves no other purpose and needs to die. > It also happens to build more of the tree than the periodic tinderbox > (by building more kernel configs, albeit doing quite a bit of > duplicate work for platforms like arm in the process). That's simply not true. The tinderbox builds exactly the same kernels as 'make tinderbox' if they're present. The issue here is that a bug in the source tree prevents some of these kernel configurations from being generated, hence the tinderbox cannot build them. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 13:52:19 2013 Return-Path: Delivered-To: svn-src-all@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 66CA1B4A; Mon, 16 Dec 2013 13:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5317211B4; Mon, 16 Dec 2013 13:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGDqJHk057197; Mon, 16 Dec 2013 13:52:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGDqJkX057196; Mon, 16 Dec 2013 13:52:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312161352.rBGDqJkX057196@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Dec 2013 13:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259464 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 13:52:19 -0000 Author: mav Date: Mon Dec 16 13:52:18 2013 New Revision: 259464 URL: http://svnweb.freebsd.org/changeset/base/259464 Log: Fix periodic per-CPU timers startup on boot. Reported by: neel MFC after: 2 weeks Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon Dec 16 11:03:59 2013 (r259463) +++ head/sys/kern/kern_clocksource.c Mon Dec 16 13:52:18 2013 (r259464) @@ -233,7 +233,8 @@ handleevents(sbintime_t now, int fake) if (!busy) { state->idle = 0; state->nextevent = t; - loadtimer(now, 0); + loadtimer(now, (fake == 2) && + (timer->et_flags & ET_FLAGS_PERCPU)); } ET_HW_UNLOCK(state); return (done); From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 15:00:06 2013 Return-Path: Delivered-To: svn-src-all@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 BAFAD345; Mon, 16 Dec 2013 15:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A652716B5; Mon, 16 Dec 2013 15:00:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGF06F0081601; Mon, 16 Dec 2013 15:00:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGF0645081600; Mon, 16 Dec 2013 15:00:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312161500.rBGF0645081600@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 Dec 2013 15:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259465 - 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 15:00:06 -0000 Author: nwhitehorn Date: Mon Dec 16 15:00:06 2013 New Revision: 259465 URL: http://svnweb.freebsd.org/changeset/base/259465 Log: MFC r258819,258928: Add new sysctl, kern.supported_archs, containing the list of FreeBSD MACHINE_ARCH values whose binaries this kernel can run. This patch provides a feature requested for implementing pkgng ABI identifiers in a robust way. The list is designed to indicate whether, say, an i386 package can be run on the current system. If kern.supported_abis contains "i386", then the answer is yes. Otherwise, the answer is no. At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we gain support for more interesting combinations, this needs to become more flexible, possibily through the sysent framework, along with the hw.machine_arch emulation immediately preceding this code in kern_mib.c. Reviewed by: imp Modified: stable/10/sys/kern/kern_mib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_mib.c ============================================================================== --- stable/10/sys/kern/kern_mib.c Mon Dec 16 13:52:18 2013 (r259464) +++ stable/10/sys/kern/kern_mib.c Mon Dec 16 15:00:06 2013 (r259465) @@ -261,6 +261,13 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "Supported architectures for binaries"); +#else + MACHINE_ARCH, 0, "Supported architectures for binaries"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 15:02:11 2013 Return-Path: Delivered-To: svn-src-all@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 233974DE; Mon, 16 Dec 2013 15:02:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0541716; Mon, 16 Dec 2013 15:02:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGF2Av1083893; Mon, 16 Dec 2013 15:02:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGF2AHE083892; Mon, 16 Dec 2013 15:02:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312161502.rBGF2AHE083892@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 Dec 2013 15:02:10 +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: r259466 - 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 15:02:11 -0000 Author: nwhitehorn Date: Mon Dec 16 15:02:10 2013 New Revision: 259466 URL: http://svnweb.freebsd.org/changeset/base/259466 Log: MFC r258819,258928: Add new sysctl, kern.supported_archs, containing the list of FreeBSD MACHINE_ARCH values whose binaries this kernel can run. This patch provides a feature requested for implementing pkgng ABI identifiers in a robust way. The list is designed to indicate whether, say, an i386 package can be run on the current system. If kern.supported_abis contains "i386", then the answer is yes. Otherwise, the answer is no. At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we gain support for more interesting combinations, this needs to become more flexible, possibily through the sysent framework, along with the hw.machine_arch emulation immediately preceding this code in kern_mib.c. Reviewed by: imp Modified: stable/9/sys/kern/kern_mib.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_mib.c ============================================================================== --- stable/9/sys/kern/kern_mib.c Mon Dec 16 15:00:06 2013 (r259465) +++ stable/9/sys/kern/kern_mib.c Mon Dec 16 15:02:10 2013 (r259466) @@ -261,6 +261,13 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "Supported architectures for binaries"); +#else + MACHINE_ARCH, 0, "Supported architectures for binaries"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 15:08:30 2013 Return-Path: Delivered-To: svn-src-all@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 C95CA6D6; Mon, 16 Dec 2013 15:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4383175A; Mon, 16 Dec 2013 15:08:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGF8UUQ084600; Mon, 16 Dec 2013 15:08:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGF8U6L084599; Mon, 16 Dec 2013 15:08:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312161508.rBGF8U6L084599@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 Dec 2013 15:08:30 +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: r259467 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 15:08:30 -0000 Author: nwhitehorn Date: Mon Dec 16 15:08:30 2013 New Revision: 259467 URL: http://svnweb.freebsd.org/changeset/base/259467 Log: MFC r258819,258928: Add new sysctl, kern.supported_archs, containing the list of FreeBSD MACHINE_ARCH values whose binaries this kernel can run. This patch provides a feature requested for implementing pkgng ABI identifiers in a robust way. The list is designed to indicate whether, say, an i386 package can be run on the current system. If kern.supported_abis contains "i386", then the answer is yes. Otherwise, the answer is no. At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we gain support for more interesting combinations, this needs to become more flexible, possibily through the sysent framework, along with the hw.machine_arch emulation immediately preceding this code in kern_mib.c. Reviewed by: imp Modified: stable/8/sys/kern/kern_mib.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_mib.c ============================================================================== --- stable/8/sys/kern/kern_mib.c Mon Dec 16 15:02:10 2013 (r259466) +++ stable/8/sys/kern/kern_mib.c Mon Dec 16 15:08:30 2013 (r259467) @@ -261,6 +261,13 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "Supported architectures for binaries"); +#else + MACHINE_ARCH, 0, "Supported architectures for binaries"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 15:51:00 2013 Return-Path: Delivered-To: svn-src-all@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 105B2737; Mon, 16 Dec 2013 15:51:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0C621B4F; Mon, 16 Dec 2013 15:50:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGFoxf3001345; Mon, 16 Dec 2013 15:50:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGFox0N001344; Mon, 16 Dec 2013 15:50:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161550.rBGFox0N001344@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 15:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 15:51:00 -0000 Author: dteske Date: Mon Dec 16 15:50:59 2013 New Revision: 259468 URL: http://svnweb.freebsd.org/changeset/base/259468 Log: Add a fix for Long-standing problem with VMware. Described in below links: https://communities.vmware.com/thread/107230 https://communities.vmware.com/docs/DOC-11677 Basically, ignore the ``function 62'' and ``function 63'' interpretations of the left/right command key when we're in the lengthiest portion of the installation (initiated by the `auto' module). The net effect is that you can now (once you've started the installer from the media) escape the VM without prematurely terminating the current action due to spurious escape sequence. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 2013 (r259467) +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 2013 (r259468) @@ -49,6 +49,10 @@ error() { ############################################################ MAIN +# Don't send ESC on function-key 62/63 (left/right command key) +f_quietly kbdcontrol -f 62 '' +f_quietly kbdcontrol -f 63 '' + f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 15:52:45 2013 Return-Path: Delivered-To: svn-src-all@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 5F49D96E; Mon, 16 Dec 2013 15:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC771C92; Mon, 16 Dec 2013 15:52:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGFqjJl001579; Mon, 16 Dec 2013 15:52:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGFqjrO001578; Mon, 16 Dec 2013 15:52:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161552.rBGFqjrO001578@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 15:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259469 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 15:52:45 -0000 Author: dteske Date: Mon Dec 16 15:52:44 2013 New Revision: 259469 URL: http://svnweb.freebsd.org/changeset/base/259469 Log: Mask error from newaliases(1) when the hostname is not fully qualified. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Mon Dec 16 15:50:59 2013 (r259468) +++ head/usr.sbin/bsdinstall/scripts/config Mon Dec 16 15:52:44 2013 (r259469) @@ -42,7 +42,7 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHR [ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/ # Set up other things from installed config -chroot $BSDINSTALL_CHROOT /usr/bin/newaliases +chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 ################################################################################ # END From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 16:06:34 2013 Return-Path: Delivered-To: svn-src-all@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 CCE35E7E; Mon, 16 Dec 2013 16:06:34 +0000 (UTC) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 991C61D89; Mon, 16 Dec 2013 16:06:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MXW00900PYUTA00@smtpauth4.wiscmail.wisc.edu>; Mon, 16 Dec 2013 10:06:27 -0600 (CST) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.16.155715, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MXW0089IQ2QVA00@smtpauth4.wiscmail.wisc.edu>; Mon, 16 Dec 2013 10:06:27 -0600 (CST) Message-id: <52AF2502.1060503@freebsd.org> Date: Mon, 16 Dec 2013 10:06:26 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> In-reply-to: <201312161550.rBGFox0N001344@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 16:06:34 -0000 Please add this to release/rc.local instead under the console setup. There is no guarantee that "auto" is running from an environment where this is defined -- for example, it may be running from a serial console or an xterm -- and the actual installer should not be polluted with assumptions about the media from which it runs. -Nathan On 12/16/13 09:50, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 15:50:59 2013 > New Revision: 259468 > URL: http://svnweb.freebsd.org/changeset/base/259468 > > Log: > Add a fix for Long-standing problem with VMware. Described in below links: > https://communities.vmware.com/thread/107230 > https://communities.vmware.com/docs/DOC-11677 > > Basically, ignore the ``function 62'' and ``function 63'' interpretations > of the left/right command key when we're in the lengthiest portion of the > installation (initiated by the `auto' module). > > The net effect is that you can now (once you've started the installer from > the media) escape the VM without prematurely terminating the current action > due to spurious escape sequence. > > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/scripts/auto > > Modified: head/usr.sbin/bsdinstall/scripts/auto > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 2013 (r259467) > +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 2013 (r259468) > @@ -49,6 +49,10 @@ error() { > > ############################################################ MAIN > > +# Don't send ESC on function-key 62/63 (left/right command key) > +f_quietly kbdcontrol -f 62 '' > +f_quietly kbdcontrol -f 63 '' > + > f_dprintf "Began Installation at %s" "$( date )" > > rm -rf $BSDINSTALL_TMPETC From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 16:53:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB8D11FF; Mon, 16 Dec 2013 16:53:28 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 5CC49435B; Mon, 16 Dec 2013 16:53:27 +0000 (UTC) Message-ID: <52AF3001.2000208@FreeBSD.org> Date: Mon, 16 Dec 2013 20:53:21 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Oleg Bulyzhin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r258346 - stable/10/sys/dev/ixgbe References: <201311191424.rAJEOQ8U037410@svn.freebsd.org> In-Reply-To: <201311191424.rAJEOQ8U037410@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 16:53:28 -0000 On 19.11.2013 18:24, Oleg Bulyzhin wrote: > Author: oleg > Date: Tue Nov 19 14:24:25 2013 > New Revision: 258346 > URL: http://svnweb.freebsd.org/changeset/base/258346 > > Log: > MFC: 257695 > > - Fix link loss on vlan reconfiguration. > - Fix issues with 'vlanhwfilter'. Hi, Oleg, do you plan to merge this in stable/9 too? -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 17:03:45 2013 Return-Path: Delivered-To: svn-src-all@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 6C7E06C6; Mon, 16 Dec 2013 17:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5870F1352; Mon, 16 Dec 2013 17:03:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGH3jLk026245; Mon, 16 Dec 2013 17:03:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGH3jGV026244; Mon, 16 Dec 2013 17:03:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161703.rBGH3jGV026244@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 17:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259470 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 17:03:45 -0000 Author: dteske Date: Mon Dec 16 17:03:44 2013 New Revision: 259470 URL: http://svnweb.freebsd.org/changeset/base/259470 Log: As per discussions on -current, re-add /var/mail (removed in r257842) but this time with atime=on in support of various software that requires it. Discussed on: -current MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 15:52:44 2013 (r259469) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:03:44 2013 (r259470) @@ -132,6 +132,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /var mountpoint=/var /var/crash compression=lz4,exec=off,setuid=off /var/log compression=lz4,exec=off,setuid=off + /var/mail compression=lz4,atime=on /var/tmp compression=lz4,exec=on,setuid=off " # END-QUOTE From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 17:05:03 2013 Return-Path: Delivered-To: svn-src-all@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 D1905839; Mon, 16 Dec 2013 17:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDD531362; Mon, 16 Dec 2013 17:05:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGH53BJ026443; Mon, 16 Dec 2013 17:05:03 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGH53e2026442; Mon, 16 Dec 2013 17:05:03 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312161705.rBGH53e2026442@svn.freebsd.org> From: Bryan Drewery Date: Mon, 16 Dec 2013 17:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259471 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 17:05:03 -0000 Author: bdrewery Date: Mon Dec 16 17:05:03 2013 New Revision: 259471 URL: http://svnweb.freebsd.org/changeset/base/259471 Log: Add myself to the src-committers list Approved by: bapt (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Dec 16 17:03:44 2013 (r259470) +++ head/share/misc/committers-src.dot Mon Dec 16 17:05:03 2013 (r259471) @@ -114,6 +114,7 @@ art [label="Artem Belevich\nart@FreeBSD. asomers [label="Alan Somers\nasomers@FreeBSD.org\n2013/04/24"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] +bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] @@ -331,6 +332,8 @@ avg -> art avg -> pluknet avg -> smh +bapt -> bdrewery + benno -> grehan billf -> dougb From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 17:11:09 2013 Return-Path: Delivered-To: svn-src-all@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 AFCDAA4C; Mon, 16 Dec 2013 17:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1B113DB; Mon, 16 Dec 2013 17:11:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGHB9Mo029657; Mon, 16 Dec 2013 17:11:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGHB9TN029656; Mon, 16 Dec 2013 17:11:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161711.rBGHB9TN029656@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259472 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 17:11:09 -0000 Author: dteske Date: Mon Dec 16 17:11:09 2013 New Revision: 259472 URL: http://svnweb.freebsd.org/changeset/base/259472 Log: Accept NULL input as also meaning zero swap. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:05:03 2013 (r259471) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 17:11:09 2013 (r259472) @@ -1387,7 +1387,7 @@ while :; do f_dialog_input input \ "$msg_please_enter_amount_of_swap_space" \ "$ZFSBOOT_SWAP_SIZE" && - ZFSBOOT_SWAP_SIZE="$input" + ZFSBOOT_SWAP_SIZE="${input:-0}" ;; esac done From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 18:45:24 2013 Return-Path: Delivered-To: svn-src-all@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 0F6527E6; Mon, 16 Dec 2013 18:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED11C1E9B; Mon, 16 Dec 2013 18:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGIjNBr065612; Mon, 16 Dec 2013 18:45:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGIjLeF065600; Mon, 16 Dec 2013 18:45:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312161845.rBGIjLeF065600@svn.freebsd.org> From: Dimitry Andric Date: Mon, 16 Dec 2013 18:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259473 - in head: lib/clang lib/clang/include lib/clang/include/llvm/Config lib/clang/libllvmpowerpcasmparser usr.bin/clang/clang usr.bin/clang/llc usr.bin/clang/lldb usr.bin/clang/llv... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 18:45:24 -0000 Author: dim Date: Mon Dec 16 18:45:21 2013 New Revision: 259473 URL: http://svnweb.freebsd.org/changeset/base/259473 Log: Enable llvm's integrated assembler for PowerPC, since it should now be good enough for typical usage. Requested by: rdivacky MFC after: 1 week Added: head/lib/clang/include/PPCGenAsmMatcher.inc (contents, props changed) head/lib/clang/libllvmpowerpcasmparser/ head/lib/clang/libllvmpowerpcasmparser/Makefile (contents, props changed) Modified: head/lib/clang/Makefile head/lib/clang/include/llvm/Config/AsmParsers.def head/usr.bin/clang/clang/Makefile head/usr.bin/clang/llc/Makefile head/usr.bin/clang/lldb/Makefile head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/lib/clang/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -74,6 +74,7 @@ SUBDIR= libclanganalysis \ libllvmmipsdisassembler \ libllvmmipsinfo \ libllvmmipsinstprinter \ + libllvmpowerpcasmparser \ libllvmpowerpccodegen \ libllvmpowerpcdesc \ libllvmpowerpcinfo \ Added: head/lib/clang/include/PPCGenAsmMatcher.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/include/PPCGenAsmMatcher.inc Mon Dec 16 18:45:21 2013 (r259473) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +#include "PPCGenAsmMatcher.inc.h" Modified: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmParsers.def Mon Dec 16 17:11:09 2013 (r259472) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Mon Dec 16 18:45:21 2013 (r259473) @@ -2,6 +2,7 @@ LLVM_ASM_PARSER(ARM) LLVM_ASM_PARSER(Mips) +LLVM_ASM_PARSER(PowerPC) LLVM_ASM_PARSER(X86) #undef LLVM_ASM_PARSER Added: head/lib/clang/libllvmpowerpcasmparser/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmpowerpcasmparser/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +LIB= llvmpowerpcasmparser + +SRCDIR= lib/Target/PowerPC/AsmParser +INCDIR= lib/Target/PowerPC +SRCS= PPCAsmParser.cpp + +TGHDRS= PPCGenAsmMatcher \ + PPCGenInstrInfo \ + PPCGenRegisterInfo \ + PPCGenSubtargetInfo + +.include "../clang.lib.mk" Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/clang/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -85,8 +85,9 @@ LIBDEPS=clangfrontendtool \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llc/Makefile ============================================================================== --- head/usr.bin/clang/llc/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llc/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -24,8 +24,9 @@ LIBDEPS=llvmirreader \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/lldb/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -106,6 +106,7 @@ LIBDEPS=\ llvmmipsinstprinter \ llvmpowerpcdesc \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ llvmruntimedyld \ llvmvectorize \ llvmx86desc \ Modified: head/usr.bin/clang/llvm-mc/Makefile ============================================================================== --- head/usr.bin/clang/llvm-mc/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-mc/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -24,8 +24,9 @@ LIBDEPS=llvmmcdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llvm-objdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-objdump/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-objdump/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -30,8 +30,9 @@ LIBDEPS=llvmmcdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/llvm-rtdyld/Makefile ============================================================================== --- head/usr.bin/clang/llvm-rtdyld/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/llvm-rtdyld/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -28,8 +28,9 @@ LIBDEPS=llvmdebuginfo \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ Modified: head/usr.bin/clang/opt/Makefile ============================================================================== --- head/usr.bin/clang/opt/Makefile Mon Dec 16 17:11:09 2013 (r259472) +++ head/usr.bin/clang/opt/Makefile Mon Dec 16 18:45:21 2013 (r259473) @@ -25,8 +25,9 @@ LIBDEPS=llvmarmdisassembler \ llvmmipsinstprinter \ llvmpowerpccodegen \ llvmpowerpcdesc \ - llvmpowerpcinfo \ llvmpowerpcinstprinter \ + llvmpowerpcasmparser \ + llvmpowerpcinfo \ llvmx86disassembler \ llvmx86asmparser \ llvmx86codegen \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 18:53:10 2013 Return-Path: Delivered-To: svn-src-all@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 37316DB6; Mon, 16 Dec 2013 18:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22FC91F58; Mon, 16 Dec 2013 18:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGIrA2e068804; Mon, 16 Dec 2013 18:53:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGIrAvu068803; Mon, 16 Dec 2013 18:53:10 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161853.rBGIrAvu068803@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 18:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259474 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 18:53:10 -0000 Author: dteske Date: Mon Dec 16 18:53:09 2013 New Revision: 259474 URL: http://svnweb.freebsd.org/changeset/base/259474 Log: Bug-fixes and debugging improvments: + De-obfuscate debugging to show actual values + Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax] + Log commands that were previously quiet + Added some new comemnts and updated some existing ones + Add missing local for `disk' used in zfs_create_boot() + Use $disks instead of multiply-expanding $* in zfs_create_boot() + Pedantically unset variable holding geli(8) passphrase after use + Pedantically add double-quotes around zpool names and zfs datasets + Fix quotation expansion for zpool_cache entries of loader.conf(5) + Some limited whitespace changes MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 18:45:21 2013 (r259473) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 18:53:09 2013 (r259474) @@ -156,8 +156,10 @@ CHMOD_MODE='chmod %s "%s"' DD_WITH_OPTIONS='dd if="%s" of="%s" %s' ECHO_APPEND='echo "%s" >> "%s"' GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_DETACH_F='geli detach -f "%s"' GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' GNOP_CREATE='gnop create -S 4096 "%s"' +GNOP_DESTROY='gnop destroy "%s"' GPART_ADD='gpart add -t %s "%s"' GPART_ADD_INDEX='gpart add -i %s -t %s "%s"' GPART_ADD_INDEX_WITH_SIZE='gpart add -i %s -t %s -s %s "%s"' @@ -166,19 +168,23 @@ GPART_ADD_LABEL_WITH_SIZE='gpart add -l GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' +GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' +GRAID_DELETE='graid delete "%s"' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' +ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' ZPOOL_SET='zpool set %s "%s"' # @@ -612,6 +618,8 @@ dialog_menu_layout() # replacement drivers do not have the exact same sector counts. # # NOTE: The MBR layout is more complicated (GPT is preferred). +# NOTE: $swapsize and $gelisize should be defined by the calling function. +# NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { @@ -664,13 +672,13 @@ zfs_create_diskpart() # NOTE: Failure is ok here, blank disk will have nothing to destroy. # f_dprintf "$funcname: Destroying all data/layouts on \`%s'..." "$disk" - f_quietly gpart destroy -F $disk - f_quietly graid destroy $disk - f_quietly zpool labelclear -f /dev/$disk # Kill it with fire + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk + f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" /dev/$disk # Make doubly-sure backup GPT is destroyed - f_quietly gpart create -s gpt $disk - f_quietly gpart destroy -F $disk + f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk # Calculate partition size given desired amount of swap f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" @@ -694,36 +702,35 @@ zfs_create_diskpart() # # 1. Create GPT layout using labels # - f_eval_catch $funcname gpart "$GPART_CREATE" gpt \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" gpt $disk || return $FAILURE # # 2. Add small freebsd-boot partition labeled `boot#' # f_eval_catch $funcname gpart "$GPART_ADD_LABEL_WITH_SIZE" \ - gptboot\$index freebsd-boot 512k \$disk || + gptboot$index freebsd-boot 512k $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 \$disk || + /boot/pmbr /boot/gptzfsboot 1 $disk || return $FAILURE - # zpool will use the `zfs#' GPT labels + # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 # Change things around if we are using geli(8) if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then bootpart=p2 targetpart=p3 partsize=$(( $partsize - $gelisize )) - f_dprintf "$funcname: gelisize=[%s]" \ - "gelisize=[$gelisize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" boot\$index \ - freebsd-zfs \${gelisize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ + freebsd-zfs ${gelisize}b $disk || return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + f_eval_catch -d $funcname geli "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # @@ -731,30 +738,29 @@ zfs_create_diskpart() # NOTE: Using above calculated partsize to leave room for swap. # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: partsize=[%s]" \ - "partsize=[$partsize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs\$index \ - freebsd-zfs \${partsize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" zfs$index \ + freebsd-zfs ${partsize}b $disk || return $FAILURE else f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs\$index freebsd-zfs \$disk || + zfs$index freebsd-zfs $disk || return $FAILURE fi - f_quietly zpool labelclear -f "/dev/$disk$targetpart" + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # # 4. Add freebsd-swap partition labeled `swap#' # if [ $swapsize -gt 0 ]; then f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap\$index freebsd-swap \$disk || + swap$index freebsd-swap $disk || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap\$index none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/gpt/swap$index none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi ;; @@ -763,25 +769,28 @@ zfs_create_diskpart() # # 1. Create MBR layout (no labels) # - f_eval_catch $funcname gpart "$GPART_CREATE" mbr \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" mbr $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE" /boot/mbr \ - \$disk || return $FAILURE + $disk || return $FAILURE # # 2. Add freebsd slice with all available space # - f_eval_catch $funcname gpart "$GPART_ADD" freebsd \$disk || + f_eval_catch $funcname gpart "$GPART_ADD" freebsd $disk || return $FAILURE - f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 \$disk || + f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 $disk || return $FAILURE - f_quietly zpool labelclear -f /dev/${disk}s1 # Pedantic - f_quietly gpart destroy -F ${disk}s1 # Pedantic + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1 + # Pedantically nuke any old scheme + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" ${disk}s1 # # 3. Write BSD scheme to the freebsd slice # - f_eval_catch $funcname gpart "$GPART_CREATE" BSD \${disk}s1 || + f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE # zpool will use s1a (no labels) @@ -792,15 +801,17 @@ zfs_create_diskpart() bootpart=s1a targetpart=s1d partsize=$(( $partsize - $gelisize )) mbrindex=4 # If this is s1a then make the zpool s1d - f_dprintf "$funcname: mbrindex=[%s] gelisize=[%s]" \ - "$mbrindex" "$gelisize" f_eval_catch $funcname gpart \ "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs \${gelisize}b \${disk}s1 || + 1 freebsd-zfs ${gelisize}b ${disk}s1 || return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # @@ -808,19 +819,17 @@ zfs_create_diskpart() # NOTE: Using above calculated partsize to leave room for swap. # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: mbrindex=[%s] partsize=[%s]" \ - "$mbrindex" "$partsize" f_eval_catch $funcname gpart \ "$GPART_ADD_INDEX_WITH_SIZE" \ - \$mbrindex freebsd-zfs \${partsize}b \ - \${disk}s1 || return $FAILURE + $mbrindex freebsd-zfs ${partsize}b \ + ${disk}s1 || return $FAILURE else - f_dprintf "$funcname: mbrindex=[%s]" "$mbrindex" f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - \$mbrindex freebsd-zfs \${disk}s1 || + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE fi - f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic # # 5. Add freebsd-swap partition @@ -831,8 +840,8 @@ zfs_create_diskpart() return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/\${disk}s1b none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/${disk}s1b none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi ;; @@ -852,13 +861,13 @@ zfs_create_boot() local funcname=zfs_create_boot local poolname="$1" vdev_type="$2" local bootpart targetpart + shift 2 # poolname vdev_type + local disks="$*" disk + local bootpart targetpart # Set by zfs_create_diskpart() below - shift 2 # name vdev_type - - # We may need this later - local disks="$*" - + # # Pedantic checks; should never be seen + # if [ ! "$poolname" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ @@ -874,16 +883,19 @@ zfs_create_boot() f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ "$poolname" "$vdev_type" + # # Initialize fstab(5) + # f_dprintf "$funcname: Initializing temporary fstab(5) file..." - f_eval_catch $funcname sh \ - "$SHELL_TRUNCATE" \$BSDINSTALL_TMPETC/fstab || + f_eval_catch $funcname sh "$SHELL_TRUNCATE" $BSDINSTALL_TMPETC/fstab || return $FAILURE f_eval_catch $funcname printf "$PRINTF_FSTAB" \ "# Device" Mountpoint FStype Options Dump "Pass#" \ - \$BSDINSTALL_TMPETC/fstab || return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE + # # Expand SI units in desired sizes + # f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." local swapsize gelisize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then @@ -904,23 +916,24 @@ zfs_create_boot() f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + # # Prepare the disks + # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." local n=0 - for disk in $*; do + for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE n=$(( $n + 1 )) done + # Now $bootpart and $targetpart are set (suffix for $disk) # MBR boot loader hack part 1 # We have to do this early because geli gets in the way later if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Copying MBR boot loader to disks..." - f_dprintf "$funcname: disks=[%s]" "$disks" for disk in $disks; do - f_dprintf "$funcname: disk=[%s]" "$disk" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\${disk}s1 count=1 || + /boot/zfsboot /dev/${disk}s1 count=1 || return $FAILURE done fi @@ -935,12 +948,9 @@ zfs_create_boot() [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - f_dprintf "$funcname: *=[%s]" "$*" - for disk in $*; do - f_dprintf "$funcname: disk=[%s] part=[%s]" \ - "$disk" "$part" + for disk in $disks; do f_eval_catch $funcname gnop "$GNOP_CREATE" \ - \$disk\$part || return $FAILURE + $disk$part || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then unenc_list="$unenc_list $disk$part.nop" else @@ -950,7 +960,7 @@ zfs_create_boot() set -- $new_list else local new_list= - for disk in $*; do + for disk in $disks; do new_list="$new_list $disk$targetpart" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && unenc_list="$unenc_list $disk$bootpart" @@ -969,34 +979,30 @@ zfs_create_boot() f_dprintf "$funcname: Setting up disk encryption..." # Create the parent directories for our unencrypted pool - f_quietly umount /mnt + f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ - \$BSDINSTALL_CHROOT || return $FAILURE + $BSDINSTALL_CHROOT || return $FAILURE # Create mirror across the unencrypted partition on all disks [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror - f_dprintf "$funcname: %s %s %s" \ - "ZFSBOOT_GELI_POOL_NAME=[$ZFSBOOT_GELI_POOL_NAME]" \ - "bootvdev=[$bootvdev]" "unenc_list=[$unenc_list]" - options="-o altroot=\"\$BSDINSTALL_CHROOT\"" - options="$options -m \"/\$ZFSBOOT_GELI_POOL_NAME\"" - options="$options -f" + options="-o altroot=$BSDINSTALL_CHROOT" + options="$options -m \"/$ZFSBOOT_GELI_POOL_NAME\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" \$ZFSBOOT_GELI_POOL_NAME \$bootvdev \ + "$options" "$ZFSBOOT_GELI_POOL_NAME" $bootvdev \ \$unenc_list || return $FAILURE - f_dprintf "$funcname: geli_pool=[%s]" "$geli_pool" - f_eval_catch $funcname mkdir "$MKDIR_P" \$geli_pool/boot || + f_eval_catch $funcname mkdir "$MKDIR_P" $geli_pool/boot || return $FAILURE # Generate an encryption key using random(4) - f_dprintf "$funcname: key=[%s]" "$key" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random \$geli_pool/\$key "bs=4096 count=1" || + /dev/random $geli_pool/$key "bs=4096 count=1" || return $FAILURE + # # Create the geli(8) GEOMS + # local geli_list if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password @@ -1005,53 +1011,55 @@ zfs_create_boot() f_show_err "$msg_user_cancelled" return $FAILURE fi - f_dprintf "$funcname: disks=[%s]" "$disks" + + # Initialize geli(8) on each of the target partitions for disk in $disks; do - f_dprintf "$funcname: disk=[%s] targetpart=[%s]" \ - "$disk" "$targetpart" f_dialog_info "$msg_geli_setup" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_PASSWORD_INIT" \ - \$geli_pool/boot/\$disk\$targetpart.eli \ - AES-XTS \$geli_pool/\$key \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_PASSWORD_INIT" \ + "$geli_pool/boot/$disk$targetpart.eli" \ + AES-XTS "$geli_pool/$key" \ + $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_ATTACH" \$geli_pool/\$key \ - \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH" \ + "$geli_pool/\$key" $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi geli_list="$geli_list $disk$targetpart.eli" done + unset pw_password # Sensitive info set -- $geli_list + + # Clean up f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE - f_quietly umount /mnt # done with tmpfs + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # - # Create the ZFS pool with desired type and disk devices + # Create the ZFS root pool with desired type and disk devices # local vdevs="$*" f_dprintf "$funcname: Creating boot pool..." - f_dprintf "poolname=[%s] vdev_type=[%s] vdevs=[%s]" \ - "$poolname" "$vdev_type" "$vdevs" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\" -m none -f" \ - \$poolname \$vdev_type \$vdevs + "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + $poolname $vdev_type $vdevs # Customize the zpool a bit... local option f_dprintf "$funcname: Setting miscellaneous options on boot pool..." for option in checksum=fletcher4 atime=off; do - f_dprintf "$funcname: option=[%s]" "$option" - f_eval_catch $funcname zfs "$ZFS_SET" \$option \$poolname || - return $FAILURE + f_eval_catch $funcname zfs "$ZFS_SET" $option "$poolname" || + return $FAILURE done # @@ -1074,10 +1082,8 @@ zfs_create_boot() # Replace both commas and spaces with ` -o ' f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options - f_dprintf "$funcname: dataset=[%s] options=[%s]" \ - "$dataset" "$options" f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "\${options:+-o \$options}" \$poolname\$dataset || + "${options:+-o $options}" "$poolname$dataset" || return $FAILURE done @@ -1085,57 +1091,52 @@ zfs_create_boot() f_dprintf "$funcname: Modifying directory permissions..." local dir for dir in /tmp /var/tmp; do - f_dprintf "$funcname: dir=[%s]" "$dir" f_eval_catch $funcname chmod "$CHMOD_MODE" 1777 \ - \$BSDINSTALL_CHROOTDIR\$dir || return $FAILURE + $BSDINSTALL_CHROOTDIR$dir || return $FAILURE done # Create symlink(s) if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_dprintf "$funcname: Creating /boot symlink for GELI..." f_eval_catch $funcname ln "$LN_SF" \ - \$ZFSBOOT_GELI_POOL_NAME/boot \ - \$BSDINSTALL_CHROOT/boot || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME/boot" \ + $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property f_dprintf "$funcname: Setting bootfs property..." - f_dprintf "$funcname: %s %s" \ - "ZFSBOOT_BEROOT_NAME=[$ZFSBOOT_BEROOT_NAME]" \ - "ZFSBOOT_BOOTFS_NAME=[$ZFSBOOT_BOOTFS_NAME]" f_eval_catch $funcname zpool "$ZPOOL_SET" \ - bootfs=\"\$poolname/\$ZFSBOOT_BEROOT_NAME/\$ZFSBOOT_BOOTFS_NAME\" \ - \$poolname || return $FAILURE + "bootfs=\"$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ + "$poolname" || return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \$poolname || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$poolname" || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_quietly gnop destroy $disk$bootpart.nop + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$bootpart.nop else - f_quietly gnop destroy $disk$targetpart.nop + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$targetpart.nop fi done # MBR boot loader hack part 2 if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." - f_dprintf "$funcname: disks=[%s]" # Stick the ZFS boot loader in the "convienient hole" after # the ZFS internal metadata for disk in $disks; do - f_dprintf "$funcname: disk=[%s] bootpart=[%s]" \ - "$disk" "$bootpart" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\$disk\$bootpart \ + /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done fi @@ -1143,42 +1144,42 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \$poolname || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$poolname" || return $FAILURE if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR f_dprintf "$funcname: Configuring zpool.cache..." - f_eval_catch $funcname mkdir "$MKDIR_P" \$BSDINSTALL_CHROOT/boot/zfs || + f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ - cachefile=\"\$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\" \ - \$poolname || return $FAILURE + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$poolname" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ "$funcname" f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_enable=\"YES\"' \ - \$BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE + $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE # We're all done unless we should go on to do encryption [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # Some additional geli(8) requirements for loader.conf(5) for option in \ - zpool_cache_load=\"YES\" \ - zpool_cache_type=\"/boot/zfs/zpool.cache\" \ - zpool_cache_name=\"/boot/zfs/zpool.cache\" \ + 'zpool_cache_load=\"YES\"' \ + 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ + 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ ; do - f_eval_catch $funcname echo "$ECHO_APPEND" \$option \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || + f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done @@ -1187,30 +1188,26 @@ zfs_create_boot() # f_dprintf "$funcname: Configuring disk encryption..." f_eval_catch $funcname echo "$ECHO_APPEND" 'aesni_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - f_dprintf "$funcname: disks=[%s]" "$disks" + "\"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE for disk in $disks; do - f_dprintf "$funcname: %s %s %s" \ - "disk=[$disk]" "targetpart=[$targetpart]" \ - "ZFSBOOT_GELI_KEY_FILE=[$ZFSBOOT_GELI_KEY_FILE]" f_eval_catch $funcname printf "$PRINTF_CONF" \ - geli_%s_keyfile0_load '"$disk$targetpart" YES' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + geli_%s_keyfile0_load "$disk$targetpart YES" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart $disk$targetpart:geli_keyfile0" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_name \ - '"$disk$targetpart" "$ZFSBOOT_GELI_KEY_FILE"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart \"$ZFSBOOT_GELI_KEY_FILE\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE done @@ -1259,7 +1256,7 @@ f_dialog_backtitle "$msg_freebsd_install # f_dprintf "BSDINSTALL_CHROOT=[%s]" "$BSDINSTALL_CHROOT" f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC" -f_dprintf "PRINTF_FSTAB=[%s]" "$PRINTF_FSTAB" +f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # # Loop over the main menu until we've accomplished what we came here to do From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:31:24 2013 Return-Path: Delivered-To: svn-src-all@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 8F448B43; Mon, 16 Dec 2013 19:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61C4011FF; Mon, 16 Dec 2013 19:31:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJVOXF083410; Mon, 16 Dec 2013 19:31:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJVOhs083409; Mon, 16 Dec 2013 19:31:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312161931.rBGJVOhs083409@svn.freebsd.org> From: Adrian Chadd Date: Mon, 16 Dec 2013 19:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259475 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:31:24 -0000 Author: adrian Date: Mon Dec 16 19:31:23 2013 New Revision: 259475 URL: http://svnweb.freebsd.org/changeset/base/259475 Log: Migrate the sendfile_sync struct to use a UMA zone rather than M_TEMP. This allows it to be better tracked as well as being able to leverage UMA for more interesting/useful behaviour at a later date. Sponsored by: Netflix, Inc. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 (r259474) +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 (r259475) @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#include +#include +#include #include #include @@ -130,6 +133,7 @@ static int sfreadahead = 1; SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); +static uma_zone_t zone_sfsync; static void sfstat_init(const void *unused) @@ -140,6 +144,22 @@ sfstat_init(const void *unused) } SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); +static void +sf_sync_init(const void *unused) +{ + + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), + NULL, NULL, +#ifdef INVARIANTS + trash_init, trash_fini, +#else + NULL, NULL, +#endif + UMA_ALIGN_CACHE, + 0); +} +SYSINIT(sf_sync, SI_SUB_MBUF, SI_ORDER_FIRST, sf_sync_init, NULL); + static int sfstat_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1898,7 +1918,7 @@ sf_sync_alloc(uint32_t flags) { struct sendfile_sync *sfs; - sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); + sfs = uma_zalloc(zone_sfsync, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); sfs->flags = flags; @@ -1953,7 +1973,7 @@ sf_sync_free(struct sendfile_sync *sfs) KASSERT(sfs->count == 0, ("sendfile sync still busy")); cv_destroy(&sfs->cv); mtx_destroy(&sfs->mtx); - free(sfs, M_TEMP); + uma_zfree(zone_sfsync, sfs); } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:37:15 2013 Return-Path: Delivered-To: svn-src-all@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 E6B7BF23; Mon, 16 Dec 2013 19:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D20BE1262; Mon, 16 Dec 2013 19:37:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJbF2C084151; Mon, 16 Dec 2013 19:37:15 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJbFn9084150; Mon, 16 Dec 2013 19:37:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161937.rBGJbFn9084150@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259476 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:37:16 -0000 Author: dteske Date: Mon Dec 16 19:37:15 2013 New Revision: 259476 URL: http://svnweb.freebsd.org/changeset/base/259476 Log: Improve default ZFS disk layout (tested): + For GPT, always provision zfs# partition after swap [for resizability] + For MBR, always use a boot pool to relialy place root vdevs at EOD NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less) + Generalize boot pool logic so it can be used for any scheme (namely MBR) + Update existing comments and some whitespace fixes + Change some variable names to make reading/debugging the code easier in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property) + Because zroot vdevs are at EOD, no longer need to calculate partsize (vdev consumes remaining space after allocating swap) + Optimize processing of disks -- no reason to loop over the disks 3-4 separate times when we can logically use a single loop to do everything Discussed on: -stable MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:31:23 2013 (r259475) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:37:15 2013 (r259476) @@ -66,23 +66,30 @@ f_include $BSDCFG_SHARE/variable.subr # # Should we use geli(8) to encrypt the drives? +# NB: Automatically enables ZFSBOOT_BOOT_POOL # : ${ZFSBOOT_GELI_ENCRYPTION=} # -# Default name the unencrypted pool when using geli(8) to encrypt the drives +# Default path to the geli(8) keyfile used in drive encryption # -: ${ZFSBOOT_GELI_POOL_NAME:=bootpool} +: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} # -# Default size for the unencrypted boot pool when using geli(8) +# Create a separate boot pool? +# NB: Automatically set when using geli(8) or MBR # -: ${ZFSBOOT_GELI_BOOT_SIZE:=2g} +: ${ZFSBOOT_BOOT_POOL=} # -# Default path to the geli(8) keyfile used in drive encryption +# Default name for boot pool when enabled (e.g., geli(8) or MBR) # -: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} +: ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} + +# +# Default size for boot pool when enabled (e.g., geli(8) or MBR) +# +: ${ZFSBOOT_BOOT_POOL_SIZE:=2g} # # Default disks to use (always empty unless being scripted) @@ -212,8 +219,8 @@ msg_geli_setup="Initializing encryption msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" +msg_invalid_boot_pool_size="Invalid boot pool size \`%s'" msg_invalid_disk_argument="Invalid disk argument \`%s'" -msg_invalid_geli_boot_size="Invalid geli(8) boot size \`%s'" msg_invalid_index_argument="Invalid index argument \`%s'" msg_invalid_swap_size="Invalid swap size \`%s'" msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" @@ -617,15 +624,13 @@ dialog_menu_layout() # so we can have some real swap. This also provides wiggle room incase your # replacement drivers do not have the exact same sector counts. # -# NOTE: The MBR layout is more complicated (GPT is preferred). -# NOTE: $swapsize and $gelisize should be defined by the calling function. +# NOTE: $swapsize and $bootsize should be defined by the calling function. # NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" - local disksize partsize # Check arguments if [ ! "$disk" ]; then @@ -680,18 +685,10 @@ zfs_create_diskpart() f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk - # Calculate partition size given desired amount of swap - f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" - if ! device_$disk get capacity disksize; then - f_dprintf "$funcname: Unable to get disk capacity of \`%s'" \ - "$disk" - msg_error="$msg_error: $funcname" \ - f_show_err "$msg_unable_to_get_disk_capacity" "$disk" - return $FAILURE - fi - partsize=$(( $disksize - $swapsize )) - f_dprintf "$funcname: disksize=[%s] partsize=[%s]" \ - "$disksize" "$partsize" + # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 # # Lay down the desired type of partition scheme @@ -717,45 +714,36 @@ zfs_create_diskpart() # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 + [ ${swapsize:-0} -gt 0 ] && targetpart=p3 - # Change things around if we are using geli(8) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # + # Prepare boot pool if enabled (e.g., for geli(8)) + # + if [ "$ZFSBOOT_BOOT_POOL" ]; then bootpart=p2 targetpart=p3 - partsize=$(( $partsize - $gelisize )) + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ - freebsd-zfs ${gelisize}b $disk || + freebsd-zfs ${bootsize}b $disk || return $FAILURE - # Pedantically nuke any old labels, stop geli + # Pedantically nuke any old labels f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/$disk$bootpart - f_eval_catch -d $funcname geli "$GELI_DETACH_F" \ - /dev/$disk$targetpart + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart + fi fi # - # 3. Add freebsd-zfs partition labeled `zfs#' for zpool - # NOTE: Using above calculated partsize to leave room for swap. + # 3. Add freebsd-swap partition labeled `swap#' # if [ ${swapsize:-0} -gt 0 ]; then f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs$index \ - freebsd-zfs ${partsize}b $disk || - return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs$index freebsd-zfs $disk || - return $FAILURE - fi - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$targetpart - - # - # 4. Add freebsd-swap partition labeled `swap#' - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap$index freebsd-swap $disk || + "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ + freebsd-swap ${swapsize}b $disk || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ @@ -763,6 +751,14 @@ zfs_create_diskpart() $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 4. Add freebsd-zfs partition labeled `zfs#' for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ + zfs$index freebsd-zfs $disk || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart ;; MBR) f_dprintf "$funcname: Creating MBR layout..." @@ -793,21 +789,21 @@ zfs_create_diskpart() f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE - # zpool will use s1a (no labels) - bootpart=s1a targetpart=s1a mbrindex=1 + # NB: zpool will use s1a (no labels) + bootpart=s1a targetpart=s1d mbrindex=4 - # Change things around if we are using geli(8) + # + # Always prepare a boot pool on MBR + # + ZFSBOOT_BOOT_POOL=1 + f_eval_catch $funcname gpart \ + "$GPART_ADD_INDEX_WITH_SIZE" \ + 1 freebsd-zfs ${bootsize}b ${disk}s1 || + return $FAILURE + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - bootpart=s1a targetpart=s1d - partsize=$(( $partsize - $gelisize )) - mbrindex=4 # If this is s1a then make the zpool s1d - f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs ${gelisize}b ${disk}s1 || - return $FAILURE - # Pedantically nuke any old labels - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$bootpart # Pedantically detach targetpart for later f_eval_catch -d $funcname geli \ "$GELI_DETACH_F" \ @@ -815,28 +811,12 @@ zfs_create_diskpart() fi # - # 4. Partition the BSD slice for ZFS - # NOTE: Using above calculated partsize to leave room for swap. + # 4. Add freebsd-swap partition # if [ ${swapsize:-0} -gt 0 ]; then f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - $mbrindex freebsd-zfs ${partsize}b \ - ${disk}s1 || return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - $mbrindex freebsd-zfs ${disk}s1 || - return $FAILURE - fi - f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/$disk$targetpart # Pedantic - - # - # 5. Add freebsd-swap partition - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - 2 freebsd-swap \${disk}s1 || + "$GPART_ADD_INDEX_WITH_SIZE" 2 \ + freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ @@ -844,6 +824,17 @@ zfs_create_diskpart() $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 5. Add freebsd-zfs partition for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /boot/zfsboot /dev/${disk}s1 count=1 || + return $FAILURE ;; esac # $ZFSBOOT_PARTITION_SCHEME @@ -859,8 +850,10 @@ zfs_create_diskpart() zfs_create_boot() { local funcname=zfs_create_boot - local poolname="$1" vdev_type="$2" - local bootpart targetpart + local zroot_name="$1" + local zroot_vdevtype="$2" + local zroot_vdevs= # Calculated below + local boot_vdevs= # Used for geli(8) and/or MBR layouts shift 2 # poolname vdev_type local disks="$*" disk local bootpart targetpart # Set by zfs_create_diskpart() below @@ -868,7 +861,7 @@ zfs_create_boot() # # Pedantic checks; should never be seen # - if [ ! "$poolname" ]; then + if [ ! "$zroot_name" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ f_show_err "$msg_null_poolname" @@ -881,7 +874,7 @@ zfs_create_boot() return $FAILURE fi f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ - "$poolname" "$vdev_type" + "$zroot_name" "$zroot_vdevtype" # # Initialize fstab(5) @@ -896,114 +889,114 @@ zfs_create_boot() # # Expand SI units in desired sizes # - f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." - local swapsize gelisize + f_dprintf "$funcname: Expanding supplied size values..." + local swapsize bootsize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then f_dprintf "$funcname: Invalid swap size \`%s'" \ "$ZFSBOOT_SWAP_SIZE" f_show_err "$msg_invalid_swap_size" "$ZFSBOOT_SWAP_SIZE" return $FAILURE fi - if ! f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize; then - f_dprintf "$funcname: Invalid geli(8) boot size \`%s'" \ - "$ZFSBOOT_GELI_BOOT_SIZE" - f_show_err "$msg_invalid_geli_boot_size" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + if ! f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize; then + f_dprintf "$funcname: Invalid boot pool size \`%s'" \ + "$ZFSBOOT_BOOT_POOL_SIZE" + f_show_err "$msg_invalid_boot_pool_size" \ + "$ZFSBOOT_BOOT_POOL_SIZE" return $FAILURE fi f_dprintf "$funcname: ZFSBOOT_SWAP_SIZE=[%s] swapsize=[%s]" \ "$ZFSBOOT_SWAP_SIZE" "$swapsize" - f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ - "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + f_dprintf "$funcname: ZFSBOOT_BOOT_POOL_SIZE=[%s] bootsize=[%s]" \ + "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" # - # Prepare the disks + # Prepare the disks and build pool device list(s) # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." + [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && + f_dprintf "$funcname: With 4k alignment using gnop(8)..." local n=0 for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - n=$(( $n + 1 )) - done - # Now $bootpart and $targetpart are set (suffix for $disk) - - # MBR boot loader hack part 1 - # We have to do this early because geli gets in the way later - if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then - f_dprintf "$funcname: Copying MBR boot loader to disks..." - for disk in $disks; do - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/${disk}s1 count=1 || - return $FAILURE - done - fi - - # Forced 4k alignment support provided by Geom NOP (see gnop(8)) - local unenc_list= - if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then - local part="$targetpart" new_list= - - # We don't gnop the encrypted partition because geli will do - # this for us gnop the unencrypted disk - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" - - f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - for disk in $disks; do - f_eval_catch $funcname gnop "$GNOP_CREATE" \ - $disk$part || return $FAILURE + # Now $bootpart and $targetpart are set (suffix for $disk) + + # Forced 4k alignment support using Geom NOP (see gnop(8)) + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$bootpart || return $FAILURE + fi + # Don't gnop encrypted partition if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - unenc_list="$unenc_list $disk$part.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.eli" else - new_list="$new_list $disk$targetpart.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$targetpart || + return $FAILURE fi - done - set -- $new_list - else - local new_list= - for disk in $disks; do - new_list="$new_list $disk$targetpart" - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - unenc_list="$unenc_list $disk$bootpart" - done - set -- $new_list - fi + else + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart" + fi + zroot_vdevs="$zroot_vdevs $disk$targetpart" + fi + + n=$(( $n + 1 )) + done # disks # - # If encryption is enabled, we need to create the GEOMs + # If we need/want a boot pool, create it # - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - local bootvdev= options= - local geli_pool="$BSDINSTALL_CHROOT/$ZFSBOOT_GELI_POOL_NAME" - local key="$ZFSBOOT_GELI_KEY_FILE" + if [ "$ZFSBOOT_BOOT_POOL" ]; then + local bootpool_vdevtype= # Calculated below + local bootpool_options= # Calculated below + local bootpool_name="$ZFSBOOT_BOOT_POOL_NAME" + local bootpool="$BSDINSTALL_CHROOT/$bootpool_name" + local zroot_key="${ZFSBOOT_GELI_KEY_FILE#/}" - f_dprintf "$funcname: Setting up disk encryption..." + f_dprintf "$funcname: Setting up boot pool..." + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + f_dprintf "$funcname: For encrypted root disk..." - # Create the parent directories for our unencrypted pool + # Create parent directory for boot pool f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ $BSDINSTALL_CHROOT || return $FAILURE - # Create mirror across the unencrypted partition on all disks - [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror + # Create mirror across the boot partition on all disks + [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && + bootpool_vdevtype=mirror - options="-o altroot=$BSDINSTALL_CHROOT" - options="$options -m \"/$ZFSBOOT_GELI_POOL_NAME\" -f" + bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" "$ZFSBOOT_GELI_POOL_NAME" $bootvdev \ - \$unenc_list || return $FAILURE + "$bootpool_options" "$bootpool_name" \ + $bootpool_vdevtype $boot_vdevs || return $FAILURE - f_eval_catch $funcname mkdir "$MKDIR_P" $geli_pool/boot || + f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE - # Generate an encryption key using random(4) - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random $geli_pool/$key "bs=4096 count=1" || - return $FAILURE + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Generate an encryption key using random(4) + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /dev/random "$bootpool/$zroot_key" \ + "bs=4096 count=1" || return $FAILURE + else + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ + "$bootpool_name" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs + fi - # - # Create the geli(8) GEOMS - # - local geli_list + fi + + # + # Create the geli(8) GEOMS + # + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Prompt user for password (twice) if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password then @@ -1018,8 +1011,8 @@ zfs_create_boot() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD if ! echo "$pw_password" | f_eval_catch \ $funcname geli "$GELI_PASSWORD_INIT" \ - "$geli_pool/boot/$disk$targetpart.eli" \ - AES-XTS "$geli_pool/$key" \ + "$bootpool/boot/$disk$targetpart.eli" \ + AES-XTS "$bootpool/$zroot_key" \ $disk$targetpart then f_interactive || f_die @@ -1028,42 +1021,39 @@ zfs_create_boot() fi if ! echo "$pw_password" | f_eval_catch \ $funcname geli "$GELI_ATTACH" \ - "$geli_pool/\$key" $disk$targetpart + "$bootpool/$zroot_key" $disk$targetpart then f_interactive || f_die unset pw_password # Sensitive info return $FAILURE fi - geli_list="$geli_list $disk$targetpart.eli" done unset pw_password # Sensitive info - set -- $geli_list # Clean up - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" "$bootpool_name" || + return $FAILURE f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # # Create the ZFS root pool with desired type and disk devices # - local vdevs="$*" - f_dprintf "$funcname: Creating boot pool..." + f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ - $poolname $vdev_type $vdevs + "$zroot_name" $zroot_vdevtype $zroot_vdevs - # Customize the zpool a bit... + # Customize the zroot a bit... local option - f_dprintf "$funcname: Setting miscellaneous options on boot pool..." + f_dprintf "$funcname: Setting miscellaneous options on root pool..." for option in checksum=fletcher4 atime=off; do - f_eval_catch $funcname zfs "$ZFS_SET" $option "$poolname" || + f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || return $FAILURE done # - # Create ZFS dataset layout within the new boot pool + # Create ZFS dataset layout within the new root pool # f_dprintf "$funcname: Creating ZFS datasets..." echo "$ZFSBOOT_DATASETS" | while read dataset options; do @@ -1083,7 +1073,7 @@ zfs_create_boot() f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "${options:+-o $options}" "$poolname$dataset" || + "${options:+-o $options}" "$zroot_name$dataset" || return $FAILURE done @@ -1096,40 +1086,41 @@ zfs_create_boot() done # Create symlink(s) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_dprintf "$funcname: Creating /boot symlink for GELI..." - f_eval_catch $funcname ln "$LN_SF" \ - "$ZFSBOOT_GELI_POOL_NAME/boot" \ + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_dprintf "$funcname: Creating /boot symlink for boot pool..." + f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \ $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property + local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" f_dprintf "$funcname: Setting bootfs property..." f_eval_catch $funcname zpool "$ZPOOL_SET" \ - "bootfs=\"$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ - "$poolname" || return $FAILURE + "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || + return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$poolname" || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + "$bootpool_name" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ $disk$bootpart.nop - else + fi + if [ ! "$ZFSBOOT_GELI_ENCRYPTION" ]; then f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ $disk$targetpart.nop fi done - # MBR boot loader hack part 2 + # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." # Stick the ZFS boot loader in the "convienient hole" after @@ -1144,12 +1135,12 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" "$poolname" || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR @@ -1158,7 +1149,7 @@ zfs_create_boot() return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ - "$poolname" || return $FAILURE + "$zroot_name" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination @@ -1169,8 +1160,8 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE - # We're all done unless we should go on to do encryption - [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + # We're all done unless we should go on for boot pool + [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS # Some additional geli(8) requirements for loader.conf(5) for option in \ @@ -1182,6 +1173,12 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done + f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + + # We're all done unless we should go on to do encryption + [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # # Configure geli(8)-based encryption @@ -1191,9 +1188,6 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE for disk in $disks; do f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_load "$disk$targetpart YES" \ @@ -1294,11 +1288,11 @@ while :; do # Make sure each disk will be at least 50% ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize then minsize=$swapsize teeny_disks= - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - minsize=$(( $minsize + $gelisize )) + [ "$ZFSBOOT_BOOT_POOL" ] && + minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do device_$disk get capacity disksize || continue disksize=$(( $disksize - $minsize )) @@ -1306,14 +1300,15 @@ while :; do teeny_disks="$teeny_disks $disk" done if [ "$teeny_disks" ]; then - f_dprintf "swapsize=[%s] gelisize[%s]" \ + f_dprintf "swapsize=[%s] bootsize[%s] %s" \ "$ZFSBOOT_SWAP_SIZE" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + "$ZFSBOOT_BOOT_POOL_SIZE" \ + "minsize=[$minsize]" f_dprintf "These disks are too small: %s" \ "$teeny_disks" f_show_err "$msg_these_disks_are_too_small" \ "$ZFSBOOT_SWAP_SIZE" \ - "$ZFSBOOT_GELI_BOOT_SIZE" \ + "$ZFSBOOT_BOOT_POOL_SIZE" \ "$teeny_disks" continue fi From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:43:04 2013 Return-Path: Delivered-To: svn-src-all@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 DE609213; Mon, 16 Dec 2013 19:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA21512F6; Mon, 16 Dec 2013 19:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJh43g087194; Mon, 16 Dec 2013 19:43:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJh4W2087193; Mon, 16 Dec 2013 19:43:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161943.rBGJh4W2087193@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259477 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:43:04 -0000 Author: dteske Date: Mon Dec 16 19:43:04 2013 New Revision: 259477 URL: http://svnweb.freebsd.org/changeset/base/259477 Log: fletcher4 is currently the default. Discussed on: -current MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:37:15 2013 (r259476) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:43:04 2013 (r259477) @@ -1047,7 +1047,7 @@ zfs_create_boot() # Customize the zroot a bit... local option f_dprintf "$funcname: Setting miscellaneous options on root pool..." - for option in checksum=fletcher4 atime=off; do + for option in atime=off; do f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || return $FAILURE done From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:44:46 2013 Return-Path: Delivered-To: svn-src-all@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 5481F36C; Mon, 16 Dec 2013 19:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 407BD1310; Mon, 16 Dec 2013 19:44:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJikiQ087440; Mon, 16 Dec 2013 19:44:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJikXT087439; Mon, 16 Dec 2013 19:44:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161944.rBGJikXT087439@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259478 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:44:46 -0000 Author: dteske Date: Mon Dec 16 19:44:45 2013 New Revision: 259478 URL: http://svnweb.freebsd.org/changeset/base/259478 Log: De-uglify the geli(8)-setup infobox by adding a newline. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:43:04 2013 (r259477) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) @@ -215,7 +215,7 @@ msg_force_4k_sectors="Force 4K Sectors?" msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" msg_freebsd_installer="FreeBSD Installer" msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" -msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk" msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:47:04 2013 Return-Path: Delivered-To: svn-src-all@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 E1D6A513; Mon, 16 Dec 2013 19:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDAAF1346; Mon, 16 Dec 2013 19:47:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJl4Ik087763; Mon, 16 Dec 2013 19:47:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJl4Jh087762; Mon, 16 Dec 2013 19:47:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161947.rBGJl4Jh087762@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:47:05 -0000 Author: dteske Date: Mon Dec 16 19:47:04 2013 New Revision: 259479 URL: http://svnweb.freebsd.org/changeset/base/259479 Log: Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). Discussed on: -current, -stable MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) @@ -1159,6 +1159,9 @@ zfs_create_boot() $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'kern.geom.label.disk_ident.enable=\"0\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:51:11 2013 Return-Path: Delivered-To: svn-src-all@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 96088822; Mon, 16 Dec 2013 19:51:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 822091438; Mon, 16 Dec 2013 19:51:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJpB9W090590; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJpBtQ090589; Mon, 16 Dec 2013 19:51:11 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161951.rBGJpBtQ090589@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259480 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:51:11 -0000 Author: dteske Date: Mon Dec 16 19:51:11 2013 New Revision: 259480 URL: http://svnweb.freebsd.org/changeset/base/259480 Log: Fix a long-standing edge-case that would result in a ghosted `zroot' pool and subsequent headaches caused by multiple pools with the same name. Specifically, blast away any labels on the designated swap partition. Problem was when you install to a given layout *with* swap and then turn around and re-install the same layout *without* swap (we weren't doing a labelclear for the swap device, so would end up with an "UNAVAIL" status zroot pool that may only exist in the pool cache). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:51:11 2013 (r259480) @@ -745,6 +745,9 @@ zfs_create_diskpart() "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ freebsd-swap ${swapsize}b $disk || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/gpt/swap$index # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/gpt/swap$index none swap sw 0 0 \ @@ -818,6 +821,9 @@ zfs_create_diskpart() "$GPART_ADD_INDEX_WITH_SIZE" 2 \ freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1b # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/${disk}s1b none swap sw 0 0 \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:54:55 2013 Return-Path: Delivered-To: svn-src-all@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 E42D2B4E; Mon, 16 Dec 2013 19:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D077614F7; Mon, 16 Dec 2013 19:54:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJstPT091000; Mon, 16 Dec 2013 19:54:55 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJsto3090999; Mon, 16 Dec 2013 19:54:55 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312161954.rBGJsto3090999@svn.freebsd.org> From: Devin Teske Date: Mon, 16 Dec 2013 19:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259481 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:54:56 -0000 Author: dteske Date: Mon Dec 16 19:54:55 2013 New Revision: 259481 URL: http://svnweb.freebsd.org/changeset/base/259481 Log: Auto-enable 4k sector alignment when disk encryption is requested (it is required in such a case). But don't prevent the user from pointing the gun at his/her foot -- you can disable 4k alignment after enabling geli). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:51:11 2013 (r259480) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:54:55 2013 (r259481) @@ -1372,6 +1372,7 @@ while :; do if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then ZFSBOOT_GELI_ENCRYPTION= else + ZFSBOOT_GNOP_4K_FORCE_ALIGN=1 ZFSBOOT_GELI_ENCRYPTION=1 fi ;; From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:59:35 2013 Return-Path: Delivered-To: svn-src-all@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 2B6FBD1C; Mon, 16 Dec 2013 19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBB71535; Mon, 16 Dec 2013 19:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJxYOP091610; Mon, 16 Dec 2013 19:59:34 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJxYTV091609; Mon, 16 Dec 2013 19:59:34 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312161959.rBGJxYTV091609@svn.freebsd.org> From: Alan Somers Date: Mon, 16 Dec 2013 19: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: r259483 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:59:35 -0000 Author: asomers Date: Mon Dec 16 19:59:34 2013 New Revision: 259483 URL: http://svnweb.freebsd.org/changeset/base/259483 Log: MFC r258311 opensolaris/uts/common/dtrace/fasttrap.c Fix several problems that can cause panics on kldload and kldunload. * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before fasttrap_provs.fth_table gets allocated. This can lead to a panic on module load, because fasttrap_pid_cleanup_cb references fasttrap_provs.fth_table. Move kproc_create down after the point that fasttrap_provs.fth_table gets allocated, and modify the error handling accordingly. * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until after fasttrap_provs.fth_table got freed. That caused panics on module unload because fasttrap_exec_exit calls fasttrap_provider_retire, which references fasttrap_provs.fth_table. NULL those function pointers earlier. * There wasn't any code to destroy the fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload, leading to a resource leak when WITNESS is enabled. Destroy those mutexes during fasttrap_unload(). Sponsored by: Spectra Logic Corporation Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Dec 16 19:59:31 2013 (r259482) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Dec 16 19:59:34 2013 (r259483) @@ -2284,13 +2284,6 @@ fasttrap_load(void) mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, NULL); - ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, - &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); - if (ret != 0) { - destroy_dev(fasttrap_cdev); - return (ret); - } - #if defined(sun) fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT); @@ -2344,6 +2337,24 @@ fasttrap_load(void) "providers bucket mtx", MUTEX_DEFAULT, NULL); #endif + ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, + &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); + if (ret != 0) { + destroy_dev(fasttrap_cdev); +#if !defined(sun) + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); +#endif + kmem_free(fasttrap_provs.fth_table, fasttrap_provs.fth_nent * + sizeof (fasttrap_bucket_t)); + mtx_destroy(&fasttrap_cleanup_mtx); + mutex_destroy(&fasttrap_count_mtx); + return (ret); + } + + /* * ... and the procs hash table. */ @@ -2436,6 +2447,20 @@ fasttrap_unload(void) return (-1); } + /* + * Stop new processes from entering these hooks now, before the + * fasttrap_cleanup thread runs. That way all processes will hopefully + * be out of these hooks before we free fasttrap_provs.fth_table + */ + ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); + dtrace_fasttrap_fork = NULL; + + ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); + dtrace_fasttrap_exec = NULL; + + ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); + dtrace_fasttrap_exit = NULL; + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_drain = 1; /* Wait for the cleanup thread to finish up and signal us. */ @@ -2451,6 +2476,14 @@ fasttrap_unload(void) mutex_exit(&fasttrap_count_mtx); #endif +#if !defined(sun) + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_procs.fth_nent; i++) + mutex_destroy(&fasttrap_procs.fth_table[i].ftb_mtx); +#endif kmem_free(fasttrap_tpoints.fth_table, fasttrap_tpoints.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_tpoints.fth_nent = 0; @@ -2463,22 +2496,6 @@ fasttrap_unload(void) fasttrap_procs.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_procs.fth_nent = 0; - /* - * We know there are no tracepoints in any process anywhere in - * the system so there is no process which has its p_dtrace_count - * greater than zero, therefore we know that no thread can actively - * be executing code in fasttrap_fork(). Similarly for p_dtrace_probes - * and fasttrap_exec() and fasttrap_exit(). - */ - ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); - dtrace_fasttrap_fork = NULL; - - ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); - dtrace_fasttrap_exec = NULL; - - ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); - dtrace_fasttrap_exit = NULL; - #if !defined(sun) destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 19:59:35 2013 Return-Path: Delivered-To: svn-src-all@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 49FB3D1D; Mon, 16 Dec 2013 19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 347E71536; Mon, 16 Dec 2013 19:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGJxZDs091614; Mon, 16 Dec 2013 19:59:35 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGJxWp2091559; Mon, 16 Dec 2013 19:59:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312161959.rBGJxWp2091559@svn.freebsd.org> From: Neel Natu Date: Mon, 16 Dec 2013 19:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259482 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 19:59:35 -0000 Author: neel Date: Mon Dec 16 19:59:31 2013 New Revision: 259482 URL: http://svnweb.freebsd.org/changeset/base/259482 Log: Add an API to deliver message signalled interrupts to vcpus. This allows callers treat the MSI 'addr' and 'data' fields as opaque and also lets bhyve implement multiple destination modes: physical, flat and clustered. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) Reviewed by: grehan@ Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/io/ppt.h head/sys/amd64/vmm/io/vhpet.c head/sys/amd64/vmm/io/vioapic.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_lapic.h head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/lib/libvmmapi/vmmapi.c Mon Dec 16 19:59:31 2013 (r259482) @@ -397,6 +397,18 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu } int +vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg) +{ + struct vm_lapic_msi vmmsi; + + bzero(&vmmsi, sizeof(vmmsi)); + vmmsi.addr = addr; + vmmsi.msg = msg; + + return (ioctl(ctx->fd, VM_LAPIC_MSI, &vmmsi)); +} + +int vm_ioapic_assert_irq(struct vmctx *ctx, int irq) { struct vm_ioapic_irq ioapic_irq; @@ -552,7 +564,7 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) + uint64_t addr, uint64_t msg, int numvec) { struct vm_pptdev_msi pptmsi; @@ -561,8 +573,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu pptmsi.bus = bus; pptmsi.slot = slot; pptmsi.func = func; - pptmsi.destcpu = destcpu; - pptmsi.vector = vector; + pptmsi.msg = msg; + pptmsi.addr = addr; pptmsi.numvec = numvec; return (ioctl(ctx->fd, VM_PPTDEV_MSI, &pptmsi)); @@ -570,7 +582,7 @@ vm_setup_msi(struct vmctx *ctx, int vcpu int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct vm_pptdev_msix pptmsix; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/lib/libvmmapi/vmmapi.h Mon Dec 16 19:59:31 2013 (r259482) @@ -67,6 +67,7 @@ int vm_inject_event(struct vmctx *ctx, i int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, int vector, int error_code); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); +int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); @@ -82,9 +83,9 @@ int vm_unassign_pptdev(struct vmctx *ctx int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int dest, int vector, int numvec); + uint64_t addr, uint64_t msg, int numvec); int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/include/vmm_dev.h Mon Dec 16 19:59:31 2013 (r259482) @@ -66,6 +66,11 @@ struct vm_event { int error_code_valid; }; +struct vm_lapic_msi { + uint64_t msg; + uint64_t addr; +}; + struct vm_lapic_irq { int cpuid; int vector; @@ -103,8 +108,8 @@ struct vm_pptdev_msi { int slot; int func; int numvec; /* 0 means disabled */ - int vector; - int destcpu; + uint64_t msg; + uint64_t addr; }; struct vm_pptdev_msix { @@ -113,7 +118,7 @@ struct vm_pptdev_msix { int slot; int func; int idx; - uint32_t msg; + uint64_t msg; uint32_t vector_control; uint64_t addr; }; @@ -175,6 +180,7 @@ enum { IOCNUM_IOAPIC_ASSERT_IRQ = 33, IOCNUM_IOAPIC_DEASSERT_IRQ = 34, IOCNUM_IOAPIC_PULSE_IRQ = 35, + IOCNUM_LAPIC_MSI = 36, /* PCI pass-thru */ IOCNUM_BIND_PPTDEV = 40, @@ -211,6 +217,8 @@ enum { _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) +#define VM_LAPIC_MSI \ + _IOW('v', IOCNUM_LAPIC_MSI, struct vm_lapic_msi) #define VM_IOAPIC_ASSERT_IRQ \ _IOW('v', IOCNUM_IOAPIC_ASSERT_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_DEASSERT_IRQ \ Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/ppt.c Mon Dec 16 19:59:31 2013 (r259482) @@ -72,8 +72,8 @@ MALLOC_DEFINE(M_PPTMSIX, "pptmsix", "Pas struct pptintr_arg { /* pptintr(pptintr_arg) */ struct pptdev *pptdev; - int vec; - int vcpu; + uint64_t addr; + uint64_t msg_data; }; static struct pptdev { @@ -412,16 +412,14 @@ ppt_map_mmio(struct vm *vm, int bus, int static int pptintr(void *arg) { - int vec; struct pptdev *ppt; struct pptintr_arg *pptarg; pptarg = arg; ppt = pptarg->pptdev; - vec = pptarg->vec; if (ppt->vm != NULL) - lapic_intr_edge(ppt->vm, pptarg->vcpu, vec); + lapic_intr_msi(ppt->vm, pptarg->addr, pptarg->msg_data); else { /* * XXX @@ -441,15 +439,13 @@ pptintr(void *arg) int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec) + uint64_t addr, uint64_t msg, int numvec) { int i, rid, flags; int msi_count, startrid, error, tmp; struct pptdev *ppt; - if ((destcpu >= VM_MAXCPU || destcpu < 0) || - (vector < 0 || vector > 255) || - (numvec < 0 || numvec > MAX_MSIMSGS)) + if (numvec < 0 || numvec > MAX_MSIMSGS) return (EINVAL); ppt = ppt_find(bus, slot, func); @@ -513,8 +509,8 @@ ppt_setup_msi(struct vm *vm, int vcpu, i break; ppt->msi.arg[i].pptdev = ppt; - ppt->msi.arg[i].vec = vector + i; - ppt->msi.arg[i].vcpu = destcpu; + ppt->msi.arg[i].addr = addr; + ppt->msi.arg[i].msg_data = msg + i; error = bus_setup_intr(ppt->dev, ppt->msi.res[i], INTR_TYPE_NET | INTR_MPSAFE, @@ -534,7 +530,7 @@ ppt_setup_msi(struct vm *vm, int vcpu, i int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr) + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct pptdev *ppt; struct pci_devinfo *dinfo; @@ -605,8 +601,8 @@ ppt_setup_msix(struct vm *vm, int vcpu, return (ENXIO); ppt->msix.arg[idx].pptdev = ppt; - ppt->msix.arg[idx].vec = msg & 0xFF; - ppt->msix.arg[idx].vcpu = (addr >> 12) & 0xFF; + ppt->msix.arg[idx].addr = addr; + ppt->msix.arg[idx].msg_data = msg; /* Setup the MSI-X interrupt */ error = bus_setup_intr(ppt->dev, ppt->msix.res[idx], Modified: head/sys/amd64/vmm/io/ppt.h ============================================================================== --- head/sys/amd64/vmm/io/ppt.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/ppt.h Mon Dec 16 19:59:31 2013 (r259482) @@ -33,9 +33,9 @@ int ppt_unassign_all(struct vm *vm); int ppt_map_mmio(struct vm *vm, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func, - int destcpu, int vector, int numvec); + uint64_t addr, uint64_t msg, int numvec); int ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, - int idx, uint32_t msg, uint32_t vector_control, uint64_t addr); + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); int ppt_num_devices(struct vm *vm); boolean_t ppt_is_mmio(struct vm *vm, vm_paddr_t gpa); Modified: head/sys/amd64/vmm/io/vhpet.c ============================================================================== --- head/sys/amd64/vmm/io/vhpet.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vhpet.c Mon Dec 16 19:59:31 2013 (r259482) @@ -240,8 +240,7 @@ vhpet_timer_edge_trig(struct vhpet *vhpe static void vhpet_timer_interrupt(struct vhpet *vhpet, int n) { - int apicid, vector, vcpuid, pin; - cpuset_t dmask; + int pin; /* If interrupts are not enabled for this timer then just return. */ if (!vhpet_timer_interrupt_enabled(vhpet, n)) @@ -256,26 +255,8 @@ vhpet_timer_interrupt(struct vhpet *vhpe } if (vhpet_timer_msi_enabled(vhpet, n)) { - /* - * XXX should have an API 'vlapic_deliver_msi(vm, addr, data)' - * - assuming physical delivery mode - * - no need to interpret contents of 'msireg' here - */ - vector = vhpet->timer[n].msireg & 0xff; - apicid = (vhpet->timer[n].msireg >> (32 + 12)) & 0xff; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vhpet->vm, apicid); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } else { - /* broadcast */ - dmask = vm_active_cpus(vhpet->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_intr_edge(vhpet->vm, vcpuid, vector); - } - } + lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, + vhpet->timer[n].msireg & 0xffffffff); return; } Modified: head/sys/amd64/vmm/io/vioapic.c ============================================================================== --- head/sys/amd64/vmm/io/vioapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vioapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_ktr.h" #include "vmm_lapic.h" +#include "vlapic.h" #include "vioapic.h" #define IOREGSEL 0x00 @@ -91,25 +92,14 @@ pinstate_str(bool asserted) else return ("deasserted"); } - -static const char * -trigger_str(bool level) -{ - - if (level) - return ("level"); - else - return ("edge"); -} #endif static void vioapic_send_intr(struct vioapic *vioapic, int pin) { - int vector, apicid, vcpuid; - uint32_t low, high; - cpuset_t dmask; - bool level; + int vector, delmode; + uint32_t low, high, dest; + bool level, phys; KASSERT(pin >= 0 && pin < REDIR_ENTRIES, ("vioapic_set_pinstate: invalid pin number %d", pin)); @@ -120,52 +110,20 @@ vioapic_send_intr(struct vioapic *vioapi low = vioapic->rtbl[pin].reg; high = vioapic->rtbl[pin].reg >> 32; - /* - * XXX We only deal with: - * - physical destination - * - fixed delivery mode - */ - if ((low & IOART_DESTMOD) != IOART_DESTPHY) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported dest mode " - "0x%08x", pin, low); - return; - } - - if ((low & IOART_DELMOD) != IOART_DELFIXED) { - VIOAPIC_CTR2(vioapic, "ioapic pin%d: unsupported delivery mode " - "0x%08x", pin, low); - return; - } - if ((low & IOART_INTMASK) == IOART_INTMSET) { VIOAPIC_CTR1(vioapic, "ioapic pin%d: masked", pin); return; } + phys = ((low & IOART_DESTMOD) == IOART_DESTPHY); + delmode = low & IOART_DELMOD; level = low & IOART_TRGRLVL ? true : false; if (level) vioapic->rtbl[pin].reg |= IOART_REM_IRR; vector = low & IOART_INTVEC; - apicid = high >> APIC_ID_SHIFT; - if (apicid != 0xff) { - /* unicast */ - vcpuid = vm_apicid2vcpuid(vioapic->vm, apicid); - VIOAPIC_CTR4(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on vcpuid %d", pin, trigger_str(level), - vector, vcpuid); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } else { - /* broadcast */ - VIOAPIC_CTR3(vioapic, "ioapic pin%d: %s triggered intr " - "vector %d on all vcpus", pin, trigger_str(level), vector); - dmask = vm_active_cpus(vioapic->vm); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); - lapic_set_intr(vioapic->vm, vcpuid, vector, level); - } - } + dest = high >> APIC_ID_SHIFT; + vlapic_deliver_intr(vioapic->vm, level, dest, phys, delmode, vector); } static void Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vlapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -145,6 +145,84 @@ struct vlapic { #define VLAPIC_BUS_FREQ tsc_freq +static __inline uint32_t +vlapic_get_id(struct vlapic *vlapic) +{ + + if (x2apic(vlapic)) + return (vlapic->vcpuid); + else + return (vlapic->vcpuid << 24); +} + +static __inline uint32_t +vlapic_get_ldr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + int apicid; + uint32_t ldr; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) { + apicid = vlapic_get_id(vlapic); + ldr = 1 << (apicid & 0xf); + ldr |= (apicid & 0xffff0) << 12; + return (ldr); + } else + return (lapic->ldr); +} + +static __inline uint32_t +vlapic_get_dfr(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + lapic = &vlapic->apic; + if (x2apic(vlapic)) + return (0); + else + return (lapic->dfr); +} + +static void +vlapic_set_dfr(struct vlapic *vlapic, uint32_t data) +{ + uint32_t dfr; + struct LAPIC *lapic; + + if (x2apic(vlapic)) { + VM_CTR1(vlapic->vm, "write to DFR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + dfr = (lapic->dfr & APIC_DFR_RESERVED) | (data & APIC_DFR_MODEL_MASK); + if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_FLAT) + VLAPIC_CTR0(vlapic, "vlapic DFR in Flat Model"); + else if ((dfr & APIC_DFR_MODEL_MASK) == APIC_DFR_MODEL_CLUSTER) + VLAPIC_CTR0(vlapic, "vlapic DFR in Cluster Model"); + else + VLAPIC_CTR1(vlapic, "vlapic DFR in Unknown Model %#x", dfr); + + lapic->dfr = dfr; +} + +static void +vlapic_set_ldr(struct vlapic *vlapic, uint32_t data) +{ + struct LAPIC *lapic; + + /* LDR is read-only in x2apic mode */ + if (x2apic(vlapic)) { + VLAPIC_CTR1(vlapic, "write to LDR in x2apic mode: %#x", data); + return; + } + + lapic = &vlapic->apic; + lapic->ldr = data & ~APIC_LDR_RESERVED; + VLAPIC_CTR1(vlapic, "vlapic LDR set to %#x", lapic->ldr); +} + static int vlapic_timer_divisor(uint32_t dcr) { @@ -610,12 +688,115 @@ vlapic_set_icr_timer(struct vlapic *vlap VLAPIC_TIMER_UNLOCK(vlapic); } +/* + * This function populates 'dmask' with the set of vcpus that match the + * addressing specified by the (dest, phys, lowprio) tuple. + * + * 'x2apic_dest' specifies whether 'dest' is interpreted as x2APIC (32-bit) + * or xAPIC (8-bit) destination field. + */ +static void +vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32_t dest, bool phys, + bool lowprio, bool x2apic_dest) +{ + struct vlapic *vlapic; + uint32_t dfr, ldr, ldest, cluster; + uint32_t mda_flat_ldest, mda_cluster_ldest, mda_ldest, mda_cluster_id; + cpuset_t amask; + int vcpuid; + + if ((x2apic_dest && dest == 0xffffffff) || + (!x2apic_dest && dest == 0xff)) { + /* + * Broadcast in both logical and physical modes. + */ + *dmask = vm_active_cpus(vm); + return; + } + + if (phys) { + /* + * Physical mode: destination is APIC ID. + */ + CPU_ZERO(dmask); + vcpuid = vm_apicid2vcpuid(vm, dest); + if (vcpuid < VM_MAXCPU) + CPU_SET(vcpuid, dmask); + } else { + /* + * In the "Flat Model" the MDA is interpreted as an 8-bit wide + * bitmask. This model is only avilable in the xAPIC mode. + */ + mda_flat_ldest = dest & 0xff; + + /* + * In the "Cluster Model" the MDA is used to identify a + * specific cluster and a set of APICs in that cluster. + */ + if (x2apic_dest) { + mda_cluster_id = dest >> 16; + mda_cluster_ldest = dest & 0xffff; + } else { + mda_cluster_id = (dest >> 4) & 0xf; + mda_cluster_ldest = dest & 0xf; + } + + /* + * Logical mode: match each APIC that has a bit set + * in it's LDR that matches a bit in the ldest. + */ + CPU_ZERO(dmask); + amask = vm_active_cpus(vm); + while ((vcpuid = CPU_FFS(&amask)) != 0) { + vcpuid--; + CPU_CLR(vcpuid, &amask); + + vlapic = vm_lapic(vm, vcpuid); + dfr = vlapic_get_dfr(vlapic); + ldr = vlapic_get_ldr(vlapic); + + if ((dfr & APIC_DFR_MODEL_MASK) == + APIC_DFR_MODEL_FLAT) { + ldest = ldr >> 24; + mda_ldest = mda_flat_ldest; + } else if ((dfr & APIC_DFR_MODEL_MASK) == + APIC_DFR_MODEL_CLUSTER) { + if (x2apic(vlapic)) { + cluster = ldr >> 16; + ldest = ldr & 0xffff; + } else { + cluster = ldr >> 28; + ldest = (ldr >> 24) & 0xf; + } + if (cluster != mda_cluster_id) + continue; + mda_ldest = mda_cluster_ldest; + } else { + /* + * Guest has configured a bad logical + * model for this vcpu - skip it. + */ + VLAPIC_CTR1(vlapic, "vlapic has bad logical " + "model %x - cannot deliver interrupt", dfr); + continue; + } + + if ((mda_ldest & ldest) != 0) { + CPU_SET(vcpuid, dmask); + if (lowprio) + break; + } + } + } +} + static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); static int lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu) { int i; + bool phys; cpuset_t dmask; uint32_t dest, vec, mode; struct vlapic *vlapic2; @@ -631,7 +812,9 @@ lapic_process_icr(struct vlapic *vlapic, if (mode == APIC_DELMODE_FIXED || mode == APIC_DELMODE_NMI) { switch (icrval & APIC_DEST_MASK) { case APIC_DEST_DESTFLD: - CPU_SETOF(dest, &dmask); + phys = ((icrval & APIC_DESTMODE_LOG) == 0); + vlapic_calcdest(vlapic->vm, &dmask, dest, phys, false, + x2apic(vlapic)); break; case APIC_DEST_SELF: CPU_SETOF(vlapic->vcpuid, &dmask); @@ -820,10 +1003,7 @@ vlapic_read(struct vlapic *vlapic, uint6 switch(offset) { case APIC_OFFSET_ID: - if (x2apic(vlapic)) - *data = vlapic->vcpuid; - else - *data = vlapic->vcpuid << 24; + *data = vlapic_get_id(vlapic); break; case APIC_OFFSET_VER: *data = lapic->version; @@ -841,10 +1021,10 @@ vlapic_read(struct vlapic *vlapic, uint6 *data = lapic->eoi; break; case APIC_OFFSET_LDR: - *data = lapic->ldr; + *data = vlapic_get_ldr(vlapic); break; case APIC_OFFSET_DFR: - *data = lapic->dfr; + *data = vlapic_get_dfr(vlapic); break; case APIC_OFFSET_SVR: *data = lapic->svr; @@ -921,8 +1101,10 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_process_eoi(vlapic); break; case APIC_OFFSET_LDR: + vlapic_set_ldr(vlapic, data); break; case APIC_OFFSET_DFR: + vlapic_set_dfr(vlapic, data); break; case APIC_OFFSET_SVR: lapic_set_svr(vlapic, data); @@ -1041,6 +1223,34 @@ vlapic_set_x2apic_state(struct vm *vm, i vlapic->msr_apicbase &= ~APICBASE_X2APIC; } +void +vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, + int delmode, int vec) +{ + bool lowprio; + int vcpuid; + cpuset_t dmask; + + if (delmode != APIC_DELMODE_FIXED && delmode != APIC_DELMODE_LOWPRIO) { + VM_CTR1(vm, "vlapic intr invalid delmode %#x", delmode); + return; + } + lowprio = (delmode == APIC_DELMODE_LOWPRIO); + + /* + * We don't provide any virtual interrupt redirection hardware so + * all interrupts originating from the ioapic or MSI specify the + * 'dest' in the legacy xAPIC format. + */ + vlapic_calcdest(vm, &dmask, dest, phys, lowprio, false); + + while ((vcpuid = CPU_FFS(&dmask)) != 0) { + vcpuid--; + CPU_CLR(vcpuid, &dmask); + lapic_set_intr(vm, vcpuid, vec, level); + } +} + bool vlapic_enabled(struct vlapic *vlapic) { Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/io/vlapic.h Mon Dec 16 19:59:31 2013 (r259482) @@ -103,4 +103,6 @@ void vlapic_set_apicbase(struct vlapic * void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state s); bool vlapic_enabled(struct vlapic *vlapic); +void vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, + int delmode, int vec); #endif /* _VLAPIC_H_ */ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_dev.c Mon Dec 16 19:59:31 2013 (r259482) @@ -152,6 +152,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_run *vmrun; struct vm_event *vmevent; struct vm_lapic_irq *vmirq; + struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; struct vm_capability *vmcap; struct vm_pptdev *pptdev; @@ -254,7 +255,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c pptmsi = (struct vm_pptdev_msi *)data; error = ppt_setup_msi(sc->vm, pptmsi->vcpu, pptmsi->bus, pptmsi->slot, pptmsi->func, - pptmsi->destcpu, pptmsi->vector, + pptmsi->addr, pptmsi->msg, pptmsi->numvec); break; case VM_PPTDEV_MSIX: @@ -262,8 +263,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = ppt_setup_msix(sc->vm, pptmsix->vcpu, pptmsix->bus, pptmsix->slot, pptmsix->func, pptmsix->idx, - pptmsix->msg, pptmsix->vector_control, - pptmsix->addr); + pptmsix->addr, pptmsix->msg, + pptmsix->vector_control); break; case VM_MAP_PPTDEV_MMIO: pptmmio = (struct vm_pptdev_mmio *)data; @@ -296,6 +297,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmirq = (struct vm_lapic_irq *)data; error = lapic_intr_edge(sc->vm, vmirq->cpuid, vmirq->vector); break; + case VM_LAPIC_MSI: + vmmsi = (struct vm_lapic_msi *)data; + error = lapic_intr_msi(sc->vm, vmmsi->addr, vmmsi->msg); + break; case VM_IOAPIC_ASSERT_IRQ: ioapic_irq = (struct vm_ioapic_irq *)data; error = vioapic_assert_irq(sc->vm, ioapic_irq->irq); Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_lapic.c Mon Dec 16 19:59:31 2013 (r259482) @@ -38,9 +38,18 @@ __FBSDID("$FreeBSD$"); #include #include "vmm_ipi.h" +#include "vmm_ktr.h" #include "vmm_lapic.h" #include "vlapic.h" +/* + * Some MSI message definitions + */ +#define MSI_X86_ADDR_MASK 0xfff00000 +#define MSI_X86_ADDR_BASE 0xfee00000 +#define MSI_X86_ADDR_RH 0x00000008 /* Redirection Hint */ +#define MSI_X86_ADDR_LOG 0x00000004 /* Destination Mode */ + int lapic_pending_intr(struct vm *vm, int cpu) { @@ -80,6 +89,44 @@ lapic_set_intr(struct vm *vm, int cpu, i return (0); } +int +lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg) +{ + int delmode, vec; + uint32_t dest; + bool phys; + + VM_CTR2(vm, "lapic MSI addr: %#lx msg: %#lx", addr, msg); + + if ((addr & MSI_X86_ADDR_MASK) != MSI_X86_ADDR_BASE) { + VM_CTR1(vm, "lapic MSI invalid addr %#lx", addr); + return (-1); + } + + /* + * Extract the x86-specific fields from the MSI addr/msg + * params according to the Intel Arch spec, Vol3 Ch 10. + * + * The PCI specification does not support level triggered + * MSI/MSI-X so ignore trigger level in 'msg'. + * + * The 'dest' is interpreted as a logical APIC ID if both + * the Redirection Hint and Destination Mode are '1' and + * physical otherwise. + */ + dest = (addr >> 12) & 0xff; + phys = ((addr & (MSI_X86_ADDR_RH | MSI_X86_ADDR_LOG)) != + (MSI_X86_ADDR_RH | MSI_X86_ADDR_LOG)); + delmode = msg & APIC_DELMODE_MASK; + vec = msg & 0xff; + + VM_CTR3(vm, "lapic MSI %s dest %#x, vec %d", + phys ? "physical" : "logical", dest, vec); + + vlapic_deliver_intr(vm, LAPIC_TRIG_EDGE, dest, phys, delmode, vec); + return (0); +} + static boolean_t x2apic_msr(u_int msr) { Modified: head/sys/amd64/vmm/vmm_lapic.h ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/sys/amd64/vmm/vmm_lapic.h Mon Dec 16 19:59:31 2013 (r259482) @@ -84,4 +84,5 @@ lapic_intr_edge(struct vm *vm, int cpu, return (lapic_set_intr(vm, cpu, vector, LAPIC_TRIG_EDGE)); } +int lapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg); #endif Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_emul.c Mon Dec 16 19:59:31 2013 (r259482) @@ -850,19 +850,14 @@ msicap_cfgwrite(struct pci_devinst *pi, else msgdata = pci_get_cfgdata16(pi, capoff + 8); - /* - * XXX check delivery mode, destination mode etc - */ mme = msgctrl & PCIM_MSICTRL_MME_MASK; pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; if (pi->pi_msi.enabled) { - pi->pi_msi.cpu = (addrlo >> 12) & 0xff; - pi->pi_msi.vector = msgdata & 0xff; - pi->pi_msi.msgnum = 1 << (mme >> 4); + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); } else { - pi->pi_msi.cpu = 0; - pi->pi_msi.vector = 0; - pi->pi_msi.msgnum = 0; + pi->pi_msi.maxmsgnum = 0; } } @@ -1060,10 +1055,10 @@ pci_msi_enabled(struct pci_devinst *pi) } int -pci_msi_msgnum(struct pci_devinst *pi) +pci_msi_maxmsgnum(struct pci_devinst *pi) { if (pi->pi_msi.enabled) - return (pi->pi_msi.msgnum); + return (pi->pi_msi.maxmsgnum); else return (0); } @@ -1092,19 +1087,17 @@ pci_generate_msix(struct pci_devinst *pi mte = &pi->pi_msix.table[index]; if ((mte->vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { /* XXX Set PBA bit if interrupt is disabled */ - vm_lapic_irq(pi->pi_vmctx, - (mte->addr >> 12) & 0xff, mte->msg_data & 0xff); + vm_lapic_msi(pi->pi_vmctx, mte->addr, mte->msg_data); } } void -pci_generate_msi(struct pci_devinst *pi, int msg) +pci_generate_msi(struct pci_devinst *pi, int index) { - if (pci_msi_enabled(pi) && msg < pci_msi_msgnum(pi)) { - vm_lapic_irq(pi->pi_vmctx, - pi->pi_msi.cpu, - pi->pi_msi.vector + msg); + if (pci_msi_enabled(pi) && index < pci_msi_maxmsgnum(pi)) { + vm_lapic_msi(pi->pi_vmctx, pi->pi_msi.addr, + pi->pi_msi.msg_data + index); } } @@ -1511,10 +1504,10 @@ pci_emul_diow(struct vmctx *ctx, int vcp * Special magic value to generate an interrupt */ if (offset == 4 && size == 4 && pci_msi_enabled(pi)) - pci_generate_msi(pi, value % pci_msi_msgnum(pi)); + pci_generate_msi(pi, value % pci_msi_maxmsgnum(pi)); if (value == 0xabcdef) { - for (i = 0; i < pci_msi_msgnum(pi); i++) + for (i = 0; i < pci_msi_maxmsgnum(pi); i++) pci_generate_msi(pi, i); } } Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_emul.h Mon Dec 16 19:59:31 2013 (r259482) @@ -109,10 +109,10 @@ struct pci_devinst { int pi_bar_getsize; struct { - int enabled; - int cpu; - int vector; - int msgnum; + int enabled; + uint64_t addr; + uint64_t msg_data; + int maxmsgnum; } pi_msi; struct { Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Mon Dec 16 19:54:55 2013 (r259481) +++ head/usr.sbin/bhyve/pci_passthru.c Mon Dec 16 19:59:31 2013 (r259482) @@ -348,9 +348,9 @@ msix_table_write(struct vmctx *ctx, int error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, - index, entry->msg_data, - entry->vector_control, - entry->addr); + index, entry->addr, + entry->msg_data, + entry->vector_control); } } } @@ -653,8 +653,9 @@ passthru_cfgwrite(struct vmctx *ctx, int msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val); error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.cpu, - pi->pi_msi.vector, pi->pi_msi.msgnum); + sc->psc_sel.pc_dev, sc->psc_sel.pc_func, + pi->pi_msi.addr, pi->pi_msi.msg_data, + pi->pi_msi.maxmsgnum); if (error != 0) { printf("vm_setup_msi returned error %d\r\n", errno); exit(1); @@ -667,15 +668,16 @@ passthru_cfgwrite(struct vmctx *ctx, int if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, - sc->psc_sel.pc_func, i, - pi->pi_msix.table[i].msg_data, - pi->pi_msix.table[i].vector_control, - pi->pi_msix.table[i].addr); + error = vm_setup_msix(ctx, vcpu, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func, i, + pi->pi_msix.table[i].addr, + pi->pi_msix.table[i].msg_data, + pi->pi_msix.table[i].vector_control); if (error) { - printf("vm_setup_msix returned error %d\r\n", errno); + printf("vm_setup_msix error %d\r\n", + errno); exit(1); } } From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 20:40:24 2013 Return-Path: Delivered-To: svn-src-all@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 073B8D6; Mon, 16 Dec 2013 20:40:24 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4DE1A9B; Mon, 16 Dec 2013 20:40:22 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBGKeLl5049531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Dec 2013 00:40:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBGKeLIu049530; Tue, 17 Dec 2013 00:40:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Dec 2013 00:40:21 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259475 - head/sys/kern Message-ID: <20131216204021.GW29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312161931.rBGJVOhs083409@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 20:40:24 -0000 Adrian, On Mon, Dec 16, 2013 at 07:31:24PM +0000, Adrian Chadd wrote: A> Modified: head/sys/kern/uipc_syscalls.c A> ============================================================================== A> --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 (r259474) A> +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 (r259475) A> @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); A> #include A> #endif A> A> +#include A> +#include A> +#include A> #include A> A> #include A> @@ -130,6 +133,7 @@ static int sfreadahead = 1; A> SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, A> &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks"); A> A> +static uma_zone_t zone_sfsync; A> A> static void A> sfstat_init(const void *unused) A> @@ -140,6 +144,22 @@ sfstat_init(const void *unused) A> } A> SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); A> A> +static void A> +sf_sync_init(const void *unused) A> +{ A> + A> + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), A> + NULL, NULL, A> +#ifdef INVARIANTS A> + trash_init, trash_fini, A> +#else A> + NULL, NULL, A> +#endif A> + UMA_ALIGN_CACHE, A> + 0); A> +} You do not need the INVARIANTS ifdef, because uma(9) will do the same thing for you automatically. Thus, you also do not need to pollute namespace with uma_int.h and uma_dbg.h. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 21:26:16 2013 Return-Path: Delivered-To: svn-src-all@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 63324D5; Mon, 16 Dec 2013 21:26:16 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 330011F37; Mon, 16 Dec 2013 21:26:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7648138044; Mon, 16 Dec 2013 15:26:14 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 75U1GgZXJgHI; Mon, 16 Dec 2013 15:26:14 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 51A9C38043; Mon, 16 Dec 2013 15:26:14 -0600 (CST) Message-ID: <52AF6FF6.1030909@freebsd.org> Date: Mon, 16 Dec 2013 15:26:14 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> In-Reply-To: <201312161947.rBGJl4Jh087762@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:26:16 -0000 On 12/16/13 13:47, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 19:47:04 2013 > New Revision: 259479 > URL: http://svnweb.freebsd.org/changeset/base/259479 > > Log: > Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). > > Discussed on: -current, -stable > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/scripts/zfsboot > > Modified: head/usr.sbin/bsdinstall/scripts/zfsboot > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) > +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) > @@ -1159,6 +1159,9 @@ zfs_create_boot() > $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE > f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ > $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE > + f_eval_catch $funcname echo "$ECHO_APPEND" \ > + 'kern.geom.label.disk_ident.enable=\"0\"' \ > + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE > > # We're all done unless we should go on for boot pool > [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 21:40:32 2013 Return-Path: Delivered-To: svn-src-all@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 D3260A26; Mon, 16 Dec 2013 21:40:32 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 976DE1099; Mon, 16 Dec 2013 21:40:32 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLeVJg020928 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:40:31 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:40:30 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Mon, 16 Dec 2013 21:40:29 +0000 Message-ID: <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> In-Reply-To: <52AF6FF6.1030909@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <997BDFA71312B5408B33AFA96C102208@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:40:33 -0000 On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: > On 12/16/13 13:47, Devin Teske wrote: >> Author: dteske >> Date: Mon Dec 16 19:47:04 2013 >> New Revision: 259479 >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.= org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6= vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21= DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083f= b1c3a7e >>=20 >> Log: >> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >> Discussed on: -current, -stable >> MFC after: 3 days >>=20 >> Modified: >> head/usr.sbin/bsdinstall/scripts/zfsboot >>=20 >> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r= 259478) >> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r= 259479) >> @@ -1159,6 +1159,9 @@ zfs_create_boot() >> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >> # We're all done unless we should go on for boot pool >> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >=20 > Uh -- what is all of this? Why are we disabling kernel functions dependin= g on what the root filesystem is? Please don't MFC this. http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html NB: Happy to rip it out... but want something in-reply to those threads (pr= etty please). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 21:48:39 2013 Return-Path: Delivered-To: svn-src-all@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 0515ED01; Mon, 16 Dec 2013 21:48:39 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B952810EC; Mon, 16 Dec 2013 21:48:38 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa05.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLmbsI012464 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:48:37 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:48:36 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7JpXwGqA Date: Mon, 16 Dec 2013 21:48:35 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> In-Reply-To: <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <4360776B995F63419A3A9F54A2429B37@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:48:39 -0000 On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >=20 > On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >=20 >> On 12/16/13 13:47, Devin Teske wrote: >>> Author: dteske >>> Date: Mon Dec 16 19:47:04 2013 >>> New Revision: 259479 >>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd= .org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs= 6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F2= 1DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083= fb1c3a7e >>>=20 >>> Log: >>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>> Discussed on: -current, -stable >>> MFC after: 3 days >>>=20 >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>=20 >>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (= r259478) >>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (= r259479) >>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>> # We're all done unless we should go on for boot pool >>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>=20 >> Uh -- what is all of this? Why are we disabling kernel functions dependi= ng on what the root filesystem is? Please don't MFC this. >=20 > http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.ht= ml > http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.ht= ml >=20 > NB: Happy to rip it out... but want something in-reply to those threads (= pretty please). Basically... the logic is... The ZFS pool is built on vdevs of a specific name. The names that are used should remain the same. Adding this to the loader.conf ensures that the nam= es that the pool(s) was/were built upon do not change. This goes beyond just a swap partition I imagine. For example... copying the data to a new drive using a duplicator. I'm sure there are other cases too. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 21:50:58 2013 Return-Path: Delivered-To: svn-src-all@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 1671CEAC; Mon, 16 Dec 2013 21:50:58 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id BD0011151; Mon, 16 Dec 2013 21:50:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 5434838044; Mon, 16 Dec 2013 15:50:57 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id pGP3Mc9NiuI6; Mon, 16 Dec 2013 15:50:57 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 4144F3803F; Mon, 16 Dec 2013 15:50:57 -0600 (CST) Message-ID: <52AF75C1.9040502@freebsd.org> Date: Mon, 16 Dec 2013 15:50:57 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:50:58 -0000 On 12/16/13 15:48, Teske, Devin wrote: > On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: > >> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >> >>> On 12/16/13 13:47, Devin Teske wrote: >>>> Author: dteske >>>> Date: Mon Dec 16 19:47:04 2013 >>>> New Revision: 259479 >>>> URL: https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259479&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=fW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21DVtgyGU%3D%0A&s=cdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083fb1c3a7e >>>> >>>> Log: >>>> Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). >>>> Discussed on: -current, -stable >>>> MFC after: 3 days >>>> >>>> Modified: >>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>> >>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>> ============================================================================== >>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) >>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) >>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ >>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>> + 'kern.geom.label.disk_ident.enable=\"0\"' \ >>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>> # We're all done unless we should go on for boot pool >>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>> Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html >> >> NB: Happy to rip it out... but want something in-reply to those threads (pretty please). > Basically... the logic is... > > The ZFS pool is built on vdevs of a specific name. The names that are used > should remain the same. Adding this to the loader.conf ensures that the names > that the pool(s) was/were built upon do not change. > > This goes beyond just a swap partition I imagine. For example... copying the > data to a new drive using a duplicator. I'm sure there are other cases too. Thanks for the explanation! I wonder if we should just turn off the disk ident stuff by default globally -- it was causing problems for me as well without ZFS root. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 21:55:17 2013 Return-Path: Delivered-To: svn-src-all@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 B9E7FE9; Mon, 16 Dec 2013 21:55:17 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC8E1190; Mon, 16 Dec 2013 21:55:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa02.fnfis.com (8.14.5/8.14.5) with ESMTP id rBGLtF25004481 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 16 Dec 2013 15:55:16 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Mon, 16 Dec 2013 15:55:14 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Mon, 16 Dec 2013 21:55:13 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> In-Reply-To: <52AF75C1.9040502@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <675E989217A2A247963055F63A7E4744@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-16_01:2013-12-16,2013-12-16,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:55:17 -0000 On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: > On 12/16/13 15:48, Teske, Devin wrote: >> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>=20 >>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>=20 >>>> On 12/16/13 13:47, Devin Teske wrote: >>>>> Author: dteske >>>>> Date: Mon Dec 16 19:47:04 2013 >>>>> New Revision: 259479 >>>>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freeb= sd.org/changeset/base/259479&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMr= js6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DfW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2= F21DVtgyGU%3D%0A&s=3Dcdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a0= 83fb1c3a7e >>>>>=20 >>>>> Log: >>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>> Discussed on: -current, -stable >>>>> MFC after: 3 days >>>>>=20 >>>>> Modified: >>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>=20 >>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013= (r259478) >>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013= (r259479) >>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>> # We're all done unless we should go on for boot pool >>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>> Uh -- what is all of this? Why are we disabling kernel functions depen= ding on what the root filesystem is? Please don't MFC this. >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org/p= ipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILCq%2= FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=3D= WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c5e1= 05a7869c580884327a8721c2f44c1711b319212a23db7 >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org/p= ipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILCq%2= FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=3D= WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e3eb= d45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>=20 >>> NB: Happy to rip it out... but want something in-reply to those threads= (pretty please). >> Basically... the logic is... >>=20 >> The ZFS pool is built on vdevs of a specific name. The names that are us= ed >> should remain the same. Adding this to the loader.conf ensures that the = names >> that the pool(s) was/were built upon do not change. >>=20 >> This goes beyond just a swap partition I imagine. For example... copying= the >> data to a new drive using a duplicator. I'm sure there are other cases t= oo. >=20 > Thanks for the explanation! I wonder if we should just turn off the disk = ident stuff by default globally -- it was causing problems for me as well w= ithout ZFS root. As I was making the commit to zfsboot... the very thought had occurred to m= e. I'm happy to rip this out in favor of a new global default. The end-result = is that what Johan experienced won't be repeated. I think there's an urgency to get something to solve this into 10. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 22:03:36 2013 Return-Path: Delivered-To: svn-src-all@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 248C9527; Mon, 16 Dec 2013 22:03:36 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id C7B56123D; Mon, 16 Dec 2013 22:03:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 406C438043; Mon, 16 Dec 2013 16:03:35 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id krgNaNQGaJ00; Mon, 16 Dec 2013 16:03:35 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 2D2203803F; Mon, 16 Dec 2013 16:03:35 -0600 (CST) Message-ID: <52AF78B6.20706@freebsd.org> Date: Mon, 16 Dec 2013 16:03:34 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Devin Teske Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 22:03:36 -0000 On 12/16/13 15:55, Teske, Devin wrote: > On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: > >> On 12/16/13 15:48, Teske, Devin wrote: >>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>> >>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>> >>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>> Author: dteske >>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>> New Revision: 259479 >>>>>> URL: https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259479&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=fW6SVzmwwyz0yNXNK7sHp4zegrL63niU%2F%2F21DVtgyGU%3D%0A&s=cdd7f18e0151f222c2934ae69e473dac2e22e74cbde4d5af5758a083fb1c3a7e >>>>>> >>>>>> Log: >>>>>> Add kern.geom.label.disk_ident.enable="0" to loader.conf(5). >>>>>> Discussed on: -current, -stable >>>>>> MFC after: 3 days >>>>>> >>>>>> Modified: >>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>> >>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>> ============================================================================== >>>>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2013 (r259478) >>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2013 (r259479) >>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ >>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>> + 'kern.geom.label.disk_ident.enable=\"0\"' \ >>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>> # We're all done unless we should go on for boot pool >>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>> Uh -- what is all of this? Why are we disabling kernel functions depending on what the root filesystem is? Please don't MFC this. >>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076365.html&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=LTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=4f16f0d6399e3a3c5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076471.html&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=LTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m=WCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=17882f97e3633c1e3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>> >>>> NB: Happy to rip it out... but want something in-reply to those threads (pretty please). >>> Basically... the logic is... >>> >>> The ZFS pool is built on vdevs of a specific name. The names that are used >>> should remain the same. Adding this to the loader.conf ensures that the names >>> that the pool(s) was/were built upon do not change. >>> >>> This goes beyond just a swap partition I imagine. For example... copying the >>> data to a new drive using a duplicator. I'm sure there are other cases too. >> Thanks for the explanation! I wonder if we should just turn off the disk ident stuff by default globally -- it was causing problems for me as well without ZFS root. > As I was making the commit to zfsboot... the very thought had occurred to me. > > I'm happy to rip this out in favor of a new global default. The end-result is that > what Johan experienced won't be repeated. > > I think there's an urgency to get something to solve this into 10. Yeah, I can see that. Let me bring this up on -CURRENT, with a short timeout, and see what the options are. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 22:04:48 2013 Return-Path: Delivered-To: svn-src-all@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 D9A1266F; Mon, 16 Dec 2013 22:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C44151246; Mon, 16 Dec 2013 22:04:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGM4lOO040502; Mon, 16 Dec 2013 22:04:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGM4lse040501; Mon, 16 Dec 2013 22:04:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312162204.rBGM4lse040501@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 16 Dec 2013 22:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259484 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 22:04:48 -0000 Author: nwhitehorn Date: Mon Dec 16 22:04:47 2013 New Revision: 259484 URL: http://svnweb.freebsd.org/changeset/base/259484 Log: Use the common Open Firmware PCI interrupt routing code instead of the duplicate version in dev/fdt. Tested by: zbb Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Mon Dec 16 19:59:34 2013 (r259483) +++ head/sys/arm/mv/mv_pci.c Mon Dec 16 22:04:47 2013 (r259484) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -142,7 +143,7 @@ struct mv_pcib_softc { int sc_type; int sc_mode; /* Endpoint / Root Complex */ - struct fdt_pci_intr sc_intr_info; + struct ofw_bus_iinfo sc_pci_iinfo; }; /* Local forward prototypes */ @@ -155,7 +156,6 @@ static void mv_pcib_hw_cfgwrite(struct m static int mv_pcib_init(struct mv_pcib_softc *, int, int); static int mv_pcib_init_all_bars(struct mv_pcib_softc *, int, int, int, int); static void mv_pcib_init_bridge(struct mv_pcib_softc *, int, int, int); -static int mv_pcib_intr_info(phandle_t, struct mv_pcib_softc *); static inline void pcib_write_irq_mask(struct mv_pcib_softc *, uint32_t); static void mv_pcib_enable(struct mv_pcib_softc *, uint32_t); static int mv_pcib_mem_init(struct mv_pcib_softc *); @@ -243,8 +243,8 @@ mv_pcib_probe(device_t self) if (!fdt_is_type(node, "pci")) return (ENXIO); - if (!(fdt_is_compatible(node, "mrvl,pcie") || - fdt_is_compatible(node, "mrvl,pci"))) + if (!(ofw_bus_is_compatible(self, "mrvl,pcie") || + ofw_bus_is_compatible(self, "mrvl,pci"))) return (ENXIO); device_set_desc(self, "Marvell Integrated PCI/PCI-E Controller"); @@ -299,11 +299,8 @@ mv_pcib_attach(device_t self) /* * Get PCI interrupt info. */ - if ((sc->sc_mode == MV_MODE_ROOT) && - (mv_pcib_intr_info(node, sc) != 0)) { - device_printf(self, "could not retrieve interrupt info\n"); - return (ENXIO); - } + if (sc->sc_mode == MV_MODE_ROOT) + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(pcell_t)); /* * Configure decode windows for PCI(E) access. @@ -881,19 +878,33 @@ mv_pcib_write_config(device_t dev, u_int } static int -mv_pcib_route_interrupt(device_t pcib, device_t dev, int pin) +mv_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct mv_pcib_softc *sc; - int err, interrupt; - - sc = device_get_softc(pcib); - - err = fdt_pci_route_intr(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev), pin, &sc->sc_intr_info, &interrupt); - if (err == 0) - return (interrupt); + struct ofw_pci_register reg; + uint32_t pintr, mintr; + phandle_t iparent; + uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; + + sc = device_get_softc(bus); + pintr = pin; + + /* Fabricate imap information in case this isn't an OFW device */ + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, + sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + &iparent, maskbuf)) + return (ofw_bus_map_intr(dev, iparent, mintr)); + + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); - device_printf(pcib, "could not route pin %d for device %d.%d\n", + device_printf(bus, "could not route pin %d for device %d.%d\n", pin, pci_get_slot(dev), pci_get_function(dev)); return (PCI_INVALID_IRQ); } @@ -938,17 +949,6 @@ mv_pcib_decode_win(phandle_t node, struc return (0); } -static int -mv_pcib_intr_info(phandle_t node, struct mv_pcib_softc *sc) -{ - int error; - - if ((error = fdt_pci_intr_info(node, &sc->sc_intr_info)) != 0) - return (error); - - return (0); -} - #if defined(SOC_MV_ARMADAXP) static int mv_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 22:07:50 2013 Return-Path: Delivered-To: svn-src-all@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 1BCB38CB; Mon, 16 Dec 2013 22:07:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 049991269; Mon, 16 Dec 2013 22:07:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGM7nBL041079; Mon, 16 Dec 2013 22:07:49 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGM7nH7041078; Mon, 16 Dec 2013 22:07:49 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312162207.rBGM7nH7041078@svn.freebsd.org> From: Andreas Tobler Date: Mon, 16 Dec 2013 22:07:49 +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: r259485 - in stable/9/sys: . amd64/include/xen boot boot/forth boot/i386/efi boot/i386/gptboot boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensola... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 22:07:50 -0000 Author: andreast Date: Mon Dec 16 22:07:49 2013 New Revision: 259485 URL: http://svnweb.freebsd.org/changeset/base/259485 Log: Fix the outstanding mergeinfo part of r249374. Modified: 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/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/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/net/ (props changed) stable/9/sys/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Dec 16 23:57:44 2013 Return-Path: Delivered-To: svn-src-all@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 2D445633; Mon, 16 Dec 2013 23:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F316D1D4C; Mon, 16 Dec 2013 23:57:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBGNvhPP081709; Mon, 16 Dec 2013 23:57:43 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBGNvhrr081706; Mon, 16 Dec 2013 23:57:43 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201312162357.rBGNvhrr081706@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Dec 2013 23:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259487 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 23:57:44 -0000 Author: luigi Date: Mon Dec 16 23:57:43 2013 New Revision: 259487 URL: http://svnweb.freebsd.org/changeset/base/259487 Log: fix the build using __builtin_prefetch() instead of redefining prefetch() Modified: head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Dec 16 23:57:43 2013 (r259487) @@ -220,8 +220,8 @@ ixgbe_netmap_txsync(struct netmap_adapte if (nm_i != cur) { /* we have new packets to send */ nic_i = netmap_idx_k2n(kring, nm_i); - prefetch(&ring->slot[nm_i]); - prefetch(&txr->tx_buffers[nic_i]); + __builtin_prefetch(&ring->slot[nm_i]); + __builtin_prefetch(&txr->tx_buffers[nic_i]); for (n = 0; nm_i != cur; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; @@ -237,8 +237,8 @@ ixgbe_netmap_txsync(struct netmap_adapte IXGBE_TXD_CMD_RS : 0; /* prefetch for next round */ - prefetch(&ring->slot[nm_i + 1]); - prefetch(&txr->tx_buffers[nic_i + 1]); + __builtin_prefetch(&ring->slot[nm_i + 1]); + __builtin_prefetch(&txr->tx_buffers[nic_i + 1]); NM_CHECK_ADDR_LEN(addr, len); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/netmap_kern.h Mon Dec 16 23:57:43 2013 (r259487) @@ -61,7 +61,6 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) -#define prefetch(x) __builtin_prefetch(x) MALLOC_DECLARE(M_NETMAP); Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Mon Dec 16 22:26:25 2013 (r259486) +++ head/sys/dev/netmap/netmap_vale.c Mon Dec 16 23:57:43 2013 (r259487) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -// #define prefetch(x) __builtin_prefetch(x) - #define BDG_RWLOCK_T struct rwlock // struct rwlock @@ -1003,7 +1001,7 @@ nm_bdg_preflush(struct netmap_vp_adapter ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? (void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot); - prefetch(buf); + __builtin_prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { frags++; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 00:54:17 2013 Return-Path: Delivered-To: svn-src-all@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 14F5AF10; Tue, 17 Dec 2013 00:54:17 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 902A312BA; Tue, 17 Dec 2013 00:54:16 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id i17so4473689qcy.9 for ; Mon, 16 Dec 2013 16:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9HU4fnO6UR7BgsjGzEfIbvOMvHqRUaoqBELZpxpVdko=; b=ZdrrqLX6TpE345mWVEsadOdkcC3uHUyXY+e9knfeClkJcvYvyiHDy05nIWEOJUYybX 4HwWkf+BH3nGVb/FHdjQIUpoGUAQQoG8cqSZ8eE7Y4S4/HsBlQrKVKEc9QPFU3O6/7aq uKBKlK+spbq+0QKGLAzNJhhMwhz4cMUp3ssFkzY/9Y8YvCULD1zVF6uAIgPdRg/ccC/U N/NAYH7cFDUCgqYkpuDkFD+cq/QkucEQqgF2kjcHdvBv90VvJdHRZNSHTFi+r7o4xZse F2V+cPkTNA9aPXmCmpnb6gFpsgJh2+AQvPspZyySzBW8efNWthpp1QaTnQN2MO9PO7Bk 4PVg== MIME-Version: 1.0 X-Received: by 10.224.67.200 with SMTP id s8mr37726510qai.75.1387241655792; Mon, 16 Dec 2013 16:54:15 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 16:54:15 -0800 (PST) Received: by 10.224.53.200 with HTTP; Mon, 16 Dec 2013 16:54:15 -0800 (PST) In-Reply-To: <20131216204021.GW29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> <20131216204021.GW29088@FreeBSD.org> Date: Mon, 16 Dec 2013 16:54:15 -0800 X-Google-Sender-Auth: qxXvn-GqDuSLp7kYpuJ0AWT5RVw Message-ID: Subject: Re: svn commit: r259475 - head/sys/kern From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 00:54:17 -0000 Ok. I'll go find where I copy pastes thus from. The mbuf code perhaps? Should we do a big quick tidy up? Adrian On Dec 16, 2013 1:40 PM, "Gleb Smirnoff" wrote: > Adrian, > > On Mon, Dec 16, 2013 at 07:31:24PM +0000, Adrian Chadd wrote: > A> Modified: head/sys/kern/uipc_syscalls.c > A> > ============================================================================== > A> --- head/sys/kern/uipc_syscalls.c Mon Dec 16 18:53:09 2013 > (r259474) > A> +++ head/sys/kern/uipc_syscalls.c Mon Dec 16 19:31:23 2013 > (r259475) > A> @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); > A> #include > A> #endif > A> > A> +#include > A> +#include > A> +#include > A> #include > A> > A> #include > A> @@ -130,6 +133,7 @@ static int sfreadahead = 1; > A> SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW, > A> &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE > blocks"); > A> > A> +static uma_zone_t zone_sfsync; > A> > A> static void > A> sfstat_init(const void *unused) > A> @@ -140,6 +144,22 @@ sfstat_init(const void *unused) > A> } > A> SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL); > A> > A> +static void > A> +sf_sync_init(const void *unused) > A> +{ > A> + > A> + zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct > sendfile_sync), > A> + NULL, NULL, > A> +#ifdef INVARIANTS > A> + trash_init, trash_fini, > A> +#else > A> + NULL, NULL, > A> +#endif > A> + UMA_ALIGN_CACHE, > A> + 0); > A> +} > > You do not need the INVARIANTS ifdef, because uma(9) will do the same thing > for you automatically. Thus, you also do not need to pollute namespace with > uma_int.h and uma_dbg.h. > > -- > Totus tuus, Glebius. > From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 01:02:34 2013 Return-Path: Delivered-To: svn-src-all@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 B3D9826D; Tue, 17 Dec 2013 01:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 859681350; Tue, 17 Dec 2013 01:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH12Yah007445; Tue, 17 Dec 2013 01:02:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH12YFD007444; Tue, 17 Dec 2013 01:02:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312170102.rBH12YFD007444@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Dec 2013 01:02: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: r259488 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 01:02:34 -0000 Author: gjb Date: Tue Dec 17 01:02:34 2013 New Revision: 259488 URL: http://svnweb.freebsd.org/changeset/base/259488 Log: Record mergeinfo for r258927. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 01:29:37 2013 Return-Path: Delivered-To: svn-src-all@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 8AE6EEDC; Tue, 17 Dec 2013 01:29:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0408115B6; Tue, 17 Dec 2013 01:29:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBH1TXYf051215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Dec 2013 05:29:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBH1TXG9051214; Tue, 17 Dec 2013 05:29:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Dec 2013 05:29:33 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259475 - head/sys/kern Message-ID: <20131217012933.GY29088@FreeBSD.org> References: <201312161931.rBGJVOhs083409@svn.freebsd.org> <20131216204021.GW29088@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 01:29:37 -0000 On Mon, Dec 16, 2013 at 04:54:15PM -0800, Adrian Chadd wrote: A> Ok. I'll go find where I copy pastes thus from. The mbuf code perhaps? A> A> Should we do a big quick tidy up? Nope, the mbuf code is somewhat different, due to secondary zones. An item freed there isn't actually freed, that's why they need a shift of trashing memory not in ctor/dtor, but in init/fini. Actually, now I see that your code is not only extraneous but wrong. You probably wanted to set ctor/dtor methods, not init/fini. So just remove it, in case of INVARIANTS the UMA automatically does all needed trash filling and later checking. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 03:06:22 2013 Return-Path: Delivered-To: svn-src-all@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 6DCF8A98; Tue, 17 Dec 2013 03:06:22 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9131F73; Tue, 17 Dec 2013 03:06:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH36MLK052556; Tue, 17 Dec 2013 03:06:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH36MtI052555; Tue, 17 Dec 2013 03:06:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312170306.rBH36MtI052555@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 Dec 2013 03:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 03:06:22 -0000 Author: adrian Date: Tue Dec 17 03:06:21 2013 New Revision: 259489 URL: http://svnweb.freebsd.org/changeset/base/259489 Log: Remove the invariants stuff I copy/paste'd from the mbuf code when setting up the UMA zone. This should (a) be correct(er) and (b) it should build on non-amd64. Pointed out by: glebius Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Dec 17 01:02:34 2013 (r259488) +++ head/sys/kern/uipc_syscalls.c Tue Dec 17 03:06:21 2013 (r259489) @@ -80,9 +80,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include -#include #include #include @@ -95,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(INET) || defined(INET6) #ifdef SCTP @@ -150,11 +148,7 @@ sf_sync_init(const void *unused) zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct sendfile_sync), NULL, NULL, -#ifdef INVARIANTS - trash_init, trash_fini, -#else NULL, NULL, -#endif UMA_ALIGN_CACHE, 0); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 03:38:36 2013 Return-Path: Delivered-To: svn-src-all@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 937A4AD8; Tue, 17 Dec 2013 03:38:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF00121E; Tue, 17 Dec 2013 03:38:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH3caiI063801; Tue, 17 Dec 2013 03:38:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH3caqG063800; Tue, 17 Dec 2013 03:38:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312170338.rBH3caqG063800@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 17 Dec 2013 03:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259490 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 03:38:36 -0000 Author: rodrigc Date: Tue Dec 17 03:38:36 2013 New Revision: 259490 URL: http://svnweb.freebsd.org/changeset/base/259490 Log: Add release note items from Chelsio. Submitted by: np Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 03:06:21 2013 (r259489) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 03:38:36 2013 (r259490) @@ -248,6 +248,12 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. + The &man.cxgbe.4; driver has been updated to support + 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. + + The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + (kernel verbs only) for Chelsio's T4 and T5 based cards. + From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 03:46:45 2013 Return-Path: Delivered-To: svn-src-all@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 16589E1F; Tue, 17 Dec 2013 03:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0352712EC; Tue, 17 Dec 2013 03:46:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH3kiLm067096; Tue, 17 Dec 2013 03:46:44 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH3ki0K067095; Tue, 17 Dec 2013 03:46:44 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312170346.rBH3ki0K067095@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Dec 2013 03:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259491 - 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 03:46:45 -0000 Author: gjb Date: Tue Dec 17 03:46:44 2013 New Revision: 259491 URL: http://svnweb.freebsd.org/changeset/base/259491 Log: MFC r259246: Prevent release build errors found during snapshot builds where if NOPORTS=1, pkg-stage.sh cannot build the ports-mgmt/pkg port if WITH_DVD=1. 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 Tue Dec 17 03:38:36 2013 (r259490) +++ stable/10/release/scripts/pkg-stage.sh Tue Dec 17 03:46:44 2013 (r259491) @@ -24,6 +24,11 @@ fi REVISION="${2}" . "${1}" || exit 1 +# If NOPORTS is set for the release, do not attempt to build pkg(8). +if [ ! -f /usr/ports/Makefile ]; then + exit 0 +fi + if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 04:16:21 2013 Return-Path: Delivered-To: svn-src-all@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 80D7EC52; Tue, 17 Dec 2013 04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8271609; Tue, 17 Dec 2013 04:16:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH4GLX9078428; Tue, 17 Dec 2013 04:16:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH4GLlM078427; Tue, 17 Dec 2013 04:16:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312170416.rBH4GLlM078427@svn.freebsd.org> From: Glen Barber Date: Tue, 17 Dec 2013 04:16: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: r259492 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 04:16:21 -0000 Author: gjb Date: Tue Dec 17 04:16:20 2013 New Revision: 259492 URL: http://svnweb.freebsd.org/changeset/base/259492 Log: MFC r258770 (hrs): Add NOPKG to disable pkg-stage. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Dec 17 03:46:44 2013 (r259491) +++ stable/10/release/Makefile Tue Dec 17 04:16:20 2013 (r259492) @@ -16,6 +16,7 @@ # (by default, the directory above this one) # PORTSDIR: location of ports tree to distribute (default: /usr/ports) # DOCDIR: location of doc tree (default: /usr/doc) +# NOPKG: if set, do not distribute third-party packages # NOPORTS: if set, do not distribute ports tree # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation @@ -221,7 +222,7 @@ packagesystem: base.txz kernel.txz ${EXT touch ${.TARGET} pkg-stage: -.if(exists(${.CURDIR}/${TARGET}/pkg-stage.conf)) +.if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf) sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ ${REVISION} .endif From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 04:19:03 2013 Return-Path: Delivered-To: svn-src-all@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 AF6FFDED; Tue, 17 Dec 2013 04:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBD8162E; Tue, 17 Dec 2013 04:19:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH4J3dp078737; Tue, 17 Dec 2013 04:19:03 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH4J38J078736; Tue, 17 Dec 2013 04:19:03 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312170419.rBH4J38J078736@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 17 Dec 2013 04:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259493 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 04:19:03 -0000 Author: rodrigc Date: Tue Dec 17 04:19:03 2013 New Revision: 259493 URL: http://svnweb.freebsd.org/changeset/base/259493 Log: Add OFED and Mellanox items to release notes. Submitted by: Meny Yossefi Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:16:20 2013 (r259492) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:19:03 2013 (r259493) @@ -254,6 +254,15 @@ The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. + The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + updated to the same version as supplied by Linux version 3.7 + + The Mellanox Infiniband driver has been updated to firmware + version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where + each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added + for dynamically loading kernel modules for Infiniband core (ibcore) and + IP over Infiniband (ipoib). + From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 04:26:21 2013 Return-Path: Delivered-To: svn-src-all@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 21994183; Tue, 17 Dec 2013 04:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D19B16C8; Tue, 17 Dec 2013 04:26:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH4QKEu082050; Tue, 17 Dec 2013 04:26:20 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH4QKDd082049; Tue, 17 Dec 2013 04:26:20 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312170426.rBH4QKDd082049@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 17 Dec 2013 04:26: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: r259494 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 04:26:21 -0000 Author: rodrigc Date: Tue Dec 17 04:26:20 2013 New Revision: 259494 URL: http://svnweb.freebsd.org/changeset/base/259494 Log: MFC r259493: Add OFED and Mellanox items to release notes. Submitted by: Meny Yossefi MFC r259490: Add release note items from Chelsio. Submitted by: np Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:19:03 2013 (r259493) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Dec 17 04:26:20 2013 (r259494) @@ -248,6 +248,21 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. + The &man.cxgbe.4; driver has been updated to support + 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. + + The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + (kernel verbs only) for Chelsio's T4 and T5 based cards. + + The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + updated to the same version as supplied by Linux version 3.7 + + The Mellanox Infiniband driver has been updated to firmware + version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where + each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added + for dynamically loading kernel modules for Infiniband core (ibcore) and + IP over Infiniband (ipoib). + From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 04:50:21 2013 Return-Path: Delivered-To: svn-src-all@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 646E79AD for ; Tue, 17 Dec 2013 04:50:21 +0000 (UTC) Received: from mail-qe0-x22d.google.com (mail-qe0-x22d.google.com [IPv6:2607:f8b0:400d:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CFD0186A for ; Tue, 17 Dec 2013 04:50:21 +0000 (UTC) Received: by mail-qe0-f45.google.com with SMTP id 6so4754527qea.18 for ; Mon, 16 Dec 2013 20:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=dMXMgcrG+09Zoe/v19vfESVoM/mZARhjH/hCeGAja7g=; b=kmaYJUi53HWrqWml2n9IjNop27lHpgaPZcHJRDyGf1i/r+CK/88mJsRINYXLJ+9gwj t5xp3sR6VYWMYd1Rypq7tE8LzQ6I+jh4yec27j1bF/AI4pmZwa3sF5leQ4077ij6WXsC MwdJJPhRkah/lE3U1BdH4AMIVrAFFSMt6gt8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=dMXMgcrG+09Zoe/v19vfESVoM/mZARhjH/hCeGAja7g=; b=e1Bo2KEZx4JddH8iO4GnsZsTcgO/uGJTlJFrbq51CdYg0GjY6W1igs6YeUq2kirPpp BfKOsuFRBxZPvxeEjCFllEPiUrtXoHv2W6zjAAAva+IU6xuycMDMFeKbVl0mDhq+Dbcg 2hcFSrmgfa+4G0YomJVApZwlOI3Pzt3A3zXg5n0WOSqvSBaKPZCL8Eqe8DJKLmR1E8uv HQHhSo+MB0O4/uSfraMH3lsfDkz880MGkL+jQluopF9kO80oXwbZMLFv4Qlkx9dsquMu 6UE9rRA03e7cMFWZ7+hmgvmw2ME5qK3FetE5C9Qfc7mg90vOIBcuHKJ0I806gKN9jNZ7 1VCQ== X-Gm-Message-State: ALoCoQlLwfrEpe0uJF1KrGsJgikAPTYdF0X8jOqZVaunM86uQrrpSdF9NYK6lV8gTv3W0/XfYiUJ X-Received: by 10.229.194.1 with SMTP id dw1mr39033788qcb.20.1387255820318; Mon, 16 Dec 2013 20:50:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.86.42 with HTTP; Mon, 16 Dec 2013 20:49:50 -0800 (PST) In-Reply-To: <201312161954.rBGJsto3090999@svn.freebsd.org> References: <201312161954.rBGJsto3090999@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 23:49:50 -0500 Message-ID: Subject: Re: svn commit: r259481 - head/usr.sbin/bsdinstall/scripts To: Devin Teske Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 04:50:21 -0000 On Mon, Dec 16, 2013 at 2:54 PM, Devin Teske wrote: > Author: dteske > Date: Mon Dec 16 19:54:55 2013 > New Revision: 259481 > URL: http://svnweb.freebsd.org/changeset/base/259481 > > Log: > Auto-enable 4k sector alignment when disk encryption is requested (it is > required in such a case). Nice > But don't prevent the user from pointing the > gun at his/her foot -- you can disable 4k alignment after enabling geli). Why? Is there ever a reason you would want to do this? -- Eitan Adler From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 04:55:36 2013 Return-Path: Delivered-To: svn-src-all@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 A332CC5F for ; Tue, 17 Dec 2013 04:55:36 +0000 (UTC) Received: from mail-qe0-x233.google.com (mail-qe0-x233.google.com [IPv6:2607:f8b0:400d:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A93B1908 for ; Tue, 17 Dec 2013 04:55:36 +0000 (UTC) Received: by mail-qe0-f51.google.com with SMTP id 1so4780756qee.10 for ; Mon, 16 Dec 2013 20:55:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AjezaFV2EjIr5e8wtU94VkDiRqAFxlB7zFRuTRDu9uY=; b=mTxE6cvIuwQ2UTqeaYdd0NSR3gM1gYelwl5LnoS+N2S+wtsRcR7EnxpMbAWI4kOHQM I82arjFz+pcQ/rKORY1NX1LipB5dW5IQSJFvnhVdqwf0iGAA1682eVhaqTc4xnkoo08T 4RC5JAwn06r+i6ZhRi/YGB5wQp0ZHjqgAhExk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=AjezaFV2EjIr5e8wtU94VkDiRqAFxlB7zFRuTRDu9uY=; b=b6orBUtlDLCNg2eeuSd1XTO7wlgeJm5mimcfxKvIrKdyfZRRdBAJaWBYdwbKbU+qs6 eNSKw7X6JfTHon9MSiKUAgvTTLjxcjjSQNZPrmmkgIfEaLcdGz6pt5/v5INYH2nR1e0/ nyZhpldrMtv7sHPDR9LXMuXbQynU6Dj3kFonTXwtcXvAyZsvfXx87Lmy0yOP1HEer7w1 YPiy91Pq2Z3IJWEe2NfsECqcrKcTs6XO8IrfI8gGLy9rK66wQzv2LvHl0ubdaFpL1IKn nlcgxohveXWW3FPTi3OL6x3S3JO8GI0sin3+HCx4/R8+QO7psNraNYL9KvT+svMJ4n7q 4hqA== X-Gm-Message-State: ALoCoQlBoHWr2Pj6K7AK82N93fNvpPbMb7VoQ8xvUxA2dJQrC5/ZWzfm5Ke0xSkWA9zhBhLmGCr6 X-Received: by 10.224.61.198 with SMTP id u6mr39235440qah.41.1387256135524; Mon, 16 Dec 2013 20:55:35 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.86.42 with HTTP; Mon, 16 Dec 2013 20:55:05 -0800 (PST) In-Reply-To: <201312161103.rBGB3xm4091806@svn.freebsd.org> References: <201312161103.rBGB3xm4091806@svn.freebsd.org> From: Eitan Adler Date: Mon, 16 Dec 2013 23:55:05 -0500 X-Google-Sender-Auth: lVLNo-p446VYTjEd1jqFwRnzz-E Message-ID: Subject: Re: svn commit: r259463 - in head/etc: defaults rc.d To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 04:55:36 -0000 On Mon, Dec 16, 2013 at 6:03 AM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Mon Dec 16 11:03:59 2013 > New Revision: 259463 > URL: http://svnweb.freebsd.org/changeset/base/259463 > > Log: > Start-up script for casperd daemon. > > Sponsored by: The FreeBSD Foundation > > Added: > head/etc/rc.d/casperd (contents, props changed) > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/Makefile > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Mon Dec 16 10:50:13 2013 (r259462) > +++ head/etc/defaults/rc.conf Mon Dec 16 11:03:59 2013 (r259463) > @@ -658,6 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a > newsyslog_flags="-CN" # Newsyslog flags to create marked files > mixer_enable="YES" # Run the sound mixer. > opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off > +casperd_enable="NO" # casperd(8) daemon Why is casper disabled by default? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 05:13:38 2013 Return-Path: Delivered-To: svn-src-all@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 78DBE70C; Tue, 17 Dec 2013 05:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 660F01A95; Tue, 17 Dec 2013 05:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH5DceL099491; Tue, 17 Dec 2013 05:13:38 GMT (envelope-from milki@svn.freebsd.org) Received: (from milki@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH5DcRJ099490; Tue, 17 Dec 2013 05:13:38 GMT (envelope-from milki@svn.freebsd.org) Message-Id: <201312170513.rBH5DcRJ099490@svn.freebsd.org> From: Jonathan Chu Date: Tue, 17 Dec 2013 05:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259495 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 05:13:38 -0000 Author: milki (ports committer) Date: Tue Dec 17 05:13:37 2013 New Revision: 259495 URL: http://svnweb.freebsd.org/changeset/base/259495 Log: milki is a new committer for ports. Approved by: swills (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Dec 17 04:26:20 2013 (r259494) +++ head/share/misc/committers-ports.dot Tue Dec 17 05:13:37 2013 (r259495) @@ -154,6 +154,7 @@ mat [label="Mathieu Arnold\nmat@FreeBSD. matthew [label="Matthew Seaman\nmatthew@FreeBSD.org\n2012/02/07"] mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] mharo [label="Michael Haro\nmharo@FreeBSD.org\n1999/04/13"] +milki [label="Jonathan Chu\nmilki@FreeBSD.org\n2013/12/15"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] mm [label="Martin Matuska\nmm@FreeBSD.org\n2007/04/04"] mnag [label="Marcus Alves Grando\nmnag@FreeBSD.org\n2005/09/15"] @@ -301,6 +302,7 @@ eadler -> antoine eadler -> dbn eadler -> bdrewery eadler -> gjb +eadler -> milki eadler -> tj eadler -> vg @@ -510,6 +512,7 @@ stas -> araujo steve -> netchild swills -> feld +swills -> milki swills -> pclin tabthorpe -> ashish From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 06:39:52 2013 Return-Path: Delivered-To: svn-src-all@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 4CE5E4A6; Tue, 17 Dec 2013 06:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3783311D1; Tue, 17 Dec 2013 06:39:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH6dq6e029261; Tue, 17 Dec 2013 06:39:52 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH6dnoo029247; Tue, 17 Dec 2013 06:39:49 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201312170639.rBH6dnoo029247@svn.freebsd.org> From: Peter Grehan Date: Tue, 17 Dec 2013 06:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259496 - in releng/10.0/usr.sbin: bhyve bhyveload X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 06:39:52 -0000 Author: grehan Date: Tue Dec 17 06:39:48 2013 New Revision: 259496 URL: http://svnweb.freebsd.org/changeset/base/259496 Log: MFStable-10 r259301 MFC r256657,r257018,r257347,r257423,r257729,r257767, r257933,r258609,r258614,r258668,r258673,r258855 Pull in some minor bugfixes and functionality enhancements from CURRENT. These are candidates to be moved to 10.0-release. r258855 mdoc: quote string properly. r258673 Don't create an initial value for the host filesystem of "/". r258668 Allow bhyve and bhyveload to attach to tty devices. r258614 The 22-bit Data Byte Count (DBC) field of a Physical Region Descriptor was being read as a 32-bit quantity by the bhyve AHCI driver. r258609 Fix discrepancy between the IOAPIC ID advertised by firmware tables and the actual value read by the guest. r257933 Route the legacy timer interrupt (IRQ0) to pin 2 of the IOAPIC. r257767 Fix an off-by-one error when iterating over the emulated PCI BARs. r257729 Add the VM name to the process name with setproctitle(). r257423 Make the virtual ioapic available unconditionally in a bhyve virtual machine. r257347 Update copyright to include the author of the LPC bridge emulation code. hand-merge r257018 Tidy usage messages for bhyve and bhyveload. r256657 Add an option to bhyveload(8) that allows setting a loader environment variable from the command line. Approved by: re@ (gjb) Modified: releng/10.0/usr.sbin/bhyve/acpi.c releng/10.0/usr.sbin/bhyve/acpi.h releng/10.0/usr.sbin/bhyve/bhyverun.c releng/10.0/usr.sbin/bhyve/block_if.c releng/10.0/usr.sbin/bhyve/mevent.c releng/10.0/usr.sbin/bhyve/mptbl.c releng/10.0/usr.sbin/bhyve/mptbl.h releng/10.0/usr.sbin/bhyve/pci_ahci.c releng/10.0/usr.sbin/bhyve/pci_emul.c releng/10.0/usr.sbin/bhyve/pci_virtio_net.c releng/10.0/usr.sbin/bhyve/pit_8254.c releng/10.0/usr.sbin/bhyve/uart_emul.c releng/10.0/usr.sbin/bhyveload/bhyveload.8 releng/10.0/usr.sbin/bhyveload/bhyveload.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/bhyve/acpi.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/acpi.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/acpi.c Tue Dec 17 06:39:48 2013 (r259496) @@ -253,13 +253,23 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "[0001]\t\tSubtable Type : 01\n"); EFPRINTF(fp, "[0001]\t\tLength : 0C\n"); /* iasl expects a hex value for the i/o apic id */ - EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", basl_ncpu); + EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", 0); EFPRINTF(fp, "[0001]\t\tReserved : 00\n"); EFPRINTF(fp, "[0004]\t\tAddress : fec00000\n"); EFPRINTF(fp, "[0004]\t\tInterrupt : 00000000\n"); EFPRINTF(fp, "\n"); - /* Override the 8259 chained vector. XXX maybe not needed */ + /* Legacy IRQ0 is connected to pin 2 of the IOAPIC */ + EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n"); + EFPRINTF(fp, "[0001]\t\tLength : 0A\n"); + EFPRINTF(fp, "[0001]\t\tBus : 00\n"); + EFPRINTF(fp, "[0001]\t\tSource : 00\n"); + EFPRINTF(fp, "[0004]\t\tInterrupt : 00000002\n"); + EFPRINTF(fp, "[0002]\t\tFlags (decoded below) : 0005\n"); + EFPRINTF(fp, "\t\t\tPolarity : 1\n"); + EFPRINTF(fp, "\t\t\tTrigger Mode : 1\n"); + EFPRINTF(fp, "\n"); + EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n"); EFPRINTF(fp, "[0001]\t\tLength : 0A\n"); EFPRINTF(fp, "[0001]\t\tBus : 00\n"); @@ -806,7 +816,7 @@ static struct { }; int -acpi_build(struct vmctx *ctx, int ncpu, int ioapic) +acpi_build(struct vmctx *ctx, int ncpu) { int err; int i; @@ -814,11 +824,6 @@ acpi_build(struct vmctx *ctx, int ncpu, err = 0; basl_ncpu = ncpu; - if (!ioapic) { - fprintf(stderr, "ACPI tables require an ioapic\n"); - return (EINVAL); - } - /* * For debug, allow the user to have iasl compiler output sent * to stdout rather than /dev/null Modified: releng/10.0/usr.sbin/bhyve/acpi.h ============================================================================== --- releng/10.0/usr.sbin/bhyve/acpi.h Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/acpi.h Tue Dec 17 06:39:48 2013 (r259496) @@ -29,6 +29,6 @@ #ifndef _ACPI_H_ #define _ACPI_H_ -int acpi_build(struct vmctx *ctx, int ncpu, int ioapic); +int acpi_build(struct vmctx *ctx, int ncpu); #endif /* _ACPI_H_ */ Modified: releng/10.0/usr.sbin/bhyve/bhyverun.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/bhyverun.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/bhyverun.c Tue Dec 17 06:39:48 2013 (r259496) @@ -132,7 +132,6 @@ usage(int code) " -c: # cpus (default 1)\n" " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" " -H: vmexit from the guest on hlt\n" - " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" " -W: force virtio to use single-vector MSI\n" " -e: exit on unhandled I/O access\n" @@ -191,7 +190,7 @@ fbsdrun_start_thread(void *param) mtp = param; vcpu = mtp->mt_vcpu; - snprintf(tname, sizeof(tname), "%s vcpu %d", vmname, vcpu); + snprintf(tname, sizeof(tname), "vcpu %d", vcpu); pthread_set_name_np(mtp->mt_thr, tname); vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip); @@ -543,7 +542,7 @@ fbsdrun_set_capabilities(struct vmctx *c int main(int argc, char *argv[]) { - int c, error, gdb_port, err, ioapic, bvmcons; + int c, error, gdb_port, err, bvmcons; int max_vcpus; struct vmctx *ctx; uint64_t rip; @@ -553,7 +552,6 @@ main(int argc, char *argv[]) progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; - ioapic = 0; memsize = 256 * MB; while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { @@ -601,7 +599,13 @@ main(int argc, char *argv[]) guest_vmexit_on_hlt = 1; break; case 'I': - ioapic = 1; + /* + * The "-I" option was used to add an ioapic to the + * virtual machine. + * + * An ioapic is now provided unconditionally for each + * virtual machine and this option is now deprecated. + */ break; case 'P': guest_vmexit_on_pause = 1; @@ -659,8 +663,7 @@ main(int argc, char *argv[]) if (init_pci(ctx) != 0) exit(1); - if (ioapic) - ioapic_init(0); + ioapic_init(0); if (gdb_port != 0) init_dbgport(gdb_port); @@ -674,14 +677,19 @@ main(int argc, char *argv[]) /* * build the guest tables, MP etc. */ - mptable_build(ctx, guest_ncpus, ioapic); + mptable_build(ctx, guest_ncpus); if (acpi) { - error = acpi_build(ctx, guest_ncpus, ioapic); + error = acpi_build(ctx, guest_ncpus); assert(error == 0); } /* + * Change the proc title to include the VM name. + */ + setproctitle("%s", vmname); + + /* * Add CPU 0 */ fbsdrun_addcpu(ctx, BSP, rip); Modified: releng/10.0/usr.sbin/bhyve/block_if.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/block_if.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/block_if.c Tue Dec 17 06:39:48 2013 (r259496) @@ -293,7 +293,7 @@ blockif_open(const char *optstr, const c pthread_create(&bc->bc_btid, NULL, blockif_thr, bc); - snprintf(tname, sizeof(tname), "%s blk-%s", vmname, ident); + snprintf(tname, sizeof(tname), "blk-%s", ident); pthread_set_name_np(bc->bc_btid, tname); return (bc); Modified: releng/10.0/usr.sbin/bhyve/mevent.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/mevent.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/mevent.c Tue Dec 17 06:39:48 2013 (r259496) @@ -381,10 +381,8 @@ mevent_delete_close(struct mevent *evp) static void mevent_set_name(void) { - char tname[MAXCOMLEN + 1]; - snprintf(tname, sizeof(tname), "%s mevent", vmname); - pthread_set_name_np(mevent_tid, tname); + pthread_set_name_np(mevent_tid, "mevent"); } void Modified: releng/10.0/usr.sbin/bhyve/mptbl.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/mptbl.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/mptbl.c Tue Dec 17 06:39:48 2013 (r259496) @@ -242,7 +242,7 @@ mptable_add_oemtbl(void *tbl, int tblsz) } int -mptable_build(struct vmctx *ctx, int ncpu, int ioapic) +mptable_build(struct vmctx *ctx, int ncpu) { mpcth_t mpch; bus_entry_ptr mpeb; @@ -278,15 +278,13 @@ mptable_build(struct vmctx *ctx, int ncp curraddr += sizeof(*mpeb) * MPE_NUM_BUSES; mpch->entry_count += MPE_NUM_BUSES; - if (ioapic) { - mpei = (io_apic_entry_ptr)curraddr; - mpt_build_ioapic_entries(mpei, ncpu + 1); - curraddr += sizeof(*mpei); - mpch->entry_count++; - } + mpei = (io_apic_entry_ptr)curraddr; + mpt_build_ioapic_entries(mpei, 0); + curraddr += sizeof(*mpei); + mpch->entry_count++; mpie = (int_entry_ptr) curraddr; - mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, ncpu + 1); + mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, 0); curraddr += sizeof(*mpie) * MPEII_MAX_IRQ; mpch->entry_count += MPEII_MAX_IRQ; Modified: releng/10.0/usr.sbin/bhyve/mptbl.h ============================================================================== --- releng/10.0/usr.sbin/bhyve/mptbl.h Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/mptbl.h Tue Dec 17 06:39:48 2013 (r259496) @@ -29,7 +29,7 @@ #ifndef _MPTBL_H_ #define _MPTBL_H_ -int mptable_build(struct vmctx *ctx, int ncpu, int ioapic); +int mptable_build(struct vmctx *ctx, int ncpu); void mptable_add_oemtbl(void *tbl, int tblsz); #endif /* _MPTBL_H_ */ Modified: releng/10.0/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/pci_ahci.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/pci_ahci.c Tue Dec 17 06:39:48 2013 (r259496) @@ -165,6 +165,7 @@ struct ahci_cmd_hdr { struct ahci_prdt_entry { uint64_t dba; uint32_t reserved; +#define DBCMASK 0x3fffff uint32_t dbc; }; @@ -461,10 +462,13 @@ ahci_handle_dma(struct ahci_port *p, int * Build up the iovec based on the prdt */ for (i = 0; i < iovcnt; i++) { + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); - breq->br_iov[i].iov_len = prdt->dbc + 1; - aior->done += (prdt->dbc + 1); + prdt->dba, dbcsz); + breq->br_iov[i].iov_len = dbcsz; + aior->done += dbcsz; prdt++; } if (readop) @@ -513,11 +517,14 @@ write_prdt(struct ahci_port *p, int slot from = buf; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); for (i = 0; i < hdr->prdtl && len; i++) { - uint8_t *ptr = paddr_guest2host(ahci_ctx(p->pr_sc), - prdt->dba, prdt->dbc + 1); - memcpy(ptr, from, prdt->dbc + 1); - len -= (prdt->dbc + 1); - from += (prdt->dbc + 1); + uint8_t *ptr; + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; + ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); + memcpy(ptr, from, dbcsz); + len -= dbcsz; + from += dbcsz; prdt++; } hdr->prdbc = size - len; @@ -908,10 +915,13 @@ atapi_read(struct ahci_port *p, int slot * Build up the iovec based on the prdt */ for (i = 0; i < iovcnt; i++) { + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); - breq->br_iov[i].iov_len = prdt->dbc + 1; - aior->done += (prdt->dbc + 1); + prdt->dba, dbcsz); + breq->br_iov[i].iov_len = dbcsz; + aior->done += dbcsz; prdt++; } err = blockif_read(p->bctx, breq); @@ -1714,11 +1724,9 @@ pci_ahci_init(struct vmctx *ctx, struct /* * Attempt to open the backing image. Use the PCI - * slot/func/ahci_port for the identifier string - * since that uniquely identifies a storage device. + * slot/func for the identifier string. */ - snprintf(bident, sizeof(bident), "%d:%d:%d", pi->pi_slot, pi->pi_func, - 0); + snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); bctxt = blockif_open(opts, bident); if (bctxt == NULL) { ret = 1; Modified: releng/10.0/usr.sbin/bhyve/pci_emul.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/pci_emul.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/pci_emul.c Tue Dec 17 06:39:48 2013 (r259496) @@ -1252,7 +1252,7 @@ pci_emul_cmdwrite(struct pci_devinst *pi * If the MMIO or I/O address space decoding has changed then * register/unregister all BARs that decode that address space. */ - for (i = 0; i < PCI_BARMAX; i++) { + for (i = 0; i <= PCI_BARMAX; i++) { switch (pi->pi_bar[i].type) { case PCIBAR_NONE: case PCIBAR_MEMHI64: Modified: releng/10.0/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/pci_virtio_net.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/pci_virtio_net.c Tue Dec 17 06:39:48 2013 (r259496) @@ -588,7 +588,7 @@ pci_vtnet_init(struct vmctx *ctx, struct */ if (!mac_provided) { snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); + pi->pi_func, vmname); MD5Init(&mdctx); MD5Update(&mdctx, nstr, strlen(nstr)); @@ -632,7 +632,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pthread_mutex_init(&sc->tx_mtx, NULL); pthread_cond_init(&sc->tx_cond, NULL); pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); - snprintf(tname, sizeof(tname), "%s vtnet%d tx", vmname, pi->pi_slot); + snprintf(tname, sizeof(tname), "vtnet-%d:%d tx", pi->pi_slot, + pi->pi_func); pthread_set_name_np(sc->tx_tid, tname); return (0); Modified: releng/10.0/usr.sbin/bhyve/pit_8254.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/pit_8254.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/pit_8254.c Tue Dec 17 06:39:48 2013 (r259496) @@ -106,8 +106,8 @@ pit_mevent_cb(int fd, enum ev_type type, pit_mev_count++; - ioapic_assert_pin(c->ctx, 0); - ioapic_deassert_pin(c->ctx, 0); + ioapic_assert_pin(c->ctx, 2); + ioapic_deassert_pin(c->ctx, 2); /* * Delete the timer for one-shots Modified: releng/10.0/usr.sbin/bhyve/uart_emul.c ============================================================================== --- releng/10.0/usr.sbin/bhyve/uart_emul.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyve/uart_emul.c Tue Dec 17 06:39:48 2013 (r259496) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #define FIFOSZ 16 static bool uart_stdio; /* stdio in use for i/o */ +static struct termios tio_stdio_orig; static struct { int baseaddr; @@ -87,6 +89,12 @@ struct fifo { int size; /* size of the fifo */ }; +struct ttyfd { + bool opened; + int fd; /* tty device file descriptor */ + struct termios tio_orig, tio_new; /* I/O Terminals */ +}; + struct uart_softc { pthread_mutex_t mtx; /* protects all softc elements */ uint8_t data; /* Data register (R/W) */ @@ -103,8 +111,7 @@ struct uart_softc { struct fifo rxfifo; - bool opened; - bool stdio; + struct ttyfd tty; bool thre_int_pending; /* THRE interrupt pending */ void *arg; @@ -114,38 +121,41 @@ struct uart_softc { static void uart_drain(int fd, enum ev_type ev, void *arg); -static struct termios tio_orig, tio_new; /* I/O Terminals */ - static void ttyclose(void) { - tcsetattr(STDIN_FILENO, TCSANOW, &tio_orig); + tcsetattr(STDIN_FILENO, TCSANOW, &tio_stdio_orig); } static void -ttyopen(void) +ttyopen(struct ttyfd *tf) { - tcgetattr(STDIN_FILENO, &tio_orig); + tcgetattr(tf->fd, &tf->tio_orig); - cfmakeraw(&tio_new); - tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); + tf->tio_new = tf->tio_orig; + cfmakeraw(&tf->tio_new); + tf->tio_new.c_cflag |= CLOCAL; + tcsetattr(tf->fd, TCSANOW, &tf->tio_new); - atexit(ttyclose); + if (tf->fd == STDIN_FILENO) { + tio_stdio_orig = tf->tio_orig; + atexit(ttyclose); + } } static bool -tty_char_available(void) +tty_char_available(struct ttyfd *tf) { fd_set rfds; struct timeval tv; FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); + FD_SET(tf->fd, &rfds); tv.tv_sec = 0; tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0 ) { + if (select(tf->fd + 1, &rfds, NULL, NULL, &tv) > 0 ) { return (true); } else { return (false); @@ -153,12 +163,12 @@ tty_char_available(void) } static int -ttyread(void) +ttyread(struct ttyfd *tf) { char rb; - if (tty_char_available()) { - read(STDIN_FILENO, &rb, 1); + if (tty_char_available(tf)) { + read(tf->fd, &rb, 1); return (rb & 0xff); } else { return (-1); @@ -166,10 +176,10 @@ ttyread(void) } static void -ttywrite(unsigned char wb) +ttywrite(struct ttyfd *tf, unsigned char wb) { - (void)write(STDIN_FILENO, &wb, 1); + (void)write(tf->fd, &wb, 1); } static void @@ -226,10 +236,8 @@ uart_opentty(struct uart_softc *sc) { struct mevent *mev; - assert(!sc->opened && sc->stdio); - - ttyopen(); - mev = mevent_add(STDIN_FILENO, EVF_READ, uart_drain, sc); + ttyopen(&sc->tty); + mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); assert(mev); } @@ -294,7 +302,7 @@ uart_drain(int fd, enum ev_type ev, void sc = arg; - assert(fd == STDIN_FILENO); + assert(fd == sc->tty.fd); assert(ev == EVF_READ); /* @@ -305,10 +313,10 @@ uart_drain(int fd, enum ev_type ev, void pthread_mutex_lock(&sc->mtx); if ((sc->mcr & MCR_LOOPBACK) != 0) { - (void) ttyread(); + (void) ttyread(&sc->tty); } else { while (fifo_available(&sc->rxfifo) && - ((ch = ttyread()) != -1)) { + ((ch = ttyread(&sc->tty)) != -1)) { fifo_putchar(&sc->rxfifo, ch); } uart_toggle_intr(sc); @@ -323,12 +331,6 @@ uart_write(struct uart_softc *sc, int of int fifosz; uint8_t msr; - /* Open terminal */ - if (!sc->opened && sc->stdio) { - uart_opentty(sc); - sc->opened = true; - } - pthread_mutex_lock(&sc->mtx); /* @@ -351,8 +353,8 @@ uart_write(struct uart_softc *sc, int of if (sc->mcr & MCR_LOOPBACK) { if (fifo_putchar(&sc->rxfifo, value) != 0) sc->lsr |= LSR_OE; - } else if (sc->stdio) { - ttywrite(value); + } else if (sc->tty.opened) { + ttywrite(&sc->tty, value); } /* else drop on floor */ sc->thre_int_pending = true; break; @@ -459,12 +461,6 @@ uart_read(struct uart_softc *sc, int off { uint8_t iir, intr_reason, reg; - /* Open terminal */ - if (!sc->opened && sc->stdio) { - uart_opentty(sc); - sc->opened = true; - } - pthread_mutex_lock(&sc->mtx); /* @@ -581,19 +577,47 @@ uart_init(uart_intr_func_t intr_assert, return (sc); } +static int +uart_tty_backend(struct uart_softc *sc, const char *opts) +{ + int fd; + int retval; + + retval = -1; + + fd = open(opts, O_RDWR); + if (fd > 0 && isatty(fd)) { + sc->tty.fd = fd; + sc->tty.opened = true; + retval = 0; + } + + return (retval); +} + int uart_set_backend(struct uart_softc *sc, const char *opts) { - /* - * XXX one stdio backend supported at this time. - */ + int retval; + + retval = -1; + if (opts == NULL) return (0); - if (strcmp("stdio", opts) == 0 && !uart_stdio) { - sc->stdio = true; - uart_stdio = true; - return (0); - } else - return (-1); + if (strcmp("stdio", opts) == 0) { + if (!uart_stdio) { + sc->tty.fd = STDIN_FILENO; + sc->tty.opened = true; + uart_stdio = true; + retval = 0; + } + } else if (uart_tty_backend(sc, opts) == 0) { + retval = 0; + } + + if (retval == 0) + uart_opentty(sc); + + return (retval); } Modified: releng/10.0/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- releng/10.0/usr.sbin/bhyveload/bhyveload.8 Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyveload/bhyveload.8 Tue Dec 17 06:39:48 2013 (r259496) @@ -38,6 +38,8 @@ guest inside a bhyve virtual machine .Op Fl m Ar mem-size .Op Fl d Ar disk-path .Op Fl h Ar host-path +.Op Fl e Ar name=value +.Op Fl c Ar cons-dev .Ar vmname .Sh DESCRIPTION .Nm @@ -91,6 +93,24 @@ is the pathname of the guest's boot disk The .Ar host-path is the directory at the top of the guest's boot filesystem. +.It Fl e Ar name=value +Set the FreeBSD loader environment variable +.Ar name +to +.Ar value . +.Pp +The option may be used more than once to set more than one environment +variable. +.It Fl c Ar cons-dev +.Ar cons-dev +is a +.Xr tty 4 +device to use for +.Nm +terminal I/O. +.Pp +The text string "stdio" is also accepted and selects the use of +unbuffered standard I/O. This is the default value. .El .Sh EXAMPLES To create a virtual machine named @@ -100,10 +120,23 @@ that boots off the ISO image and has 1GB memory allocated to it: .Pp .Dl "bhyveload -m 1G -d /freebsd/release.iso freebsd-vm" +.Pp +To create a virtual machine named +.Ar test-vm +with 256MB of memory allocated, the guest root filesystem under the host +directory +.Pa /user/images/test +and terminal I/O sent to the +.Xr nmdm 4 +device +.Pa /dev/nmdm1B +.Pp +.Dl "bhyveload -m 256MB -h /usr/images/test -c /dev/nmdm1B test-vm" .Sh SEE ALSO .Xr bhyve 4 , .Xr bhyve 8 , .Xr loader 8 , +.Xr nmdm 4, .Xr vmm 4 .Sh HISTORY .Nm Modified: releng/10.0/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- releng/10.0/usr.sbin/bhyveload/bhyveload.c Tue Dec 17 05:13:37 2013 (r259495) +++ releng/10.0/usr.sbin/bhyveload/bhyveload.c Tue Dec 17 06:39:48 2013 (r259496) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -86,9 +88,10 @@ __FBSDID("$FreeBSD$"); #define GB (1024 * 1024 * 1024UL) #define BSP 0 -static char *host_base = "/"; +static char *host_base; static struct termios term, oldterm; static int disk_fd = -1; +static int consin_fd, consout_fd; static char *vmname, *progname; static struct vmctx *ctx; @@ -106,7 +109,7 @@ cb_putc(void *arg, int ch) { char c = ch; - write(1, &c, 1); + (void) write(consout_fd, &c, 1); } static int @@ -114,7 +117,7 @@ cb_getc(void *arg) { char c; - if (read(0, &c, 1) == 1) + if (read(consin_fd, &c, 1) == 1) return (c); return (-1); } @@ -124,7 +127,7 @@ cb_poll(void *arg) { int n; - if (ioctl(0, FIONREAD, &n) >= 0) + if (ioctl(consin_fd, FIONREAD, &n) >= 0) return (n > 0); return (0); } @@ -486,7 +489,7 @@ static void cb_exit(void *arg, int v) { - tcsetattr(0, TCSAFLUSH, &oldterm); + tcsetattr(consout_fd, TCSAFLUSH, &oldterm); exit(v); } @@ -498,23 +501,37 @@ cb_getmem(void *arg, uint64_t *ret_lowme vm_get_memory_seg(ctx, 4 * GB, ret_highmem, NULL); } +struct env { + const char *str; /* name=value */ + SLIST_ENTRY(env) next; +}; + +static SLIST_HEAD(envhead, env) envhead; + +static void +addenv(const char *str) +{ + struct env *env; + + env = malloc(sizeof(struct env)); + env->str = str; + SLIST_INSERT_HEAD(&envhead, env, next); +} + static const char * cb_getenv(void *arg, int num) { - int max; - - static const char * var[] = { - "smbios.bios.vendor=BHYVE", - "boot_serial=1", - NULL - }; + int i; + struct env *env; - max = sizeof(var) / sizeof(var[0]); + i = 0; + SLIST_FOREACH(env, &envhead, next) { + if (i == num) + return (env->str); + i++; + } - if (num < max) - return (var[num]); - else - return (NULL); + return (NULL); } static struct loader_callbacks cb = { @@ -548,13 +565,46 @@ static struct loader_callbacks cb = { .getenv = cb_getenv, }; +static int +altcons_open(char *path) +{ + struct stat sb; + int err; + int fd; + + /* + * Allow stdio to be passed in so that the same string + * can be used for the bhyveload console and bhyve com-port + * parameters + */ + if (!strcmp(path, "stdio")) + return (0); + + err = stat(path, &sb); + if (err == 0) { + if (!S_ISCHR(sb.st_mode)) + err = ENOTSUP; + else { + fd = open(path, O_RDWR | O_NONBLOCK); + if (fd < 0) + err = errno; + else + consin_fd = consout_fd = fd; + } + } + + return (err); +} + static void usage(void) { fprintf(stderr, - "usage: %s [-m mem-size][-d ] [-h ] " - "\n", progname); + "usage: %s [-m mem-size] [-d ] [-h ]\n" + " %*s [-e ] [-c ] \n", + progname, + (int)strlen(progname), ""); exit(1); } @@ -567,17 +617,29 @@ main(int argc, char** argv) int opt, error; char *disk_image; - progname = argv[0]; + progname = basename(argv[0]); mem_size = 256 * MB; disk_image = NULL; - while ((opt = getopt(argc, argv, "d:h:m:")) != -1) { + consin_fd = STDIN_FILENO; + consout_fd = STDOUT_FILENO; + + while ((opt = getopt(argc, argv, "c:d:e:h:m:")) != -1) { switch (opt) { + case 'c': + error = altcons_open(optarg); + if (error != 0) + errx(EX_USAGE, "Could not open '%s'", optarg); + break; case 'd': disk_image = optarg; break; + case 'e': + addenv(optarg); + break; + case 'h': host_base = optarg; break; @@ -619,11 +681,13 @@ main(int argc, char** argv) exit(1); } - tcgetattr(0, &term); + tcgetattr(consout_fd, &term); oldterm = term; - term.c_lflag &= ~(ICANON|ECHO); - term.c_iflag &= ~ICRNL; - tcsetattr(0, TCSAFLUSH, &term); + cfmakeraw(&term); + term.c_cflag |= CLOCAL; + + tcsetattr(consout_fd, TCSAFLUSH, &term); + h = dlopen("/boot/userboot.so", RTLD_LOCAL); if (!h) { printf("%s\n", dlerror()); @@ -638,5 +702,9 @@ main(int argc, char** argv) if (disk_image) { disk_fd = open(disk_image, O_RDONLY); } + + addenv("smbios.bios.vendor=BHYVE"); + addenv("boot_serial=1"); + func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 07:47:28 2013 Return-Path: Delivered-To: svn-src-all@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 1AB4F20D; Tue, 17 Dec 2013 07:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E102A169B; Tue, 17 Dec 2013 07:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH7lRaS053647; Tue, 17 Dec 2013 07:47:27 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH7lRKG053646; Tue, 17 Dec 2013 07:47:27 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312170747.rBH7lRKG053646@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Dec 2013 07:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259497 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 07:47:28 -0000 Author: pluknet Date: Tue Dec 17 07:47:27 2013 New Revision: 259497 URL: http://svnweb.freebsd.org/changeset/base/259497 Log: Nuke symbols.raw This file seems to be unused since the switch to the ELF binary format. Discussed with: jhb Deleted: head/sys/i386/i386/symbols.raw From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 07:59:01 2013 Return-Path: Delivered-To: svn-src-all@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 31DF3407; Tue, 17 Dec 2013 07:59:01 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D760173F; Tue, 17 Dec 2013 07:59:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH7x0JK057236; Tue, 17 Dec 2013 07:59:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH7x05p057235; Tue, 17 Dec 2013 07:59:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312170759.rBH7x05p057235@svn.freebsd.org> From: Dimitry Andric Date: Tue, 17 Dec 2013 07:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259498 - head/contrib/llvm/tools/clang/lib/Headers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 07:59:01 -0000 Author: dim Date: Tue Dec 17 07:59:00 2013 New Revision: 259498 URL: http://svnweb.freebsd.org/changeset/base/259498 Log: Pull in r197399 from upstream clang trunk: Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Modified: head/contrib/llvm/tools/clang/lib/Headers/cpuid.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Tue Dec 17 07:47:27 2013 (r259497) +++ head/contrib/llvm/tools/clang/lib/Headers/cpuid.h Tue Dec 17 07:59:00 2013 (r259498) @@ -79,6 +79,7 @@ #define bit_ACPI 0x00400000 #define bit_MMX 0x00800000 #define bit_FXSR 0x01000000 +#define bit_FXSAVE bit_FXSR /* for gcc compat */ #define bit_SSE 0x02000000 #define bit_SSE2 0x04000000 #define bit_SS 0x08000000 From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 09:21:57 2013 Return-Path: Delivered-To: svn-src-all@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 256229F5; Tue, 17 Dec 2013 09:21:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA7501E5D; Tue, 17 Dec 2013 09:21:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH9LuRH089565; Tue, 17 Dec 2013 09:21:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH9LunD089563; Tue, 17 Dec 2013 09:21:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312170921.rBH9LunD089563@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 09:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259499 - in stable/10/sys: kern vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 09:21:57 -0000 Author: kib Date: Tue Dec 17 09:21:56 2013 New Revision: 259499 URL: http://svnweb.freebsd.org/changeset/base/259499 Log: MFC r258039: Avoid overflow for the page counts. MFC r258365: Revert back to use int for the page counts. Rearrange the checks to correctly handle overflowing address arithmetic. Modified: stable/10/sys/kern/vfs_vnops.c stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Tue Dec 17 07:59:00 2013 (r259498) +++ stable/10/sys/kern/vfs_vnops.c Tue Dec 17 09:21:56 2013 (r259499) @@ -933,7 +933,7 @@ vn_io_fault(struct file *fp, struct uio void *rl_cookie; struct mount *mp; vm_page_t *prev_td_ma; - int cnt, error, save, saveheld, prev_td_ma_cnt; + int error, cnt, save, saveheld, prev_td_ma_cnt; vm_offset_t addr, end; vm_prot_t prot; size_t len, resid; @@ -1007,21 +1007,20 @@ vn_io_fault(struct file *fp, struct uio uio_clone->uio_iovcnt--; continue; } - - addr = (vm_offset_t)uio_clone->uio_iov->iov_base; + if (len > io_hold_cnt * PAGE_SIZE) + len = io_hold_cnt * PAGE_SIZE; + addr = (uintptr_t)uio_clone->uio_iov->iov_base; end = round_page(addr + len); - cnt = howmany(end - trunc_page(addr), PAGE_SIZE); + if (end < addr) { + error = EFAULT; + break; + } + cnt = atop(end - trunc_page(addr)); /* * A perfectly misaligned address and length could cause * both the start and the end of the chunk to use partial * page. +2 accounts for such a situation. */ - if (cnt > io_hold_cnt + 2) { - len = io_hold_cnt * PAGE_SIZE; - KASSERT(howmany(round_page(addr + len) - - trunc_page(addr), PAGE_SIZE) <= io_hold_cnt + 2, - ("cnt overflow")); - } cnt = vm_fault_quick_hold_pages(&td->td_proc->p_vmspace->vm_map, addr, len, prot, ma, io_hold_cnt + 2); if (cnt == -1) { Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Tue Dec 17 07:59:00 2013 (r259498) +++ stable/10/sys/vm/vm_fault.c Tue Dec 17 09:21:56 2013 (r259499) @@ -1079,7 +1079,7 @@ vm_fault_quick_hold_pages(vm_map_t map, if (len == 0) return (0); - end = round_page(addr + len); + end = round_page(addr + len); addr = trunc_page(addr); /* @@ -1088,9 +1088,9 @@ vm_fault_quick_hold_pages(vm_map_t map, if (addr < vm_map_min(map) || addr > end || end > vm_map_max(map)) return (-1); - count = howmany(end - addr, PAGE_SIZE); - if (count > max_count) + if (atop(end - addr) > max_count) panic("vm_fault_quick_hold_pages: count > max_count"); + count = atop(end - addr); /* * Most likely, the physical pages are resident in the pmap, so it is From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 09:22:26 2013 Return-Path: Delivered-To: svn-src-all@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 CBA6CB26; Tue, 17 Dec 2013 09:22:26 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0841E63; Tue, 17 Dec 2013 09:22:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBH9MQM0089715; Tue, 17 Dec 2013 09:22:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBH9MQos089713; Tue, 17 Dec 2013 09:22:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312170922.rBH9MQos089713@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 09:22:26 +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: r259500 - in stable/9/sys: kern vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 09:22:26 -0000 Author: kib Date: Tue Dec 17 09:22:25 2013 New Revision: 259500 URL: http://svnweb.freebsd.org/changeset/base/259500 Log: MFC r258039: Avoid overflow for the page counts. MFC r258365: Revert back to use int for the page counts. Rearrange the checks to correctly handle overflowing address arithmetic. Modified: stable/9/sys/kern/vfs_vnops.c stable/9/sys/vm/vm_fault.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Tue Dec 17 09:21:56 2013 (r259499) +++ stable/9/sys/kern/vfs_vnops.c Tue Dec 17 09:22:25 2013 (r259500) @@ -891,7 +891,7 @@ vn_io_fault(struct file *fp, struct uio void *rl_cookie; struct mount *mp; vm_page_t *prev_td_ma; - int cnt, error, save, saveheld, prev_td_ma_cnt; + int error, cnt, save, saveheld, prev_td_ma_cnt; vm_offset_t addr, end; vm_prot_t prot; size_t len, resid; @@ -965,21 +965,20 @@ vn_io_fault(struct file *fp, struct uio uio_clone->uio_iovcnt--; continue; } - - addr = (vm_offset_t)uio_clone->uio_iov->iov_base; + if (len > io_hold_cnt * PAGE_SIZE) + len = io_hold_cnt * PAGE_SIZE; + addr = (uintptr_t)uio_clone->uio_iov->iov_base; end = round_page(addr + len); - cnt = howmany(end - trunc_page(addr), PAGE_SIZE); + if (end < addr) { + error = EFAULT; + break; + } + cnt = atop(end - trunc_page(addr)); /* * A perfectly misaligned address and length could cause * both the start and the end of the chunk to use partial * page. +2 accounts for such a situation. */ - if (cnt > io_hold_cnt + 2) { - len = io_hold_cnt * PAGE_SIZE; - KASSERT(howmany(round_page(addr + len) - - trunc_page(addr), PAGE_SIZE) <= io_hold_cnt + 2, - ("cnt overflow")); - } cnt = vm_fault_quick_hold_pages(&td->td_proc->p_vmspace->vm_map, addr, len, prot, ma, io_hold_cnt + 2); if (cnt == -1) { Modified: stable/9/sys/vm/vm_fault.c ============================================================================== --- stable/9/sys/vm/vm_fault.c Tue Dec 17 09:21:56 2013 (r259499) +++ stable/9/sys/vm/vm_fault.c Tue Dec 17 09:22:25 2013 (r259500) @@ -1121,7 +1121,7 @@ vm_fault_quick_hold_pages(vm_map_t map, if (len == 0) return (0); - end = round_page(addr + len); + end = round_page(addr + len); addr = trunc_page(addr); /* @@ -1130,9 +1130,9 @@ vm_fault_quick_hold_pages(vm_map_t map, if (addr < vm_map_min(map) || addr > end || end > vm_map_max(map)) return (-1); - count = howmany(end - addr, PAGE_SIZE); - if (count > max_count) + if (atop(end - addr) > max_count) panic("vm_fault_quick_hold_pages: count > max_count"); + count = atop(end - addr); /* * Most likely, the physical pages are resident in the pmap, so it is From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 10:33:28 2013 Return-Path: Delivered-To: svn-src-all@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 5E2AF328; Tue, 17 Dec 2013 10:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7BA144D; Tue, 17 Dec 2013 10:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHAXSCt015280; Tue, 17 Dec 2013 10:33:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHAXScc015279; Tue, 17 Dec 2013 10:33:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312171033.rBHAXScc015279@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 17 Dec 2013 10:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259502 - head/sbin/iscontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 10:33:28 -0000 Author: trasz Date: Tue Dec 17 10:33:27 2013 New Revision: 259502 URL: http://svnweb.freebsd.org/changeset/base/259502 Log: Reword the part about mutual CHAP. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sbin/iscontrol/iscsi.conf.5 Modified: head/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- head/sbin/iscontrol/iscsi.conf.5 Tue Dec 17 10:03:04 2013 (r259501) +++ head/sbin/iscontrol/iscsi.conf.5 Tue Dec 17 10:33:27 2013 (r259502) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2013 +.Dd December 17, 2013 .Dt ISCSI.CONF 5 .Os .Sh NAME @@ -145,10 +145,9 @@ the chap-name, defaults to .Em hostname . .It Cm chapDigest can be MD5 or SHA1. -.It Cm tgtChapSecret/tgtChapName -same as the none -.Em tgt -counterpart, but to authenticate the target. +.It Cm tgtChapName/tgtChapSecret +name and secret used for mutual CHAP; by default, mutual CHAP +is not used. .El .Sh FILES .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 10:53:18 2013 Return-Path: Delivered-To: svn-src-all@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 2298791A; Tue, 17 Dec 2013 10:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F13315E2; Tue, 17 Dec 2013 10:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHArHEr022370; Tue, 17 Dec 2013 10:53:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHArHM8022369; Tue, 17 Dec 2013 10:53:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312171053.rBHArHM8022369@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 17 Dec 2013 10:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259503 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 10:53:18 -0000 Author: ae Date: Tue Dec 17 10:53:17 2013 New Revision: 259503 URL: http://svnweb.freebsd.org/changeset/base/259503 Log: Free mbuf in case of error. MFC after: 1 week Modified: head/sys/netinet6/send.c Modified: head/sys/netinet6/send.c ============================================================================== --- head/sys/netinet6/send.c Tue Dec 17 10:33:27 2013 (r259502) +++ head/sys/netinet6/send.c Tue Dec 17 10:53:17 2013 (r259503) @@ -163,6 +163,7 @@ send_output(struct mbuf *m, struct ifnet nd6_ra_input(m, sizeof(struct ip6_hdr), icmp6len); break; default: + m_freem(m); return (ENOSYS); } return (0); From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 11:15:10 2013 Return-Path: Delivered-To: svn-src-all@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 61A54F55; Tue, 17 Dec 2013 11:15:10 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 846C5177E; Tue, 17 Dec 2013 11:15:09 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id z2so3509170wiv.7 for ; Tue, 17 Dec 2013 03:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mNd4Cb2Sn19M7agcgqABwtLFDsWFpNpWgFj1kzz9zyM=; b=ToHK98YsOd1hxhT9EFm+x6VOIuD2+MMrkXWjvYBh4EWTVVeHr++oJxmH/XjGGhJxTx gIeCf4ZPCll29EgRMEORmBaOXuA3xOj4ubu5S9r84MTKzzq4EMs6NX9MW4J8ZiMTMlFp EJ4s4YhfcychRN6Mu2IFJry5YY69H7MkUU1aEXpeCsmOfDq+XUO6cDnrYZqdwI7cJ0ft HLJl7crLwtOvOqFRl6ewR309/cMrIp0itfH8wyEPuGGs+gwK2LcByiz0pwy0FCJmQTOv QnJoZ2YdkuscXtpA0o3pKL4q6M7vPMXkulAinJk7ULuZtaLwhDdTjDLf0uQANGdNlIy0 a+KQ== MIME-Version: 1.0 X-Received: by 10.194.237.226 with SMTP id vf2mr12055913wjc.58.1387278907996; Tue, 17 Dec 2013 03:15:07 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.217.64.198 with HTTP; Tue, 17 Dec 2013 03:15:07 -0800 (PST) In-Reply-To: <201312150837.rBF8bON1011577@svn.freebsd.org> References: <201312150837.rBF8bON1011577@svn.freebsd.org> Date: Tue, 17 Dec 2013 15:15:07 +0400 X-Google-Sender-Auth: txMFFxnHx9x6PlmwrzaZRG1t4QQ Message-ID: Subject: Re: svn commit: r259412 - in head/sys: conf dev/netmap modules/netmap net From: Sergey Kandaurov To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 11:15:10 -0000 On 15 December 2013 12:37, Luigi Rizzo wrote: > Author: luigi > Date: Sun Dec 15 08:37:24 2013 > New Revision: 259412 > URL: http://svnweb.freebsd.org/changeset/base/259412 > > Log: > split netmap code according to functions: > - netmap.c base code > - netmap_freebsd.c FreeBSD-specific code > - netmap_generic.c emulate netmap over standard drivers > - netmap_mbq.c simple mbuf tailq > - netmap_mem2.c memory management > - netmap_vale.c VALE switch > > simplify devce-specific code > This breaks VIMAGE due to removal of necessary includes in netmap.c. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:10:28 2013 Return-Path: Delivered-To: svn-src-all@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 AF553E50; Tue, 17 Dec 2013 13:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B11C1084; Tue, 17 Dec 2013 13:10:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDAS4B070537; Tue, 17 Dec 2013 13:10:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDASYK070536; Tue, 17 Dec 2013 13:10:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171310.rBHDASYK070536@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:10: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: r259506 - stable/10/sys/fs/pseudofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:10:28 -0000 Author: kib Date: Tue Dec 17 13:10:28 2013 New Revision: 259506 URL: http://svnweb.freebsd.org/changeset/base/259506 Log: MFC r258088: Add check for buflen overflow by comparing the buflen with both offset and resid. MFC r258397: Redo r258088 to avoid relying on signed arithmetic overflow. Modified: stable/10/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/10/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 17 13:02:23 2013 (r259505) +++ stable/10/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 17 13:10:28 2013 (r259506) @@ -616,8 +616,7 @@ pfs_read(struct vop_read_args *va) struct proc *proc; struct sbuf *sb = NULL; int error, locked; - off_t offset; - ssize_t buflen, resid; + off_t buflen; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); @@ -654,14 +653,12 @@ pfs_read(struct vop_read_args *va) goto ret; } - /* beaucoup sanity checks so we don't ask for bogus allocation */ - if (uio->uio_offset < 0 || uio->uio_resid < 0 || - (offset = uio->uio_offset) != uio->uio_offset || - (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid) < offset || buflen >= INT_MAX) { + if (uio->uio_resid < 0 || uio->uio_offset < 0 || + uio->uio_resid > OFF_MAX - uio->uio_offset) { error = EINVAL; goto ret; } + buflen = uio->uio_offset + uio->uio_resid; if (buflen > MAXPHYS) buflen = MAXPHYS; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:13:03 2013 Return-Path: Delivered-To: svn-src-all@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 218B2FD0; Tue, 17 Dec 2013 13:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CDAF10F0; Tue, 17 Dec 2013 13:13:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDD2B5073310; Tue, 17 Dec 2013 13:13:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDD2VT073309; Tue, 17 Dec 2013 13:13:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171313.rBHDD2VT073309@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:13:02 +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: r259507 - stable/9/sys/fs/pseudofs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:13:03 -0000 Author: kib Date: Tue Dec 17 13:13:02 2013 New Revision: 259507 URL: http://svnweb.freebsd.org/changeset/base/259507 Log: MFC r258088: Add check for buflen overflow by comparing the buflen with both offset and resid. MFC r258397: Redo r258088 to avoid relying on signed arithmetic overflow. Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 17 13:10:28 2013 (r259506) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Tue Dec 17 13:13:02 2013 (r259507) @@ -616,8 +616,7 @@ pfs_read(struct vop_read_args *va) struct proc *proc; struct sbuf *sb = NULL; int error, locked; - off_t offset; - ssize_t buflen, resid; + off_t buflen; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); @@ -654,14 +653,12 @@ pfs_read(struct vop_read_args *va) goto ret; } - /* beaucoup sanity checks so we don't ask for bogus allocation */ - if (uio->uio_offset < 0 || uio->uio_resid < 0 || - (offset = uio->uio_offset) != uio->uio_offset || - (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid) < offset || buflen >= INT_MAX) { + if (uio->uio_resid < 0 || uio->uio_offset < 0 || + uio->uio_resid > OFF_MAX - uio->uio_offset) { error = EINVAL; goto ret; } + buflen = uio->uio_offset + uio->uio_resid; if (buflen > MAXPHYS) buflen = MAXPHYS; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:18:42 2013 Return-Path: Delivered-To: svn-src-all@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 2B04A785; Tue, 17 Dec 2013 13:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0ADF71171; Tue, 17 Dec 2013 13:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDIfSA074033; Tue, 17 Dec 2013 13:18:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDIfXO074028; Tue, 17 Dec 2013 13:18:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171318.rBHDIfXO074028@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:18: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: r259508 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:18:42 -0000 Author: kib Date: Tue Dec 17 13:18:41 2013 New Revision: 259508 URL: http://svnweb.freebsd.org/changeset/base/259508 Log: MFC r257541: Fix several issues with the busdma(9) KPI use in the e1000 drivers. Modified: stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Tue Dec 17 13:13:02 2013 (r259507) +++ stable/10/sys/dev/e1000/if_em.c Tue Dec 17 13:18:41 2013 (r259508) @@ -4059,8 +4059,7 @@ em_allocate_receive_buffers(struct rx_ri rxbuf = rxr->rx_buffers; for (int i = 0; i < adapter->num_rx_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->rxtag, BUS_DMA_NOWAIT, - &rxbuf->map); + error = bus_dmamap_create(rxr->rxtag, 0, &rxbuf->map); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); @@ -4465,6 +4464,7 @@ em_rxeof(struct rx_ring *rxr, int count, em_rx_discard(rxr, i); goto next_desc; } + bus_dmamap_unload(rxr->rxtag, rxr->rx_buffers[i].map); /* Assign correct length to the current fragment */ mp = rxr->rx_buffers[i].m_head; @@ -4551,6 +4551,8 @@ em_rx_discard(struct rx_ring *rxr, int i struct em_buffer *rbuf; rbuf = &rxr->rx_buffers[i]; + bus_dmamap_unload(rxr->rxtag, rbuf->map); + /* Free any previous pieces */ if (rxr->fmp != NULL) { rxr->fmp->m_flags |= M_PKTHDR; Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Tue Dec 17 13:13:02 2013 (r259507) +++ stable/10/sys/dev/e1000/if_igb.c Tue Dec 17 13:18:41 2013 (r259508) @@ -3996,7 +3996,6 @@ igb_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } buf->eop = NULL; ++txr->tx_avail; @@ -4022,7 +4021,6 @@ igb_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } ++txr->tx_avail; buf->eop = NULL; @@ -4230,15 +4228,13 @@ igb_allocate_receive_buffers(struct rx_r for (i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->htag, - BUS_DMA_NOWAIT, &rxbuf->hmap); + error = bus_dmamap_create(rxr->htag, 0, &rxbuf->hmap); if (error) { device_printf(dev, "Unable to create RX head DMA maps\n"); goto fail; } - error = bus_dmamap_create(rxr->ptag, - BUS_DMA_NOWAIT, &rxbuf->pmap); + error = bus_dmamap_create(rxr->ptag, 0, &rxbuf->pmap); if (error) { device_printf(dev, "Unable to create RX packet DMA maps\n"); @@ -4758,11 +4754,13 @@ igb_rx_discard(struct rx_ring *rxr, int if (rbuf->m_head) { m_free(rbuf->m_head); rbuf->m_head = NULL; + bus_dmamap_unload(rxr->htag, rbuf->hmap); } if (rbuf->m_pack) { m_free(rbuf->m_pack); rbuf->m_pack = NULL; + bus_dmamap_unload(rxr->ptag, rbuf->pmap); } return; @@ -4885,6 +4883,7 @@ igb_rxeof(struct igb_queue *que, int cou ** case only the first header is valid. */ if (rxr->hdr_split && rxr->fmp == NULL) { + bus_dmamap_unload(rxr->htag, rxbuf->hmap); hlen = (hdr & E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT; if (hlen > IGB_HDR_BUF) @@ -4917,6 +4916,7 @@ igb_rxeof(struct igb_queue *que, int cou /* clear buf info for refresh */ rxbuf->m_pack = NULL; } + bus_dmamap_unload(rxr->ptag, rxbuf->pmap); ++processed; /* So we know when to refresh */ Modified: stable/10/sys/dev/e1000/if_lem.c ============================================================================== --- stable/10/sys/dev/e1000/if_lem.c Tue Dec 17 13:13:02 2013 (r259507) +++ stable/10/sys/dev/e1000/if_lem.c Tue Dec 17 13:18:41 2013 (r259508) @@ -3182,8 +3182,7 @@ lem_allocate_receive_structures(struct a } /* Create the spare map (used by getbuf) */ - error = bus_dmamap_create(adapter->rxtag, BUS_DMA_NOWAIT, - &adapter->rx_sparemap); + error = bus_dmamap_create(adapter->rxtag, 0, &adapter->rx_sparemap); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); @@ -3192,8 +3191,7 @@ lem_allocate_receive_structures(struct a rx_buffer = adapter->rx_buffer_area; for (i = 0; i < adapter->num_rx_desc; i++, rx_buffer++) { - error = bus_dmamap_create(adapter->rxtag, BUS_DMA_NOWAIT, - &rx_buffer->map); + error = bus_dmamap_create(adapter->rxtag, 0, &rx_buffer->map); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:37:02 2013 Return-Path: Delivered-To: svn-src-all@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 D67C8FE3; Tue, 17 Dec 2013 13:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2ADD12D0; Tue, 17 Dec 2013 13:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDb2OE080947; Tue, 17 Dec 2013 13:37:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDb2Yx080943; Tue, 17 Dec 2013 13:37:02 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201312171337.rBHDb2Yx080943@svn.freebsd.org> From: Attilio Rao Date: Tue, 17 Dec 2013 13:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259509 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:37:02 -0000 Author: attilio Date: Tue Dec 17 13:37:02 2013 New Revision: 259509 URL: http://svnweb.freebsd.org/changeset/base/259509 Log: - Assert for not leaking readers rw locks counter on userland return. - Use a correct spin_cnt for KDTRACE_HOOK case in rw read lock. Sponsored by: EMC / Isilon storage division Modified: head/sys/kern/kern_rwlock.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Dec 17 13:18:41 2013 (r259508) +++ head/sys/kern/kern_rwlock.c Tue Dec 17 13:37:02 2013 (r259509) @@ -440,6 +440,9 @@ __rw_rlock(volatile uintptr_t *c, const break; cpu_spinwait(); } +#ifdef KDTRACE_HOOKS + spin_cnt += rowner_loops - i; +#endif if (i != rowner_loops) continue; } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Dec 17 13:18:41 2013 (r259508) +++ head/sys/kern/subr_trap.c Tue Dec 17 13:37:02 2013 (r259509) @@ -152,6 +152,9 @@ userret(struct thread *td, struct trapfr ("userret: Returning in a critical section")); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held", td->td_locks)); + KASSERT(td->td_rw_rlocks == 0, + ("userret: Returning with %d rwlocks held in read mode", + td->td_rw_rlocks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); KASSERT(td->td_no_sleeping == 0, From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:38:23 2013 Return-Path: Delivered-To: svn-src-all@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 B016D1BC; Tue, 17 Dec 2013 13:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 993AB12D9; Tue, 17 Dec 2013 13:38:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDcNa3081153; Tue, 17 Dec 2013 13:38:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDcLOB081138; Tue, 17 Dec 2013 13:38:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171338.rBHDcLOB081138@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:38: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: r259510 - in stable/10/sys: arm/arm ia64/ia64 kern mips/mips powerpc/powerpc sparc64/include sys x86/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:38:23 -0000 Author: kib Date: Tue Dec 17 13:38:21 2013 New Revision: 259510 URL: http://svnweb.freebsd.org/changeset/base/259510 Log: MFC r257228: Add bus_dmamap_load_ma() function to load map with the array of vm_pages. Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c stable/10/sys/arm/arm/busdma_machdep.c stable/10/sys/ia64/ia64/busdma_machdep.c stable/10/sys/kern/subr_bus_dma.c stable/10/sys/mips/mips/busdma_machdep.c stable/10/sys/powerpc/powerpc/busdma_machdep.c stable/10/sys/sparc64/include/bus_dma.h stable/10/sys/sys/bus_dma.h stable/10/sys/x86/x86/busdma_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Tue Dec 17 13:38:21 2013 (r259510) @@ -975,6 +975,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (0); } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrace, and the ending segment on exit. Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/arm/arm/busdma_machdep.c Tue Dec 17 13:38:21 2013 (r259510) @@ -992,6 +992,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat } return (0); } + +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: stable/10/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/busdma_machdep.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/ia64/ia64/busdma_machdep.c Tue Dec 17 13:38:21 2013 (r259510) @@ -658,6 +658,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat */ return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } + +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrace, and the ending segment on exit. Modified: stable/10/sys/kern/subr_bus_dma.c ============================================================================== --- stable/10/sys/kern/subr_bus_dma.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/kern/subr_bus_dma.c Tue Dec 17 13:38:21 2013 (r259510) @@ -124,24 +124,33 @@ static int _bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, int *nsegs, int flags) { - vm_paddr_t paddr; - bus_size_t len, tlen; - int error, i, ma_offs; + int error; if ((bio->bio_flags & BIO_UNMAPPED) == 0) { error = _bus_dmamap_load_buffer(dmat, map, bio->bio_data, bio->bio_bcount, kernel_pmap, flags, NULL, nsegs); - return (error); + } else { + error = _bus_dmamap_load_ma(dmat, map, bio->bio_ma, + bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs); } + return (error); +} + +int +bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + vm_paddr_t paddr; + bus_size_t len; + int error, i; error = 0; - tlen = bio->bio_bcount; - ma_offs = bio->bio_ma_offset; for (i = 0; tlen > 0; i++, tlen -= len) { len = min(PAGE_SIZE - ma_offs, tlen); - paddr = VM_PAGE_TO_PHYS(bio->bio_ma[i]) + ma_offs; + paddr = VM_PAGE_TO_PHYS(ma[i]) + ma_offs; error = _bus_dmamap_load_phys(dmat, map, paddr, len, - flags, NULL, nsegs); + flags, segs, segp); if (error != 0) break; ma_offs = 0; Modified: stable/10/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/10/sys/mips/mips/busdma_machdep.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/mips/mips/busdma_machdep.c Tue Dec 17 13:38:21 2013 (r259510) @@ -878,6 +878,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (0); } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: stable/10/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/busdma_machdep.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/powerpc/powerpc/busdma_machdep.c Tue Dec 17 13:38:21 2013 (r259510) @@ -754,6 +754,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: stable/10/sys/sparc64/include/bus_dma.h ============================================================================== --- stable/10/sys/sparc64/include/bus_dma.h Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/sparc64/include/bus_dma.h Tue Dec 17 13:38:21 2013 (r259510) @@ -146,5 +146,7 @@ struct bus_dma_tag { ((t)->dt_mt->dm_dmamem_alloc((t), (v), (f), (m))) #define bus_dmamem_free(t, v, m) \ ((t)->dt_mt->dm_dmamem_free((t), (v), (m))) +#define _bus_dmamap_load_ma(t, m, a, tt, o, f, s, p) \ + bus_dmamap_load_ma_triv((t), (m), (a), (tt), (o), (f), (s), (p)) #endif /* !_SPARC64_BUS_DMA_H_ */ Modified: stable/10/sys/sys/bus_dma.h ============================================================================== --- stable/10/sys/sys/bus_dma.h Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/sys/bus_dma.h Tue Dec 17 13:38:21 2013 (r259510) @@ -247,6 +247,15 @@ int bus_dmamap_load_mem(bus_dma_tag_t dm void *callback_arg, int flags); /* + * Placeholder for use by busdma implementations which do not benefit + * from optimized procedure to load an array of vm_page_t. Falls back + * to do _bus_dmamap_load_phys() in loop. + */ +int bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + +/* * XXX sparc64 uses the same interface, but a much different implementation. * for the sparc64 arch contains the equivalent * declarations. @@ -324,6 +333,10 @@ int _bus_dmamap_load_phys(bus_dma_tag_t vm_paddr_t paddr, bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp); +int _bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + bus_dma_segment_t *_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dma_segment_t *segs, Modified: stable/10/sys/x86/x86/busdma_machdep.c ============================================================================== --- stable/10/sys/x86/x86/busdma_machdep.c Tue Dec 17 13:37:02 2013 (r259509) +++ stable/10/sys/x86/x86/busdma_machdep.c Tue Dec 17 13:38:21 2013 (r259510) @@ -849,6 +849,16 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + void __bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, struct memdesc *mem, bus_dmamap_callback_t *callback, From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:39:51 2013 Return-Path: Delivered-To: svn-src-all@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 635F3314; Tue, 17 Dec 2013 13:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C89E12EB; Tue, 17 Dec 2013 13:39:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDdpkg081340; Tue, 17 Dec 2013 13:39:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDdoCl081332; Tue, 17 Dec 2013 13:39:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171339.rBHDdoCl081332@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259511 - in stable/10/sys: conf x86/include x86/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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:39:51 -0000 Author: kib Date: Tue Dec 17 13:39:50 2013 New Revision: 259511 URL: http://svnweb.freebsd.org/changeset/base/259511 Log: MFC r257230: Add a virtual table for the busdma methods on x86, to allow different busdma implementations to coexist. Added: stable/10/sys/x86/include/busdma_impl.h - copied unchanged from r257230, head/sys/x86/include/busdma_impl.h stable/10/sys/x86/x86/busdma_bounce.c - copied unchanged from r257230, head/sys/x86/x86/busdma_bounce.c Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/files.pc98 stable/10/sys/x86/x86/busdma_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Tue Dec 17 13:38:21 2013 (r259510) +++ stable/10/sys/conf/files.amd64 Tue Dec 17 13:39:50 2013 (r259511) @@ -541,6 +541,7 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Tue Dec 17 13:38:21 2013 (r259510) +++ stable/10/sys/conf/files.i386 Tue Dec 17 13:39:50 2013 (r259511) @@ -576,6 +576,7 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt Modified: stable/10/sys/conf/files.pc98 ============================================================================== --- stable/10/sys/conf/files.pc98 Tue Dec 17 13:38:21 2013 (r259510) +++ stable/10/sys/conf/files.pc98 Tue Dec 17 13:39:50 2013 (r259511) @@ -247,6 +247,7 @@ x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa x86/pci/pci_bus.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/intr_machdep.c standard Copied: stable/10/sys/x86/include/busdma_impl.h (from r257230, head/sys/x86/include/busdma_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/x86/include/busdma_impl.h Tue Dec 17 13:39:50 2013 (r259511, copy of r257230, head/sys/x86/include/busdma_impl.h) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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$ + */ + +#ifndef __X86_BUSDMA_IMPL_H +#define __X86_BUSDMA_IMPL_H + +struct bus_dma_tag_common { + struct bus_dma_impl *impl; + struct bus_dma_tag_common *parent; + bus_size_t alignment; + bus_addr_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_dma_filter_t *filter; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; + int ref_count; +}; + +struct bus_dma_impl { + int (*tag_create)(bus_dma_tag_t parent, + bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat); + int (*tag_destroy)(bus_dma_tag_t dmat); + int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); + int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); + int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp); + void (*mem_free)(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map); + int (*load_ma)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_phys)(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_buffer)(bus_dma_tag_t dmat, bus_dmamap_t map, + void *buf, bus_size_t buflen, pmap_t pmap, int flags, + bus_dma_segment_t *segs, int *segp); + void (*map_waitok)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, + void *callback_arg); + bus_dma_segment_t *(*map_complete)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error); + void (*map_unload)(bus_dma_tag_t dmat, bus_dmamap_t map); + void (*map_sync)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op); +}; + +void busdma_lock_mutex(void *arg, bus_dma_lock_op_t op); +void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); +int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); +int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, + bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, size_t sz, void **dmat); + +extern struct bus_dma_impl bus_dma_bounce_impl; + +#endif Copied: stable/10/sys/x86/x86/busdma_bounce.c (from r257230, head/sys/x86/x86/busdma_bounce.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/x86/x86/busdma_bounce.c Tue Dec 17 13:39:50 2013 (r259511, copy of r257230, head/sys/x86/x86/busdma_bounce.c) @@ -0,0 +1,1080 @@ +/*- + * Copyright (c) 1997, 1998 Justin T. Gibbs. + * 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, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef __i386__ +#define MAX_BPAGES 512 +#else +#define MAX_BPAGES 8192 +#endif +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +struct bounce_zone; + +struct bus_dma_tag { + struct bus_dma_tag_common common; + int map_count; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_addr_t dataaddr; /* client physical address */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + +struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; +static struct bus_dmamap nobounce_dmamap, contig_dmamap; + +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_addr_t addr, + bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + pmap_t pmap, void *buf, bus_size_t buflen, + int flags); +static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, + int flags); +static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int flags); + +#ifdef XEN +#undef pmap_kextract +#define pmap_kextract pmap_kextract_ma +#endif + +/* + * Allocate a device specific dma_tag. + */ +static int +bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t newtag; + int error; + + *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? &parent->common : + NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg, + maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof (struct bus_dma_tag), (void **)&newtag); + if (error != 0) + return (error); + + newtag->common.impl = &bus_dma_bounce_impl; + newtag->map_count = 0; + newtag->segments = NULL; + + if (parent != NULL && ((newtag->common.filter != NULL) || + ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) + newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) + newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->common.flags |= BUS_DMA_MIN_ALLOC_COMP; + } else + error = 0; + + if (error != 0) + free(newtag, M_DEVBUF); + else + *dmat = newtag; + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); + return (error); +} + +static int +bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) +{ + bus_dma_tag_t dmat_copy, parent; + int error; + + error = 0; + dmat_copy = dmat; + + if (dmat != NULL) { + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + while (dmat != NULL) { + parent = (bus_dma_tag_t)dmat->common.parent; + atomic_subtract_int(&dmat->common.ref_count, 1); + if (dmat->common.ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bounce_zone *bz; + int error, maxpages, pages; + + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->common.flags & BUS_DMA_COULD_BOUNCE) { + /* Must bounce */ + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + } + bz = dmat->bounce_zone; + + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->common.alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem - + atop(dmat->common.lowaddr)); + if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { + pages = MAX(atop(dmat->common.maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) + == 0) { + if (error == 0) { + dmat->common.flags |= + BUS_DMA_MIN_ALLOC_COMP; + } + } else + error = 0; + } + bz->map_count++; + } else { + *mapp = NULL; + } + if (error == 0) + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, error); + return (error); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + + if (map != NULL && map != &nobounce_dmamap && map != &contig_dmamap) { + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; + free(map, M_DEVBUF); + } + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); +} + + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints lited in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static int +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + vm_memattr_t attr; + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + + /* If we succeed, no mapping/bouncing will be required */ + *mapp = NULL; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + } + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + if (flags & BUS_DMA_NOCACHE) + attr = VM_MEMATTR_UNCACHEABLE; + else + attr = VM_MEMATTR_DEFAULT; + + /* + * XXX: + * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact + * alignment guarantees of malloc need to be nailed down, and the + * code below should be rewritten to take that into account. + * + * In the meantime, we'll warn the user if malloc gets it wrong. + */ + if ((dmat->common.maxsize <= PAGE_SIZE) && + (dmat->common.alignment < dmat->common.maxsize) && + dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && + attr == VM_MEMATTR_DEFAULT) { + *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + } else if (dmat->common.nsegments >= btoc(dmat->common.maxsize) && + dmat->common.alignment <= PAGE_SIZE && + (dmat->common.boundary == 0 || + dmat->common.boundary >= dmat->common.lowaddr)) { + /* Page-based multi-segment allocations allowed */ + *vaddr = (void *)kmem_alloc_attr(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + attr); + *mapp = &contig_dmamap; + } else { + *vaddr = (void *)kmem_alloc_contig(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, + dmat->common.boundary, attr); + *mapp = &contig_dmamap; + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, 0); + return (0); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static void +bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + /* + * dmamem does not need to be bounced, so the map should be + * NULL if malloc() was used and contig_dmamap if + * kmem_alloc_contig() was used. + */ + if (!(map == NULL || map == &contig_dmamap)) + panic("bus_dmamem_free: Invalid map freed\n"); + if (map == NULL) + free(vaddr, M_DEVBUF); + else + kmem_free(kernel_arena, (vm_offset_t)vaddr, + dmat->common.maxsize); + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, + dmat->common.flags); +} + +static void +_bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE); + map->pagesneeded++; + } + curaddr += sgsize; + buflen -= sgsize; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static void +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + bus_size_t sg_len; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); + CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", + map, &nobounce_dmamap, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap == kernel_pmap) + paddr = pmap_kextract(vaddr); + else + paddr = pmap_extract(pmap, vaddr); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static int +_bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) +{ + + /* Reserve Necessary Bounce Pages */ + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + + return (0); +} + +/* + * Add a single contiguous physical range to the segment list. + */ +static int +_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, + bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) +{ + bus_addr_t baddr, bmask; + int seg; + + /* + * Make sure we don't cross any boundaries. + */ + bmask = ~(dmat->common.boundary - 1); + if (dmat->common.boundary > 0) { + baddr = (curaddr + dmat->common.boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * previous segment if possible. + */ + seg = *segp; + if (seg == -1) { + seg = 0; + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } else { + if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && + (dmat->common.boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + segs[seg].ds_len += sgsize; + else { + if (++seg >= dmat->common.nsegments) + return (0); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + } + *segp = seg; + return (sgsize); +} + +/* + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) +{ + bus_size_t sgsize; + bus_addr_t curaddr; + int error; + + if (map == NULL || map == &contig_dmamap) + map = &nobounce_dmamap; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + while (buflen > 0) { + curaddr = buf; + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + sgsize); + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, + segp); + if (sgsize == 0) + break; + buf += sgsize; + buflen -= sgsize; + } + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + +/* + * Utility function to load a linear buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + bus_size_t sgsize, max_sgsize; + bus_addr_t curaddr; + vm_offset_t vaddr; + int error; + + if (map == NULL || map == &contig_dmamap) + map = &nobounce_dmamap; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + vaddr = (vm_offset_t)buf; + while (buflen > 0) { + /* + * Get the physical address for this segment. + */ + if (pmap == kernel_pmap) + curaddr = pmap_kextract(vaddr); + else + curaddr = pmap_extract(pmap, vaddr); + + /* + * Compute the segment size, and adjust counts. + */ + max_sgsize = MIN(buflen, dmat->common.maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = roundup2(sgsize, dmat->common.alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, curaddr, + sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, + segp); + if (sgsize == 0) + break; + vaddr += sgsize; + buflen -= sgsize; + } + + /* + * Did we fit? + */ + return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ +} + +static void +bounce_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + + if (map == NULL) + return; + map->mem = *mem; + map->dmat = dmat; + map->callback = callback; + map->callback_arg = callback_arg; +} + +static bus_dma_segment_t * +bounce_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (segs == NULL) + segs = dmat->segments; + return (segs); +} + +/* + * Release the mapping held by map. + */ +static void +bounce_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bounce_page *bpage; + + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + STAILQ_REMOVE_HEAD(&map->bpages, links); + free_bounce_page(dmat, bpage); + } +} + +static void +bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op) +{ + struct bounce_page *bpage; + + if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + /* + * Handle data bouncing. We might also + * want to add support for invalidating + * the caches on broken hardware + */ + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " + "performing bounce", __func__, dmat, + dmat->common.flags, op); + + if ((op & BUS_DMASYNC_PREWRITE) != 0) { + while (bpage != NULL) { + if (bpage->datavaddr != 0) { + bcopy((void *)bpage->datavaddr, + (void *)bpage->vaddr, + bpage->datacount); + } else { + physcopyout(bpage->dataaddr, + (void *)bpage->vaddr, + bpage->datacount); + } + bpage = STAILQ_NEXT(bpage, links); + } + dmat->bounce_zone->total_bounced++; + } + + if ((op & BUS_DMASYNC_POSTREAD) != 0) { + while (bpage != NULL) { + if (bpage->datavaddr != 0) { + bcopy((void *)bpage->vaddr, + (void *)bpage->datavaddr, + bpage->datacount); + } else { + physcopyin((void *)bpage->vaddr, + bpage->dataaddr, + bpage->datacount); + } + bpage = STAILQ_NEXT(bpage, links); + } + dmat->bounce_zone->total_bounced++; + } + } +} + +static void +init_bounce_pages(void *dummy __unused) +{ + + total_bpages = 0; + STAILQ_INIT(&bounce_zone_list); + STAILQ_INIT(&bounce_map_waitinglist); + STAILQ_INIT(&bounce_map_callbacklist); + mtx_init(&bounce_lock, "bounce pages lock", NULL, MTX_DEF); +} +SYSINIT(bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL); + +static struct sysctl_ctx_list * +busdma_sysctl_tree(struct bounce_zone *bz) +{ + return (&bz->sysctl_tree); +} + +static struct sysctl_oid * +busdma_sysctl_tree_top(struct bounce_zone *bz) +{ + return (bz->sysctl_tree_top); +} + +#if defined(__amd64__) || defined(PAE) +#define SYSCTL_ADD_BUS_SIZE_T SYSCTL_ADD_UQUAD +#else +#define SYSCTL_ADD_BUS_SIZE_T(ctx, parent, nbr, name, flag, ptr, desc) \ + SYSCTL_ADD_UINT(ctx, parent, nbr, name, flag, ptr, 0, desc) +#endif + +static int +alloc_bounce_zone(bus_dma_tag_t dmat) +{ + struct bounce_zone *bz; + + /* Check to see if we already have a suitable zone */ + STAILQ_FOREACH(bz, &bounce_zone_list, links) { + if ((dmat->common.alignment <= bz->alignment) && + (dmat->common.lowaddr >= bz->lowaddr)) { + dmat->bounce_zone = bz; + return (0); + } + } + + if ((bz = (struct bounce_zone *)malloc(sizeof(*bz), M_DEVBUF, + M_NOWAIT | M_ZERO)) == NULL) + return (ENOMEM); + + STAILQ_INIT(&bz->bounce_page_list); + bz->free_bpages = 0; + bz->reserved_bpages = 0; + bz->active_bpages = 0; + bz->lowaddr = dmat->common.lowaddr; + bz->alignment = MAX(dmat->common.alignment, PAGE_SIZE); + bz->map_count = 0; + snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); + busdma_zonecount++; + snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); + STAILQ_INSERT_TAIL(&bounce_zone_list, bz, links); + dmat->bounce_zone = bz; + + sysctl_ctx_init(&bz->sysctl_tree); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 13:49:39 2013 Return-Path: Delivered-To: svn-src-all@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 2F122734; Tue, 17 Dec 2013 13:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17ED613C8; Tue, 17 Dec 2013 13:49:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHDndBo085010; Tue, 17 Dec 2013 13:49:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHDnauF084994; Tue, 17 Dec 2013 13:49:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171349.rBHDnauF084994@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 13:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259512 - in stable/10/sys: amd64/conf conf dev/acpica i386/conf x86/include x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 13:49:39 -0000 Author: kib Date: Tue Dec 17 13:49:35 2013 New Revision: 259512 URL: http://svnweb.freebsd.org/changeset/base/259512 Log: MFC DMAR busdma implementation. MFC r257251: Import the driver for VT-d DMAR hardware. Implement the busdma(9) using DMARs. MFC r257512: Add support for queued invalidation. MFC miscellaneous follow-ups to r257251. MFC r257266: Remove redundand assignment to error variable and check for its value. MFC r257308: Remove redundand declaration. MFC r257511: Return BUS_PROBE_NOWILDCARD from the DMAR probe method. MFC r257860,r257896,r257900,r257902,r257903 (by dim): Fixes for gcc compilation. Added: stable/10/sys/x86/iommu/ - copied from r257251, head/sys/x86/iommu/ stable/10/sys/x86/iommu/intel_qi.c - copied unchanged from r257512, head/sys/x86/iommu/intel_qi.c Modified: stable/10/sys/amd64/conf/GENERIC stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/options stable/10/sys/dev/acpica/acpi_pci.c stable/10/sys/i386/conf/NOTES stable/10/sys/x86/include/busdma_impl.h stable/10/sys/x86/iommu/busdma_dmar.c stable/10/sys/x86/iommu/intel_ctx.c stable/10/sys/x86/iommu/intel_dmar.h stable/10/sys/x86/iommu/intel_drv.c stable/10/sys/x86/iommu/intel_fault.c stable/10/sys/x86/iommu/intel_gas.c stable/10/sys/x86/iommu/intel_idpgtbl.c stable/10/sys/x86/iommu/intel_reg.h stable/10/sys/x86/iommu/intel_utils.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/amd64/conf/GENERIC Tue Dec 17 13:49:35 2013 (r259512) @@ -85,6 +85,7 @@ device cpufreq # Bus support. device acpi +options ACPI_DMAR device pci # Floppy drives Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/conf/files.amd64 Tue Dec 17 13:49:35 2013 (r259512) @@ -531,6 +531,15 @@ x86/cpufreq/powernow.c optional cpufreq x86/cpufreq/est.c optional cpufreq x86/cpufreq/hwpstate.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq +x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci +x86/iommu/intel_ctx.c optional acpi acpi_dmar pci +x86/iommu/intel_drv.c optional acpi acpi_dmar pci +x86/iommu/intel_fault.c optional acpi acpi_dmar pci +x86/iommu/intel_gas.c optional acpi acpi_dmar pci +x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_qi.c optional acpi acpi_dmar pci +x86/iommu/intel_quirks.c optional acpi acpi_dmar pci +x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic isa x86/isa/atrtc.c standard x86/isa/clock.c standard Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/conf/files.i386 Tue Dec 17 13:49:35 2013 (r259512) @@ -566,6 +566,15 @@ x86/cpufreq/hwpstate.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq x86/cpufreq/smist.c optional cpufreq +x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci +x86/iommu/intel_ctx.c optional acpi acpi_dmar pci +x86/iommu/intel_drv.c optional acpi acpi_dmar pci +x86/iommu/intel_fault.c optional acpi acpi_dmar pci +x86/iommu/intel_gas.c optional acpi acpi_dmar pci +x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_qi.c optional acpi acpi_dmar pci +x86/iommu/intel_quirks.c optional acpi acpi_dmar pci +x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic x86/isa/atrtc.c optional native x86/isa/clock.c optional native Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/conf/options Tue Dec 17 13:49:35 2013 (r259512) @@ -688,6 +688,7 @@ OPENSOLARIS_WITNESS opt_global.h ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h +ACPI_DMAR opt_acpi.h # ISA support DEV_ISA opt_isa.h Modified: stable/10/sys/dev/acpica/acpi_pci.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_pci.c Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/dev/acpica/acpi_pci.c Tue Dec 17 13:49:35 2013 (r259512) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" + #include #include #include @@ -80,6 +82,7 @@ static ACPI_STATUS acpi_pci_save_handle( static int acpi_pci_set_powerstate_method(device_t dev, device_t child, int state); static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); +static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); static device_method_t acpi_pci_methods[] = { /* Device interface */ @@ -90,6 +93,7 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method), + DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), /* PCI interface */ DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), @@ -308,3 +312,28 @@ acpi_pci_attach(device_t dev) return (bus_generic_attach(dev)); } + +#ifdef ACPI_DMAR +bus_dma_tag_t dmar_get_dma_tag(device_t dev, device_t child); +static bus_dma_tag_t +acpi_pci_get_dma_tag(device_t bus, device_t child) +{ + bus_dma_tag_t tag; + + if (device_get_parent(child) == bus) { + /* try dmar and return if it works */ + tag = dmar_get_dma_tag(bus, child); + } else + tag = NULL; + if (tag == NULL) + tag = pci_get_dma_tag(bus, child); + return (tag); +} +#else +static bus_dma_tag_t +acpi_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (pci_get_dma_tag(bus, child)); +} +#endif Modified: stable/10/sys/i386/conf/NOTES ============================================================================== --- stable/10/sys/i386/conf/NOTES Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/i386/conf/NOTES Tue Dec 17 13:49:35 2013 (r259512) @@ -491,6 +491,7 @@ device tdfx_linux # Enable Linuxulator device acpi options ACPI_DEBUG +options ACPI_DMAR # ACPI WMI Mapping driver device acpi_wmi Modified: stable/10/sys/x86/include/busdma_impl.h ============================================================================== --- stable/10/sys/x86/include/busdma_impl.h Tue Dec 17 13:39:50 2013 (r259511) +++ stable/10/sys/x86/include/busdma_impl.h Tue Dec 17 13:49:35 2013 (r259512) @@ -82,7 +82,6 @@ struct bus_dma_impl { bus_dmasync_op_t op); }; -void busdma_lock_mutex(void *arg, bus_dma_lock_op_t op); void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, Modified: stable/10/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/busdma_dmar.c Tue Dec 17 13:49:35 2013 (r259512) @@ -163,18 +163,15 @@ dmar_bus_dma_tag_create(bus_dma_tag_t pa nsegments, maxsegsz, flags, lockfunc, lockfuncarg, sizeof(struct bus_dma_tag_dmar), (void **)&newtag); if (error != 0) - return (error); + goto out; oldtag = (struct bus_dma_tag_dmar *)parent; newtag->common.impl = &bus_dma_dmar_impl; newtag->ctx = oldtag->ctx; newtag->owner = oldtag->owner; - error = 0; - if (error != 0) - free(newtag, M_DEVBUF); - else - *dmat = (bus_dma_tag_t)newtag; + *dmat = (bus_dma_tag_t)newtag; +out: CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), error); @@ -344,6 +341,7 @@ dmar_bus_dmamap_load_something1(struct b segs = tag->segments; ctx = tag->ctx; seg = *segp; + error = 0; idx = 0; while (buflen > 0) { seg++; Modified: stable/10/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_ctx.c Tue Dec 17 13:49:35 2013 (r259512) @@ -385,17 +385,29 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * negative TLB entries. */ if ((dmar->hw_cap & DMAR_CAP_CM) != 0 || enable) { - error = dmar_inv_ctx_glob(dmar); - if (error == 0 && - (dmar->hw_ecap & DMAR_ECAP_DI) != 0) - error = dmar_inv_iotlb_glob(dmar); - if (error != 0) { - dmar_free_ctx_locked(dmar, ctx); - TD_PINNED_ASSERT; - return (NULL); + if (dmar->qi_enabled) { + dmar_qi_invalidate_ctx_glob_locked(dmar); + if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) + dmar_qi_invalidate_iotlb_glob_locked(dmar); + } else { + error = dmar_inv_ctx_glob(dmar); + if (error == 0 && + (dmar->hw_ecap & DMAR_ECAP_DI) != 0) + error = dmar_inv_iotlb_glob(dmar); + if (error != 0) { + dmar_free_ctx_locked(dmar, ctx); + TD_PINNED_ASSERT; + return (NULL); + } } } - if (enable && !rmrr_init) { + + /* + * The dmar lock was potentially dropped between check for the + * empty context list and now. Recheck the state of GCMD_TE + * to avoid unneeded command. + */ + if (enable && !rmrr_init && (dmar->hw_gcmd & DMAR_GCMD_TE) == 0) { error = dmar_enable_translation(dmar); if (error != 0) { dmar_free_ctx_locked(dmar, ctx); @@ -469,8 +481,12 @@ dmar_free_ctx_locked(struct dmar_unit *d dmar_pte_clear(&ctxp->ctx1); ctxp->ctx2 = 0; dmar_inv_ctx_glob(dmar); - if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) - dmar_inv_iotlb_glob(dmar); + if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) { + if (dmar->qi_enabled) + dmar_qi_invalidate_iotlb_glob_locked(dmar); + else + dmar_inv_iotlb_glob(dmar); + } LIST_REMOVE(ctx, link); DMAR_UNLOCK(dmar); @@ -512,24 +528,86 @@ dmar_find_ctx_locked(struct dmar_unit *d } void +dmar_ctx_free_entry(struct dmar_map_entry *entry, bool free) +{ + struct dmar_ctx *ctx; + + ctx = entry->ctx; + DMAR_CTX_LOCK(ctx); + if ((entry->flags & DMAR_MAP_ENTRY_RMRR) != 0) + dmar_gas_free_region(ctx, entry); + else + dmar_gas_free_space(ctx, entry); + DMAR_CTX_UNLOCK(ctx); + if (free) + dmar_gas_free_entry(ctx, entry); + else + entry->flags = 0; +} + +void +dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free) +{ + struct dmar_unit *unit; + + unit = entry->ctx->dmar; + if (unit->qi_enabled) { + DMAR_LOCK(unit); + dmar_qi_invalidate_locked(entry->ctx, entry->start, + entry->end - entry->start, &entry->gseq); + if (!free) + entry->flags |= DMAR_MAP_ENTRY_QI_NF; + TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); + DMAR_UNLOCK(unit); + } else { + ctx_flush_iotlb_sync(entry->ctx, entry->start, entry->end - + entry->start); + dmar_ctx_free_entry(entry, free); + } +} + +void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep) { - struct dmar_map_entry *entry; + struct dmar_unit *unit; + struct dmar_map_entry *entry, *entry1; + struct dmar_qi_genseq gseq; int error; - while ((entry = TAILQ_FIRST(entries)) != NULL) { + unit = ctx->dmar; + + TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & DMAR_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", ctx, entry)); - TAILQ_REMOVE(entries, entry, dmamap_link); error = ctx_unmap_buf(ctx, entry->start, entry->end - entry->start, cansleep ? DMAR_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", ctx, error)); - DMAR_CTX_LOCK(ctx); - dmar_gas_free_space(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - dmar_gas_free_entry(ctx, entry); + if (!unit->qi_enabled) { + ctx_flush_iotlb_sync(ctx, entry->start, + entry->end - entry->start); + TAILQ_REMOVE(entries, entry, dmamap_link); + dmar_ctx_free_entry(entry, true); + } + } + if (TAILQ_EMPTY(entries)) + return; + + KASSERT(unit->qi_enabled, ("loaded entry left")); + DMAR_LOCK(unit); + TAILQ_FOREACH(entry, entries, dmamap_link) { + entry->gseq.gen = 0; + entry->gseq.seq = 0; + dmar_qi_invalidate_locked(ctx, entry->start, entry->end - + entry->start, TAILQ_NEXT(entry, dmamap_link) == NULL ? + &gseq : NULL); + } + TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { + entry->gseq = gseq; + TAILQ_REMOVE(entries, entry, dmamap_link); + TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); } + DMAR_UNLOCK(unit); } static void Modified: stable/10/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_dmar.h Tue Dec 17 13:49:35 2013 (r259512) @@ -37,6 +37,11 @@ typedef uint64_t dmar_haddr_t; /* Guest or bus address, before translation. */ typedef uint64_t dmar_gaddr_t; +struct dmar_qi_genseq { + u_int gen; + uint32_t seq; +}; + struct dmar_map_entry { dmar_gaddr_t start; dmar_gaddr_t end; @@ -48,6 +53,8 @@ struct dmar_map_entry { RB_ENTRY(dmar_map_entry) rb_entry; /* Links for ctx entries */ TAILQ_ENTRY(dmar_map_entry) unroll_link; /* Link for unroll after dmamap_load failure */ + struct dmar_ctx *ctx; + struct dmar_qi_genseq gseq; }; RB_HEAD(dmar_gas_entries_tree, dmar_map_entry); @@ -60,6 +67,7 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_MAP 0x0004 /* Busdma created, linked by dmamap_link */ #define DMAR_MAP_ENTRY_UNMAPPED 0x0010 /* No backing pages */ +#define DMAR_MAP_ENTRY_QI_NF 0x0020 /* qi task, do not free entry */ #define DMAR_MAP_ENTRY_READ 0x1000 /* Read permitted */ #define DMAR_MAP_ENTRY_WRITE 0x2000 /* Write permitted */ #define DMAR_MAP_ENTRY_SNOOP 0x4000 /* Snoop */ @@ -113,6 +121,24 @@ struct dmar_ctx { #define DMAR_CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->lock) #define DMAR_CTX_ASSERT_LOCKED(ctx) mtx_assert(&(ctx)->lock, MA_OWNED) +struct dmar_msi_data { + int irq; + int irq_rid; + struct resource *irq_res; + void *intr_handle; + int (*handler)(void *); + int msi_data_reg; + int msi_addr_reg; + int msi_uaddr_reg; + void (*enable_intr)(struct dmar_unit *); + void (*disable_intr)(struct dmar_unit *); + const char *name; +}; + +#define DMAR_INTR_FAULT 0 +#define DMAR_INTR_QI 1 +#define DMAR_INTR_TOTAL 2 + struct dmar_unit { device_t dev; int unit; @@ -122,10 +148,8 @@ struct dmar_unit { /* Resources */ int reg_rid; struct resource *regs; - int irq; - int irq_rid; - struct resource *irq_res; - void *intr_handle; + + struct dmar_msi_data intrs[DMAR_INTR_TOTAL]; /* Hardware registers cache */ uint32_t hw_ver; @@ -149,6 +173,25 @@ struct dmar_unit { struct task fault_task; struct taskqueue *fault_taskqueue; + /* QI */ + int qi_enabled; + vm_offset_t inv_queue; + vm_size_t inv_queue_size; + uint32_t inv_queue_avail; + uint32_t inv_queue_tail; + volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait + descr completion */ + uint64_t inv_waitd_seq_hw_phys; + uint32_t inv_waitd_seq; /* next sequence number to use for wait descr */ + u_int inv_waitd_gen; /* seq number generation AKA seq overflows */ + u_int inv_seq_waiters; /* count of waiters for seq */ + u_int inv_queue_full; /* informational counter */ + + /* Delayed freeing of map entries queue processing */ + struct dmar_map_entries_tailq tlb_flush_entries; + struct task qi_task; + struct taskqueue *qi_taskqueue; + /* Busdma delayed map load */ struct task dmamap_load_task; TAILQ_HEAD(, bus_dmamap_dmar) delayed_maps; @@ -164,6 +207,7 @@ struct dmar_unit { #define DMAR_FAULT_ASSERT_LOCKED(dmar) mtx_assert(&(dmar)->fault_lock, MA_OWNED) #define DMAR_IS_COHERENT(dmar) (((dmar)->hw_ecap & DMAR_ECAP_C) != 0) +#define DMAR_HAS_QI(dmar) (((dmar)->hw_ecap & DMAR_ECAP_QI) != 0) /* Barrier ids */ #define DMAR_BARRIER_RMRR 0 @@ -180,6 +224,8 @@ vm_pindex_t pglvl_max_pages(int pglvl); int ctx_is_sp_lvl(struct dmar_ctx *ctx, int lvl); dmar_gaddr_t pglvl_page_size(int total_pglvl, int lvl); dmar_gaddr_t ctx_page_size(struct dmar_ctx *ctx, int lvl); +int calc_am(struct dmar_unit *unit, dmar_gaddr_t base, dmar_gaddr_t size, + dmar_gaddr_t *isizep); struct vm_page *dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags); void dmar_pgfree(vm_object_t obj, vm_pindex_t idx, int flags); void *dmar_map_pgtbl(vm_object_t obj, vm_pindex_t idx, int flags, @@ -191,21 +237,33 @@ int dmar_inv_iotlb_glob(struct dmar_unit int dmar_flush_write_bufs(struct dmar_unit *unit); int dmar_enable_translation(struct dmar_unit *unit); int dmar_disable_translation(struct dmar_unit *unit); -void dmar_enable_intr(struct dmar_unit *unit); -void dmar_disable_intr(struct dmar_unit *unit); bool dmar_barrier_enter(struct dmar_unit *dmar, u_int barrier_id); void dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id); -int dmar_intr(void *arg); +int dmar_fault_intr(void *arg); +void dmar_enable_fault_intr(struct dmar_unit *unit); +void dmar_disable_fault_intr(struct dmar_unit *unit); int dmar_init_fault_log(struct dmar_unit *unit); void dmar_fini_fault_log(struct dmar_unit *unit); +int dmar_qi_intr(void *arg); +void dmar_enable_qi_intr(struct dmar_unit *unit); +void dmar_disable_qi_intr(struct dmar_unit *unit); +int dmar_init_qi(struct dmar_unit *unit); +void dmar_fini_qi(struct dmar_unit *unit); +void dmar_qi_invalidate_locked(struct dmar_ctx *ctx, dmar_gaddr_t start, + dmar_gaddr_t size, struct dmar_qi_genseq *pseq); +void dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit); +void dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit); + vm_object_t ctx_get_idmap_pgtbl(struct dmar_ctx *ctx, dmar_gaddr_t maxaddr); void put_idmap_pgtbl(vm_object_t obj); int ctx_map_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); int ctx_unmap_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, int flags); +void ctx_flush_iotlb_sync(struct dmar_ctx *ctx, dmar_gaddr_t base, + dmar_gaddr_t size); int ctx_alloc_pgtbl(struct dmar_ctx *ctx); void ctx_free_pgtbl(struct dmar_ctx *ctx); @@ -217,8 +275,10 @@ void dmar_free_ctx_locked(struct dmar_un void dmar_free_ctx(struct dmar_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func); +void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); +void dmar_ctx_free_entry(struct dmar_map_entry *entry, bool free); int dmar_init_busdma(struct dmar_unit *unit); void dmar_fini_busdma(struct dmar_unit *unit); @@ -231,6 +291,7 @@ void dmar_gas_free_space(struct dmar_ctx int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma, struct dmar_map_entry **res); +void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); int dmar_gas_reserve_region(struct dmar_ctx *ctx, dmar_gaddr_t start, Modified: stable/10/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_drv.c Tue Dec 17 13:49:35 2013 (r259512) @@ -71,8 +71,9 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #endif -#define DMAR_REG_RID 1 -#define DMAR_IRQ_RID 0 +#define DMAR_FAULT_IRQ_RID 0 +#define DMAR_QI_IRQ_RID 1 +#define DMAR_REG_RID 2 static devclass_t dmar_devclass; static device_t *dmar_devs; @@ -217,24 +218,35 @@ dmar_probe(device_t dev) if (acpi_get_handle(dev) != NULL) return (ENXIO); device_set_desc(dev, "DMA remap"); - return (0); + return (BUS_PROBE_NOWILDCARD); +} + +static void +dmar_release_intr(device_t dev, struct dmar_unit *unit, int idx) +{ + struct dmar_msi_data *dmd; + + dmd = &unit->intrs[idx]; + if (dmd->irq == -1) + return; + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); + PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), + dev, dmd->irq); + dmd->irq = -1; } static void dmar_release_resources(device_t dev, struct dmar_unit *unit) { + int i; dmar_fini_busdma(unit); + dmar_fini_qi(unit); dmar_fini_fault_log(unit); - if (unit->irq != -1) { - bus_teardown_intr(dev, unit->irq_res, unit->intr_handle); - bus_release_resource(dev, SYS_RES_IRQ, unit->irq_rid, - unit->irq_res); - bus_delete_resource(dev, SYS_RES_IRQ, unit->irq_rid); - PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), - dev, unit->irq); - unit->irq = -1; - } + for (i = 0; i < DMAR_INTR_TOTAL; i++) + dmar_release_intr(dev, unit, i); if (unit->regs != NULL) { bus_deactivate_resource(dev, SYS_RES_MEMORY, unit->reg_rid, unit->regs); @@ -253,62 +265,66 @@ dmar_release_resources(device_t dev, str } static int -dmar_alloc_irq(device_t dev, struct dmar_unit *unit) +dmar_alloc_irq(device_t dev, struct dmar_unit *unit, int idx) { device_t pcib; + struct dmar_msi_data *dmd; uint64_t msi_addr; uint32_t msi_data; int error; + dmd = &unit->intrs[idx]; pcib = device_get_parent(device_get_parent(dev)); /* Really not pcib */ - error = PCIB_ALLOC_MSIX(pcib, dev, &unit->irq); + error = PCIB_ALLOC_MSIX(pcib, dev, &dmd->irq); if (error != 0) { - device_printf(dev, "cannot allocate fault interrupt, %d\n", - error); + device_printf(dev, "cannot allocate %s interrupt, %d\n", + dmd->name, error); goto err1; } - unit->irq_rid = DMAR_IRQ_RID; - error = bus_set_resource(dev, SYS_RES_IRQ, unit->irq_rid, unit->irq, - 1); + error = bus_set_resource(dev, SYS_RES_IRQ, dmd->irq_rid, + dmd->irq, 1); if (error != 0) { - device_printf(dev, "cannot set interrupt resource, %d\n", - error); + device_printf(dev, "cannot set %s interrupt resource, %d\n", + dmd->name, error); goto err2; } - unit->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &unit->irq_rid, RF_ACTIVE); - if (unit->irq_res == NULL) { - device_printf(dev, "cannot map fault interrupt\n"); + dmd->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &dmd->irq_rid, RF_ACTIVE); + if (dmd->irq_res == NULL) { + device_printf(dev, + "cannot allocate resource for %s interrupt\n", dmd->name); error = ENXIO; goto err3; } - error = bus_setup_intr(dev, unit->irq_res, INTR_TYPE_MISC, - dmar_intr, NULL, unit, &unit->intr_handle); + error = bus_setup_intr(dev, dmd->irq_res, INTR_TYPE_MISC, + dmd->handler, NULL, unit, &dmd->intr_handle); if (error != 0) { - device_printf(dev, "cannot setup fault interrupt, %d\n", error); + device_printf(dev, "cannot setup %s interrupt, %d\n", + dmd->name, error); goto err4; } - bus_describe_intr(dev, unit->irq_res, unit->intr_handle, "fault"); - error = PCIB_MAP_MSI(pcib, dev, unit->irq, &msi_addr, &msi_data); + bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, dmd->name); + error = PCIB_MAP_MSI(pcib, dev, dmd->irq, &msi_addr, &msi_data); if (error != 0) { - device_printf(dev, "cannot map interrupt, %d\n", error); + device_printf(dev, "cannot map %s interrupt, %d\n", + dmd->name, error); goto err5; } - dmar_write4(unit, DMAR_FEDATA_REG, msi_data); - dmar_write4(unit, DMAR_FEADDR_REG, msi_addr); + dmar_write4(unit, dmd->msi_data_reg, msi_data); + dmar_write4(unit, dmd->msi_addr_reg, msi_addr); /* Only for xAPIC mode */ - dmar_write4(unit, DMAR_FEUADDR_REG, msi_addr >> 32); + dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); return (0); err5: - bus_teardown_intr(dev, unit->irq_res, unit->intr_handle); + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); err4: - bus_release_resource(dev, SYS_RES_IRQ, unit->irq_rid, unit->irq_res); + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); err3: - bus_delete_resource(dev, SYS_RES_IRQ, unit->irq_rid); + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); err2: - PCIB_RELEASE_MSIX(pcib, dev, unit->irq); - unit->irq = -1; + PCIB_RELEASE_MSIX(pcib, dev, dmd->irq); + dmd->irq = -1; err1: return (error); } @@ -318,23 +334,31 @@ static int dmar_remap_intr(device_t dev, device_t child, u_int irq) { struct dmar_unit *unit; + struct dmar_msi_data *dmd; uint64_t msi_addr; uint32_t msi_data; - int error; + int i, error; unit = device_get_softc(dev); - if (irq != unit->irq) - return (ENOENT); - error = PCIB_MAP_MSI(device_get_parent(device_get_parent(dev)), dev, - irq, &msi_addr, &msi_data); - if (error != 0) - return (error); - dmar_disable_intr(unit); - dmar_write4(unit, DMAR_FEDATA_REG, msi_data); - dmar_write4(unit, DMAR_FEADDR_REG, msi_addr); - dmar_write4(unit, DMAR_FEUADDR_REG, msi_addr >> 32); - dmar_enable_intr(unit); - return (0); + for (i = 0; i < DMAR_INTR_TOTAL; i++) { + dmd = &unit->intrs[i]; + if (irq == dmd->irq) { + error = PCIB_MAP_MSI(device_get_parent( + device_get_parent(dev)), + dev, irq, &msi_addr, &msi_data); + if (error != 0) + return (error); + DMAR_LOCK(unit); + (dmd->disable_intr)(unit); + dmar_write4(unit, dmd->msi_data_reg, msi_data); + dmar_write4(unit, dmd->msi_addr_reg, msi_addr); + dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); + (dmd->enable_intr)(unit); + DMAR_UNLOCK(unit); + return (0); + } + } + return (ENOENT); } #endif @@ -372,7 +396,7 @@ dmar_attach(device_t dev) { struct dmar_unit *unit; ACPI_DMAR_HARDWARE_UNIT *dmaru; - int error; + int i, error; unit = device_get_softc(dev); unit->dev = dev; @@ -380,7 +404,6 @@ dmar_attach(device_t dev) dmaru = dmar_find_by_index(unit->unit); if (dmaru == NULL) return (EINVAL); - unit->irq = -1; unit->segment = dmaru->Segment; unit->base = dmaru->Address; unit->reg_rid = DMAR_REG_RID; @@ -397,11 +420,38 @@ dmar_attach(device_t dev) dmar_print_caps(dev, unit, dmaru); dmar_quirks_post_ident(unit); - error = dmar_alloc_irq(dev, unit); + for (i = 0; i < DMAR_INTR_TOTAL; i++) + unit->intrs[i].irq = -1; + + unit->intrs[DMAR_INTR_FAULT].name = "fault"; + unit->intrs[DMAR_INTR_FAULT].irq_rid = DMAR_FAULT_IRQ_RID; + unit->intrs[DMAR_INTR_FAULT].handler = dmar_fault_intr; + unit->intrs[DMAR_INTR_FAULT].msi_data_reg = DMAR_FEDATA_REG; + unit->intrs[DMAR_INTR_FAULT].msi_addr_reg = DMAR_FEADDR_REG; + unit->intrs[DMAR_INTR_FAULT].msi_uaddr_reg = DMAR_FEUADDR_REG; + unit->intrs[DMAR_INTR_FAULT].enable_intr = dmar_enable_fault_intr; + unit->intrs[DMAR_INTR_FAULT].disable_intr = dmar_disable_fault_intr; + error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); return (error); } + if (DMAR_HAS_QI(unit)) { + unit->intrs[DMAR_INTR_QI].name = "qi"; + unit->intrs[DMAR_INTR_QI].irq_rid = DMAR_QI_IRQ_RID; + unit->intrs[DMAR_INTR_QI].handler = dmar_qi_intr; + unit->intrs[DMAR_INTR_QI].msi_data_reg = DMAR_IEDATA_REG; + unit->intrs[DMAR_INTR_QI].msi_addr_reg = DMAR_IEADDR_REG; + unit->intrs[DMAR_INTR_QI].msi_uaddr_reg = DMAR_IEUADDR_REG; + unit->intrs[DMAR_INTR_QI].enable_intr = dmar_enable_qi_intr; + unit->intrs[DMAR_INTR_QI].disable_intr = dmar_disable_qi_intr; + error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); + if (error != 0) { + dmar_release_resources(dev, unit); + return (error); + } + } + mtx_init(&unit->lock, "dmarhw", NULL, MTX_DEF); unit->domids = new_unrhdr(0, dmar_nd2mask(DMAR_CAP_ND(unit->hw_cap)), &unit->lock); @@ -453,6 +503,11 @@ dmar_attach(device_t dev) dmar_release_resources(dev, unit); return (error); } + error = dmar_init_qi(unit); + if (error != 0) { + dmar_release_resources(dev, unit); + return (error); + } error = dmar_init_busdma(unit); if (error != 0) { dmar_release_resources(dev, unit); @@ -845,12 +900,12 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dm (uintmax_t)resmem->EndAddress); } - ptr = (char *)resmem + sizeof(*resmem); - ptrend = (char *)resmem + resmem->Header.Length; + ptr = (const char *)resmem + sizeof(*resmem); + ptrend = (const char *)resmem + resmem->Header.Length; for (;;) { if (ptr >= ptrend) break; - devscope = (ACPI_DMAR_DEVICE_SCOPE *)ptr; + devscope = (const ACPI_DMAR_DEVICE_SCOPE *)ptr; ptr += devscope->Length; /* XXXKIB bridge */ if (devscope->EntryType != ACPI_DMAR_SCOPE_TYPE_ENDPOINT) @@ -859,11 +914,11 @@ dmar_inst_rmrr_iter(ACPI_DMAR_HEADER *dm dmar_print_path(iria->dmar->dev, "RMRR scope", devscope->Bus, (devscope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE)) / 2, - (ACPI_DMAR_PCI_PATH *)(devscope + 1)); + (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); } dev = dmar_path_dev(resmem->Segment, (devscope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE)) / 2, devscope->Bus, - (ACPI_DMAR_PCI_PATH *)(devscope + 1)); + (const ACPI_DMAR_PCI_PATH *)(devscope + 1)); if (dev == NULL) { if (dmar_match_verbose) printf("null dev\n"); @@ -994,6 +1049,8 @@ DB_FUNC(dmar_ctx, db_dmar_print_ctx, db_ } show_mappings = strchr(db_tok_string, 'm') != NULL; t = db_read_token(); + } else { + show_mappings = false; } if (t == tNUMBER) { domain = db_tok_number; @@ -1058,6 +1115,33 @@ dmar_print_one(int idx, bool show_ctxs, (uintmax_t)dmar_read8(unit, frir), (uintmax_t)dmar_read8(unit, frir + 8)); } + if (DMAR_HAS_QI(unit)) { + db_printf("ied 0x%x iea 0x%x ieua 0x%x\n", + dmar_read4(unit, DMAR_IEDATA_REG), + dmar_read4(unit, DMAR_IEADDR_REG), + dmar_read4(unit, DMAR_IEUADDR_REG)); + if (unit->qi_enabled) { + db_printf("qi is enabled: queue @0x%jx (IQA 0x%jx) " + "size 0x%jx\n" + " head 0x%x tail 0x%x avail 0x%x status 0x%x ctrl 0x%x\n" + " hw compl 0x%x@%p/phys@%jx next seq 0x%x gen 0x%x\n", + (uintmax_t)unit->inv_queue, + (uintmax_t)dmar_read8(unit, DMAR_IQA_REG), + (uintmax_t)unit->inv_queue_size, + dmar_read4(unit, DMAR_IQH_REG), + dmar_read4(unit, DMAR_IQT_REG), + unit->inv_queue_avail, + dmar_read4(unit, DMAR_ICS_REG), + dmar_read4(unit, DMAR_IECTL_REG), + unit->inv_waitd_seq_hw, + &unit->inv_waitd_seq_hw, + (uintmax_t)unit->inv_waitd_seq_hw_phys, + unit->inv_waitd_seq, + unit->inv_waitd_gen); + } else { + db_printf("qi is disabled\n"); + } + } if (show_ctxs) { db_printf("contexts:\n"); LIST_FOREACH(ctx, &unit->contexts, link) { Modified: stable/10/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_fault.c Tue Dec 17 13:49:35 2013 (r259512) @@ -85,7 +85,7 @@ dmar_fault_next(struct dmar_unit *unit, } static void -dmar_intr_clear(struct dmar_unit *unit, uint32_t fsts) +dmar_fault_intr_clear(struct dmar_unit *unit, uint32_t fsts) { uint32_t clear; @@ -117,7 +117,7 @@ dmar_intr_clear(struct dmar_unit *unit, } int -dmar_intr(void *arg) +dmar_fault_intr(void *arg) { struct dmar_unit *unit; uint64_t fault_rec[2]; @@ -128,7 +128,7 @@ dmar_intr(void *arg) unit = arg; enqueue = false; fsts = dmar_read4(unit, DMAR_FSTS_REG); - dmar_intr_clear(unit, fsts); + dmar_fault_intr_clear(unit, fsts); if ((fsts & DMAR_FSTS_PPF) == 0) goto done; @@ -215,7 +215,7 @@ dmar_fault_task(void *arg, int pending _ ctx->flags |= DMAR_CTX_FAULTED; ctx->last_fault_rec[0] = fault_rec[0]; ctx->last_fault_rec[1] = fault_rec[1]; - device_printf(ctx->ctx_tag.owner, ""); + device_print_prettyname(ctx->ctx_tag.owner); } DMAR_UNLOCK(unit); printf( @@ -263,9 +263,11 @@ dmar_init_fault_log(struct dmar_unit *un taskqueue_start_threads(&unit->fault_taskqueue, 1, PI_AV, "dmar%d fault taskq", unit->unit); - dmar_disable_intr(unit); + DMAR_LOCK(unit); + dmar_disable_fault_intr(unit); dmar_clear_faults(unit); - dmar_enable_intr(unit); + dmar_enable_fault_intr(unit); + DMAR_UNLOCK(unit); return (0); } @@ -274,16 +276,40 @@ void dmar_fini_fault_log(struct dmar_unit *unit) { - dmar_disable_intr(unit); + DMAR_LOCK(unit); + dmar_disable_fault_intr(unit); + DMAR_UNLOCK(unit); if (unit->fault_taskqueue == NULL) return; taskqueue_drain(unit->fault_taskqueue, &unit->fault_task); taskqueue_free(unit->fault_taskqueue); + unit->fault_taskqueue = NULL; mtx_destroy(&unit->fault_lock); free(unit->fault_log, M_DEVBUF); unit->fault_log = NULL; unit->fault_log_head = unit->fault_log_tail = 0; } + +void +dmar_enable_fault_intr(struct dmar_unit *unit) +{ + uint32_t fectl; + + DMAR_ASSERT_LOCKED(unit); + fectl = dmar_read4(unit, DMAR_FECTL_REG); + fectl &= ~DMAR_FECTL_IM; + dmar_write4(unit, DMAR_FECTL_REG, fectl); +} + +void +dmar_disable_fault_intr(struct dmar_unit *unit) +{ + uint32_t fectl; + + DMAR_ASSERT_LOCKED(unit); + fectl = dmar_read4(unit, DMAR_FECTL_REG); + dmar_write4(unit, DMAR_FECTL_REG, fectl | DMAR_FECTL_IM); +} Modified: stable/10/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_gas.c Tue Dec 17 13:49:35 2013 (r259512) @@ -92,8 +92,10 @@ dmar_gas_alloc_entry(struct dmar_ctx *ct res = uma_zalloc(dmar_map_entry_zone, ((flags & DMAR_PGF_WAITOK) != 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); - if (res != NULL) + if (res != NULL) { + res->ctx = ctx; atomic_add_int(&ctx->entries_cnt, 1); + } return (res); } @@ -101,6 +103,9 @@ void dmar_gas_free_entry(struct dmar_ctx *ctx, struct dmar_map_entry *entry) { + KASSERT(ctx == entry->ctx, + ("mismatched free ctx %p entry %p entry->ctx %p", ctx, + entry, entry->ctx)); atomic_subtract_int(&ctx->entries_cnt, 1); uma_zfree(dmar_map_entry_zone, entry); } @@ -170,6 +175,9 @@ dmar_gas_check_free(struct dmar_ctx *ctx dmar_gaddr_t v; RB_FOREACH(entry, dmar_gas_entries_tree, &ctx->rb_root) { + KASSERT(ctx == entry->ctx, + ("mismatched free ctx %p entry %p entry->ctx %p", ctx, + entry, entry->ctx)); next = RB_NEXT(dmar_gas_entries_tree, &ctx->rb_root, entry); if (next == NULL) { MPASS(entry->free_after == ctx->end - entry->end); @@ -583,7 +591,7 @@ dmar_gas_free_space(struct dmar_ctx *ctx #endif } -static void +void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry) { struct dmar_map_entry *next, *prev; @@ -644,10 +652,7 @@ dmar_gas_map(struct dmar_ctx *ctx, const ((eflags & DMAR_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), (flags & DMAR_GM_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); if (error == ENOMEM) { - DMAR_CTX_LOCK(ctx); - dmar_gas_free_space(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - dmar_gas_free_entry(ctx, entry); + dmar_ctx_unload_entry(entry, true); return (error); } KASSERT(error == 0, @@ -689,10 +694,7 @@ dmar_gas_map_region(struct dmar_ctx *ctx ((eflags & DMAR_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), (flags & DMAR_GM_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); if (error == ENOMEM) { - DMAR_CTX_LOCK(ctx); - dmar_gas_free_region(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - entry->flags = 0; + dmar_ctx_unload_entry(entry, false); return (error); } KASSERT(error == 0, Modified: stable/10/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Mon Oct 28 13:33:29 2013 (r257251) +++ stable/10/sys/x86/iommu/intel_idpgtbl.c Tue Dec 17 13:49:35 2013 (r259512) @@ -67,8 +67,6 @@ __FBSDID("$FreeBSD$"); static int ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, int flags); -static void ctx_flush_iotlb(struct dmar_ctx *ctx, dmar_gaddr_t base, - dmar_gaddr_t size, int flags); /* * The cache of the identity mapping page tables for the DMARs. Using @@ -169,6 +167,8 @@ ctx_get_idmap_pgtbl(struct dmar_ctx *ctx vm_page_t m; int leaf, i; + leaf = 0; /* silence gcc */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 14:50:36 2013 Return-Path: Delivered-To: svn-src-all@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 A6EF8D78; Tue, 17 Dec 2013 14:50:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 872541ADB; Tue, 17 Dec 2013 14:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHEoajx009880; Tue, 17 Dec 2013 14:50:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHEoaeB009878; Tue, 17 Dec 2013 14:50:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171450.rBHEoaeB009878@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 14:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259513 - in head/sys: dev/ofw powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 14:50:36 -0000 Author: nwhitehorn Date: Tue Dec 17 14:50:35 2013 New Revision: 259513 URL: http://svnweb.freebsd.org/changeset/base/259513 Log: Configure interrupt sense based on device tree information. This extends the OF interrupt map API to return sense information to the caller and the PowerPC Open Firmware PCI base driver to use it to program the PIC. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 13:49:35 2013 (r259512) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 14:50:35 2013 (r259513) @@ -285,7 +285,7 @@ ofw_bus_lookup_imap(phandle_t node, stru * maskbuf must point to a buffer of length physsz + intrsz. * The interrupt is returned in result, which must point to a buffer of length * rintrsz (which gives the expected size of the mapped interrupt). - * Returns 1 if a mapping was found, 0 otherwise. + * Returns number of cells in the interrupt if a mapping was found, 0 otherwise. */ int ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz, @@ -325,19 +325,13 @@ ofw_bus_search_intrmap(void *intr, int i tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); - /* - * XXX: Apple hardware uses a second cell to set information - * on the interrupt trigger type. This information should - * be used somewhere to program the PIC. - */ - if (bcmp(ref, mptr, physsz + intrsz) == 0) { bcopy(mptr + physsz + intrsz + sizeof(parent), - result, rintrsz); + result, MIN(rintrsz, pintrsz)); if (iparent != NULL) *iparent = parent; - return (1); + return (pintrsz/sizeof(pcell_t)); } mptr += tsz; i -= tsz; Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 13:49:35 2013 (r259512) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 14:50:35 2013 (r259513) @@ -256,7 +256,8 @@ ofw_pci_route_interrupt(device_t bus, de { struct ofw_pci_softc *sc; struct ofw_pci_register reg; - uint32_t pintr, mintr; + uint32_t pintr, mintr[2]; + int intrcells; phandle_t iparent; uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; @@ -269,10 +270,15 @@ ofw_pci_route_interrupt(device_t bus, de (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) - return (ofw_bus_map_intr(dev, iparent, mintr)); + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent, maskbuf); + if (intrcells) { + pintr = ofw_bus_map_intr(dev, iparent, mintr[0]); + if (intrcells == 2) + ofw_bus_config_intr(dev, pintr, mintr[1]); + return (pintr); + } /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 14:51:48 2013 Return-Path: Delivered-To: svn-src-all@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 A3DF0ED9; Tue, 17 Dec 2013 14:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 829931AEF; Tue, 17 Dec 2013 14:51:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHEpme7010488; Tue, 17 Dec 2013 14:51:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHEpmLW010486; Tue, 17 Dec 2013 14:51:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171451.rBHEpmLW010486@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 14:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259514 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 14:51:48 -0000 Author: nwhitehorn Date: Tue Dec 17 14:51:47 2013 New Revision: 259514 URL: http://svnweb.freebsd.org/changeset/base/259514 Log: Remove dead code. Most of this was in an #if 0 block; the rest is not used and duplicates functionality in dev/ofw. Modified: head/sys/dev/fdt/fdt_common.h head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Tue Dec 17 14:50:35 2013 (r259513) +++ head/sys/dev/fdt/fdt_common.h Tue Dec 17 14:51:47 2013 (r259514) @@ -47,14 +47,6 @@ struct fdt_pci_range { u_long len; }; -struct fdt_pci_intr { - int addr_cells; - int intr_cells; - int map_len; - pcell_t *map; - pcell_t *mask; -}; - struct fdt_sense_level { enum intr_trigger trig; enum intr_polarity pol; @@ -110,11 +102,9 @@ int fdt_is_enabled(phandle_t); int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_pci_intr_info(phandle_t, struct fdt_pci_intr *); int fdt_pci_ranges(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); int fdt_pci_ranges_decode(phandle_t, struct fdt_pci_range *, struct fdt_pci_range *); -int fdt_pci_route_intr(int, int, int, int, struct fdt_pci_intr *, int *); int fdt_ranges_verify(pcell_t *, int, int, int, int); int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Tue Dec 17 14:50:35 2013 (r259513) +++ head/sys/dev/fdt/fdt_pci.c Tue Dec 17 14:51:47 2013 (r259514) @@ -180,159 +180,6 @@ fdt_pci_ranges(phandle_t node, struct fd return (0); } -static int -fdt_addr_cells(phandle_t node, int *addr_cells) -{ - pcell_t cell; - int cell_size; - - cell_size = sizeof(cell); - if (OF_getprop(node, "#address-cells", &cell, cell_size) < cell_size) - return (EINVAL); - *addr_cells = fdt32_to_cpu((int)cell); - - if (*addr_cells > 3) - return (ERANGE); - return (0); -} - -static int -fdt_interrupt_cells(phandle_t node) -{ - pcell_t intr_cells; - - if (OF_getprop(node, "#interrupt-cells", &intr_cells, - sizeof(intr_cells)) <= 0) { - debugf("no intr-cells defined, defaulting to 1\n"); - intr_cells = 1; - } - intr_cells = fdt32_to_cpu(intr_cells); - - return ((int)intr_cells); -} - -int -fdt_pci_intr_info(phandle_t node, struct fdt_pci_intr *intr_info) -{ - void *map, *mask; - int acells, icells; - int error, len; - - error = fdt_addr_cells(node, &acells); - if (error) - return (error); - - icells = fdt_interrupt_cells(node); - - /* - * Retrieve the interrupt map and mask properties. - */ - len = OF_getprop_alloc(node, "interrupt-map-mask", 1, &mask); - if (len / sizeof(pcell_t) != (acells + icells)) { - debugf("bad mask len = %d\n", len); - goto err; - } - - len = OF_getprop_alloc(node, "interrupt-map", 1, &map); - if (len <= 0) { - debugf("bad map len = %d\n", len); - goto err; - } - - intr_info->map_len = len; - intr_info->map = map; - intr_info->mask = mask; - intr_info->addr_cells = acells; - intr_info->intr_cells = icells; - - debugf("acells=%u, icells=%u, map_len=%u\n", acells, icells, len); - return (0); - -err: - free(mask, M_OFWPROP); - return (ENXIO); -} - -int -fdt_pci_route_intr(int bus, int slot, int func, int pin, - struct fdt_pci_intr *intr_info, int *interrupt) -{ - pcell_t child_spec[4], masked[4]; - phandle_t iph; - pcell_t intr_par; - pcell_t *map_ptr; - uint32_t addr; - int i, j, map_len; - int par_intr_cells, par_addr_cells, child_spec_cells, row_cells; - int par_idx, spec_idx, err, trig, pol; - - child_spec_cells = intr_info->addr_cells + intr_info->intr_cells; - if (child_spec_cells > sizeof(child_spec) / sizeof(pcell_t)) - return (ENOMEM); - - addr = (bus << 16) | (slot << 11) | (func << 8); - child_spec[0] = addr; - child_spec[1] = 0; - child_spec[2] = 0; - child_spec[3] = pin; - - map_len = intr_info->map_len; - map_ptr = intr_info->map; - - par_idx = child_spec_cells; - i = 0; - while (i < map_len) { - iph = fdt32_to_cpu(map_ptr[par_idx]); - intr_par = OF_xref_phandle(iph); - - err = fdt_addr_cells(intr_par, &par_addr_cells); - if (err != 0) { - debugf("could not retrieve intr parent #addr-cells\n"); - return (err); - } - par_intr_cells = fdt_interrupt_cells(intr_par); - - row_cells = child_spec_cells + 1 + par_addr_cells + - par_intr_cells; - - /* - * Apply mask and look up the entry in interrupt map. - */ - for (j = 0; j < child_spec_cells; j++) { - masked[j] = child_spec[j] & - fdt32_to_cpu(intr_info->mask[j]); - - if (masked[j] != fdt32_to_cpu(map_ptr[j])) - goto next; - } - - /* - * Decode interrupt of the parent intr controller. - */ - spec_idx = child_spec_cells + 1 + par_addr_cells; - err = fdt_intr_decode(intr_par, &map_ptr[spec_idx], - interrupt, &trig, &pol); - if (err != 0) { - debugf("could not decode interrupt\n"); - return (err); - } - debugf("decoded intr = %d, trig = %d, pol = %d\n", *interrupt, - trig, pol); - -#if defined(__powerpc__) - powerpc_config_intr(FDT_MAP_IRQ(iph, *interrupt), trig, - pol); -#endif - return (0); - -next: - map_ptr += row_cells; - i += (row_cells * sizeof(pcell_t)); - } - - return (ENXIO); -} - #if defined(__arm__) int fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, @@ -360,217 +207,3 @@ fdt_pci_devmap(phandle_t node, struct ar } #endif -#if 0 -static int -fdt_pci_config_bar(device_t dev, int bus, int slot, int func, int bar) -{ -} - -static int -fdt_pci_config_normal(device_t dev, int bus, int slot, int func) -{ - int bar; - uint8_t command, intline, intpin; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - bar = 0; - while (bar <= PCIR_MAX_BAR_0) - bar += fdt_pci_config_bar(dev, bus, slot, func, bar); - - /* Perform interrupt routing. */ - intpin = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(dev, bus, slot, func, intpin); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); -} - -static int -fdt_pci_config_bridge(device_t dev, int bus, int secbus, int slot, int func) -{ - int maxbar; - uint8_t command; - - command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); - command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); - PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); - - /* Program the base address registers. */ - maxbar = (hdrtype & PCIM_HDRTYPE) ? 1 : 6; - bar = 0; - while (bar < maxbar) - bar += fsl_pcib_init_bar(sc, bus, slot, func, - bar); - - /* Perform interrupt routing. */ - intpin = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_INTPIN, 1); - intline = fsl_pcib_route_int(sc, bus, slot, func, - intpin); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_INTLINE, intline, 1); - - command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_COMMAND, command, 1); - - /* - * Handle PCI-PCI bridges - */ - class = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_CLASS, 1); - subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, - func, PCIR_SUBCLASS, 1); - - /* Allow only proper PCI-PCI briges */ - if (class != PCIC_BRIDGE) - continue; - if (subclass != PCIS_BRIDGE_PCI) - continue; - - secbus++; - - /* Program I/O decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEL_1, sc->sc_ioport.rm_start >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITL_1, sc->sc_ioport.rm_end >> 8, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOBASEH_1, sc->sc_ioport.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_IOLIMITH_1, sc->sc_ioport.rm_end >> 16, 2); - - /* Program (non-prefetchable) memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMBASE_1, sc->sc_iomem.rm_start >> 16, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_MEMLIMIT_1, sc->sc_iomem.rm_end >> 16, 2); - - /* Program prefetchable memory decoder. */ - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEL_1, 0x0010, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITL_1, 0x000f, 2); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMBASEH_1, 0x00000000, 4); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PMLIMITH_1, 0x00000000, 4); - - /* Read currect bus register configuration */ - old_pribus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_PRIBUS_1, 1); - old_secbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SECBUS_1, 1); - old_subbus = fsl_pcib_read_config(sc->sc_dev, bus, - slot, func, PCIR_SUBBUS_1, 1); - - if (bootverbose) - printf("PCI: reading firmware bus numbers for " - "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus); - - new_pribus = bus; - new_secbus = secbus; - - secbus = fsl_pcib_init(sc, secbus, - (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); - - new_subbus = secbus; - - if (bootverbose) - printf("PCI: translate firmware bus numbers " - "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", - secbus, old_pribus, old_secbus, old_subbus, - new_pribus, new_secbus, new_subbus); - - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_PRIBUS_1, new_pribus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SECBUS_1, new_secbus, 1); - fsl_pcib_write_config(sc->sc_dev, bus, slot, func, - PCIR_SUBBUS_1, new_subbus, 1); - -} - -static int -fdt_pci_config_slot(device_t dev, int bus, int secbus, int slot) -{ - int func, maxfunc; - uint16_t vendor; - uint8_t hdrtype; - - maxfunc = 0; - for (func = 0; func <= maxfunc; func++) { - hdrtype = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_HDRTYPE, 1); - if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) - continue; - if (func == 0 && (hdrtype & PCIM_MFDEV)) - maxfunc = PCI_FUNCMAX; - - vendor = PCIB_READ_CONFIG(dev, bus, slot, func, - PCIR_VENDOR, 2); - if (vendor == 0xffff) - continue; - - if ((hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_NORMAL) - fdt_pci_config_normal(dev, bus, slot, func); - else - secbus = fdt_pci_config_bridge(dev, bus, secbus, - slot, func); - } - - return (secbus); -} - -static int -fdt_pci_config_bus(device_t dev, int bus, int maxslot) -{ - int func, maxfunc, secbus, slot; - - secbus = bus; - for (slot = 0; slot <= maxslot; slot++) - secbus = fdt_pci_config_slot(dev, bus, secbus, slot); - - return (secbus); -} - -int -fdt_pci_config_domain(device_t dev) -{ - pcell_t bus_range[2]; - phandle_t root; - int bus, error, maxslot; - - root = ofw_bus_get_node(dev); - if (root == 0) - return (EINVAL); - if (!fdt_is_type(root, "pci")) - return (EINVAL); - - /* - * Determine the bus number of the root in this domain. - * Lacking any information, this will be bus 0. - * Write the bus number to the bus device, using the IVAR. - */ - if ((OF_getprop(root, "bus-range", bus_range, sizeof(bus_range)) <= 0) - bus = 0; - else - bus = fdt32_to_cpu(bus_range[0]); - - error = BUS_WRITE_IVAR(dev, NULL, PCIB_IVAR_BUS, bus); - if (error) - return (error); - - /* Get the maximum slot number for bus-enumeration. */ - maxslot = PCIB_MAXSLOTS(dev); - - bus = fdt_pci_config_bus(dev, bus, maxslot); - return (0); -} -#endif From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 14:55:24 2013 Return-Path: Delivered-To: svn-src-all@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 4B85B1FD; Tue, 17 Dec 2013 14:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36F081B25; Tue, 17 Dec 2013 14:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHEtOCE010965; Tue, 17 Dec 2013 14:55:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHEtOmf010964; Tue, 17 Dec 2013 14:55:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171455.rBHEtOmf010964@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 14:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259515 - releng/10.0/sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 14:55:24 -0000 Author: nwhitehorn Date: Tue Dec 17 14:55:23 2013 New Revision: 259515 URL: http://svnweb.freebsd.org/changeset/base/259515 Log: MF10 259465: Add new sysctl, kern.supported_archs, containing the list of FreeBSD MACHINE_ARCH values whose binaries this kernel can run. This patch provides a feature requested for implementing pkgng ABI identifiers in a robust way. The list is designed to indicate whether, say, an i386 package can be run on the current system. If kern.supported_abis contains "i386", then the answer is yes. Otherwise, the answer is no. At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we gain support for more interesting combinations, this needs to become more flexible, possibily through the sysent framework, along with the hw.machine_arch emulation immediately preceding this code in kern_mib.c. Reviewed by: imp Approved by: re (glebius) Modified: releng/10.0/sys/kern/kern_mib.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/kern/kern_mib.c ============================================================================== --- releng/10.0/sys/kern/kern_mib.c Tue Dec 17 14:51:47 2013 (r259514) +++ releng/10.0/sys/kern/kern_mib.c Tue Dec 17 14:55:23 2013 (r259515) @@ -261,6 +261,13 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, +#ifdef COMPAT_FREEBSD32 + MACHINE_ARCH " " MACHINE_ARCH32, 0, "Supported architectures for binaries"); +#else + MACHINE_ARCH, 0, "Supported architectures for binaries"); +#endif + static int sysctl_hostname(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 15:11:27 2013 Return-Path: Delivered-To: svn-src-all@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 AB871816; Tue, 17 Dec 2013 15:11:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94F021D90; Tue, 17 Dec 2013 15:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFBRrQ018263; Tue, 17 Dec 2013 15:11:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFBPm4018244; Tue, 17 Dec 2013 15:11:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312171511.rBHFBPm4018244@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Dec 2013 15:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259516 - in head/sys: arm/mv dev/ofw powerpc/ofw sparc64/ebus sparc64/isa sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 15:11:27 -0000 Author: nwhitehorn Date: Tue Dec 17 15:11:24 2013 New Revision: 259516 URL: http://svnweb.freebsd.org/changeset/base/259516 Log: Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf internally instead of requiring the caller to allocate it. Modified: head/sys/arm/mv/mv_pci.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/isa/ofw_isa.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/ofw_pcib_subr.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/arm/mv/mv_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -884,7 +884,6 @@ mv_pcib_route_interrupt(device_t bus, de struct ofw_pci_register reg; uint32_t pintr, mintr; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; @@ -897,7 +896,7 @@ mv_pcib_route_interrupt(device_t bus, de if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) + &iparent)) return (ofw_bus_map_intr(dev, iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/dev/ofw/ofw_bus_subr.c Tue Dec 17 15:11:24 2013 (r259516) @@ -251,8 +251,9 @@ ofw_bus_setup_iinfo(phandle_t node, stru int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, - phandle_t *iparent, void *maskbuf) + phandle_t *iparent) { + uint8_t maskbuf[regsz + pintrsz]; int rv; if (ii->opi_imapsz <= 0) Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/dev/ofw/ofw_bus_subr.h Tue Dec 17 15:11:24 2013 (r259516) @@ -68,7 +68,7 @@ bus_child_pnpinfo_str_t ofw_bus_gen_chil /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, - void *, int, void *, int, phandle_t *, void *); + void *, int, void *, int, phandle_t *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -259,7 +259,6 @@ ofw_pci_route_interrupt(device_t bus, de uint32_t pintr, mintr[2]; int intrcells; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; @@ -272,7 +271,7 @@ ofw_pci_route_interrupt(device_t bus, de intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), - mintr, sizeof(mintr), &iparent, maskbuf); + mintr, sizeof(mintr), &iparent); if (intrcells) { pintr = ofw_bus_map_intr(dev, iparent, mintr[0]); if (intrcells == 2) Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Tue Dec 17 15:11:24 2013 (r259516) @@ -134,9 +134,9 @@ ofw_pcib_pci_route_interrupt(device_t br struct ofw_pcib_softc *sc; struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; - cell_t pintr, mintr; + cell_t pintr, mintr[2]; + int intrcells; phandle_t iparent; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); ii = &sc->ops_iinfo; @@ -149,15 +149,20 @@ ofw_pcib_pci_route_interrupt(device_t br (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent, maskbuf)) { + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, + sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), + &iparent); + if (intrcells) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems * in some cases, and never seems to be required. */ - return (ofw_bus_map_intr(dev, iparent, mintr)); + mintr[0] = ofw_bus_map_intr(dev, iparent, mintr[0]); + if (intrcells == 2) + ofw_bus_config_intr(dev, mintr[0], mintr[1]); + + return (mintr[0]); } } else if (intpin >= 1 && intpin <= 4) { /* Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/ebus/ebus.c Tue Dec 17 15:11:24 2013 (r259516) @@ -638,7 +638,6 @@ ebus_setup_dinfo(device_t dev, struct eb uint64_t start; uint32_t rintr; int i, nintr, nreg, rv; - uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; edi = malloc(sizeof(*edi), M_DEVBUF, M_ZERO | M_WAITOK); if (ofw_bus_gen_setup_devinfo(&edi->edi_obdinfo, node) != 0) { @@ -673,7 +672,7 @@ ebus_setup_dinfo(device_t dev, struct eb intr = intrs[i]; rv = ofw_bus_lookup_imap(node, &sc->sc_iinfo, ®, sizeof(reg), &intr, sizeof(intr), &rintr, - sizeof(rintr), NULL, maskbuf); + sizeof(rintr), NULL); #ifndef SUN4V if (rv != 0) rintr = INTMAP_VEC(sc->sc_ign, rintr); Modified: head/sys/sparc64/isa/ofw_isa.c ============================================================================== --- head/sys/sparc64/isa/ofw_isa.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/isa/ofw_isa.c Tue Dec 17 15:11:24 2013 (r259516) @@ -129,7 +129,6 @@ ofw_isa_route_intr(device_t bridge, phan ofw_isa_intr_t intr) { struct isa_regs reg; - uint8_t maskbuf[sizeof(reg) + sizeof(intr)]; device_t pbridge; ofw_isa_intr_t mintr; @@ -139,7 +138,7 @@ ofw_isa_route_intr(device_t bridge, phan * fully specified, so we may not continue to map. */ if (!ofw_bus_lookup_imap(node, ii, ®, sizeof(reg), - &intr, sizeof(intr), &mintr, sizeof(mintr), NULL, maskbuf)) { + &intr, sizeof(intr), &mintr, sizeof(mintr), NULL)) { /* Try routing at the parent bridge. */ mintr = PCIB_ROUTE_INTERRUPT(pbridge, bridge, intr); } Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/fire.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1470,13 +1470,12 @@ fire_route_interrupt(device_t bridge, de struct fire_softc *sc; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf) != 0) + NULL) != 0) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", Modified: head/sys/sparc64/pci/ofw_pcib_subr.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcib_subr.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/ofw_pcib_subr.c Tue Dec 17 15:11:24 2013 (r259516) @@ -70,7 +70,6 @@ ofw_pcib_gen_route_interrupt(device_t br struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); ii = &sc->ops_iinfo; @@ -78,7 +77,7 @@ ofw_pcib_gen_route_interrupt(device_t br pintr = intpin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) { + NULL)) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/psycho.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1046,13 +1046,12 @@ psycho_route_interrupt(device_t bridge, struct ofw_pci_register reg; bus_addr_t intrmap; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) + NULL)) return (mintr); /* * If this is outside of the range for an intpin, it's likely a full Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Tue Dec 17 14:55:23 2013 (r259515) +++ head/sys/sparc64/pci/schizo.c Tue Dec 17 15:11:24 2013 (r259516) @@ -1119,13 +1119,12 @@ schizo_route_interrupt(device_t bridge, struct schizo_softc *sc; struct ofw_pci_register reg; ofw_pci_intr_t pintr, mintr; - uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - NULL, maskbuf)) + NULL)) return (mintr); device_printf(bridge, "could not route pin %d for device %d.%d\n", From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 15:23:48 2013 Return-Path: Delivered-To: svn-src-all@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 C4C3BDE3; Tue, 17 Dec 2013 15:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF3E91E70; Tue, 17 Dec 2013 15:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFNmkr022090; Tue, 17 Dec 2013 15:23:48 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFNmJ5022087; Tue, 17 Dec 2013 15:23:48 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312171523.rBHFNmJ5022087@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 17 Dec 2013 15:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259517 - in head/sys/arm: broadcom/bcm2835 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 15:23:48 -0000 Author: ray Date: Tue Dec 17 15:23:47 2013 New Revision: 259517 URL: http://svnweb.freebsd.org/changeset/base/259517 Log: Add vt support for RPi. (No early stage yet.) Sponsored by: The FreeBSD Foundation Added: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c - copied, changed from r259364, head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B Copied and modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c (from r259364, head/sys/arm/broadcom/bcm2835/bcm2835_fb.c) ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 13 23:56:53 2013 (r259364, copy source) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:23:47 2013 (r259517) @@ -60,47 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include +#include "fb_if.h" #include "mbox_if.h" -#define BCMFB_FONT_HEIGHT 16 - -struct argb { - uint8_t a; - uint8_t r; - uint8_t g; - uint8_t b; -}; - -static struct argb bcmfb_palette[16] = { - {0x00, 0x00, 0x00, 0x00}, - {0x00, 0x00, 0x00, 0xaa}, - {0x00, 0x00, 0xaa, 0x00}, - {0x00, 0x00, 0xaa, 0xaa}, - {0x00, 0xaa, 0x00, 0x00}, - {0x00, 0xaa, 0x00, 0xaa}, - {0x00, 0xaa, 0x55, 0x00}, - {0x00, 0xaa, 0xaa, 0xaa}, - {0x00, 0x55, 0x55, 0x55}, - {0x00, 0x55, 0x55, 0xff}, - {0x00, 0x55, 0xff, 0x55}, - {0x00, 0x55, 0xff, 0xff}, - {0x00, 0xff, 0x55, 0x55}, - {0x00, 0xff, 0x55, 0xff}, - {0x00, 0xff, 0xff, 0x55}, - {0x00, 0xff, 0xff, 0xff} -}; - -/* mouse pointer from dev/syscons/scgfbrndr.c */ -static u_char mouse_pointer[16] = { - 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, - 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 -}; - #define FB_WIDTH 640 #define FB_HEIGHT 480 #define FB_DEPTH 24 @@ -121,8 +88,7 @@ struct bcm_fb_config { struct bcmsc_softc { device_t dev; - struct cdev * cdev; - struct mtx mtx; + struct fb_info *info; bus_dma_tag_t dma_tag; bus_dmamap_t dma_map; struct bcm_fb_config* fb_config; @@ -131,56 +97,34 @@ struct bcmsc_softc { }; -struct video_adapter_softc { - /* Videoadpater part */ - video_adapter_t va; - int console; - - intptr_t fb_addr; - intptr_t fb_paddr; - unsigned int fb_size; - - unsigned int height; - unsigned int width; - unsigned int depth; - unsigned int stride; - - unsigned int xmargin; - unsigned int ymargin; - - unsigned char *font; - int initialized; -}; - -static struct bcmsc_softc *bcmsc_softc; -static struct video_adapter_softc va_softc; - -#define bcm_fb_lock(_sc) mtx_lock(&(_sc)->mtx) -#define bcm_fb_unlock(_sc) mtx_unlock(&(_sc)->mtx) -#define bcm_fb_lock_assert(sc) mtx_assert(&(_sc)->mtx, MA_OWNED) - static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); -static void bcmfb_update_margins(video_adapter_t *adp); -static int bcmfb_configure(int); static void bcm_fb_init(void *arg) { struct bcmsc_softc *sc = arg; - struct video_adapter_softc *va_sc = &va_softc; - int err; volatile struct bcm_fb_config* fb_config = sc->fb_config; + struct fb_info *info; phandle_t node; pcell_t cell; device_t mbox; + device_t fbd; + int err = 0; node = ofw_bus_get_node(sc->dev); fb_config->xres = 0; fb_config->yres = 0; fb_config->bpp = 0; + fb_config->vxres = 0; + fb_config->vyres = 0; + fb_config->xoffset = 0; + fb_config->yoffset = 0; + fb_config->base = 0; + fb_config->pitch = 0; + fb_config->screen_size = 0; if ((OF_getprop(node, "broadcom,width", &cell, sizeof(cell))) > 0) fb_config->xres = (int)fdt32_to_cpu(cell); @@ -197,14 +141,6 @@ bcm_fb_init(void *arg) if (fb_config->bpp == 0) fb_config->bpp = FB_DEPTH; - fb_config->vxres = 0; - fb_config->vyres = 0; - fb_config->xoffset = 0; - fb_config->yoffset = 0; - fb_config->base = 0; - fb_config->pitch = 0; - fb_config->screen_size = 0; - bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); @@ -228,17 +164,33 @@ bcm_fb_init(void *arg) fb_config->pitch, fb_config->base, fb_config->screen_size); - va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); - va_sc->fb_paddr = fb_config->base; - va_sc->fb_size = fb_config->screen_size; - va_sc->depth = fb_config->bpp; - va_sc->stride = fb_config->pitch; - - va_sc->width = fb_config->xres; - va_sc->height = fb_config->yres; - bcmfb_update_margins(&va_sc->va); - } - else { + + + + info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); + info->fb_name = device_get_nameunit(sc->dev); + info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + info->fb_pbase = fb_config->base; + info->fb_size = fb_config->screen_size; + info->fb_bpp = info->fb_depth = fb_config->bpp; + info->fb_stride = fb_config->pitch; + info->fb_width = fb_config->xres; + info->fb_height = fb_config->yres; + + sc->info = info; + + fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + if (fbd == NULL) { + device_printf(sc->dev, "Failed to add fbd child\n"); + return; + } + if (device_probe_and_attach(fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + return; + } + + + } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); return; } @@ -249,18 +201,10 @@ bcm_fb_init(void *arg) static int bcm_fb_probe(device_t dev) { - int error = 0; - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) return (ENXIO); - device_set_desc(dev, "BCM2835 framebuffer device"); - - error = sc_probe_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD); - if (error != 0) - return (error); - + device_set_desc(dev, "BCM2835 VT framebuffer driver"); return (BUS_PROBE_DEFAULT); } @@ -272,13 +216,7 @@ bcm_fb_attach(device_t dev) int dma_size = sizeof(struct bcm_fb_config); int err; - if (bcmsc_softc) - return (ENXIO); - - bcmsc_softc = sc; - sc->dev = dev; - mtx_init(&sc->mtx, "bcm2835fb", "fb", MTX_DEF); err = bus_dma_tag_create( bus_get_dma_tag(sc->dev), @@ -291,8 +229,8 @@ bcm_fb_attach(device_t dev) NULL, NULL, /* lockfunc, lockarg */ &sc->dma_tag); - err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, - 0, &sc->dma_map); + err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, 0, + &sc->dma_map); if (err) { device_printf(dev, "cannot allocate framebuffer\n"); goto fail; @@ -306,14 +244,6 @@ bcm_fb_attach(device_t dev) goto fail; } - err = (sc_attach_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD)); - - if (err) { - device_printf(dev, "failed to attach syscons\n"); - goto fail; - } - /* * We have to wait until interrupts are enabled. * Mailbox relies on it to get data from VideoCore @@ -345,12 +275,25 @@ bcm_fb_dmamap_cb(void *arg, bus_dma_segm *addr = PHYS_TO_VCBUS(segs[0].ds_addr); } +static struct fb_info * +bcm_fb_helper_getinfo(device_t dev) +{ + struct bcmsc_softc *sc; + + sc = device_get_softc(dev); + + return (sc->info); +} + static device_method_t bcm_fb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcm_fb_probe), DEVMETHOD(device_attach, bcm_fb_attach), - { 0, 0 } + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, bcm_fb_helper_getinfo), + + DEVMETHOD_END }; static devclass_t bcm_fb_devclass; @@ -362,637 +305,3 @@ static driver_t bcm_fb_driver = { }; DRIVER_MODULE(bcm2835fb, nexus, bcm_fb_driver, bcm_fb_devclass, 0, 0); - -/* - * Video driver routines and glue. - */ -static vi_probe_t bcmfb_probe; -static vi_init_t bcmfb_init; -static vi_get_info_t bcmfb_get_info; -static vi_query_mode_t bcmfb_query_mode; -static vi_set_mode_t bcmfb_set_mode; -static vi_save_font_t bcmfb_save_font; -static vi_load_font_t bcmfb_load_font; -static vi_show_font_t bcmfb_show_font; -static vi_save_palette_t bcmfb_save_palette; -static vi_load_palette_t bcmfb_load_palette; -static vi_set_border_t bcmfb_set_border; -static vi_save_state_t bcmfb_save_state; -static vi_load_state_t bcmfb_load_state; -static vi_set_win_org_t bcmfb_set_win_org; -static vi_read_hw_cursor_t bcmfb_read_hw_cursor; -static vi_set_hw_cursor_t bcmfb_set_hw_cursor; -static vi_set_hw_cursor_shape_t bcmfb_set_hw_cursor_shape; -static vi_blank_display_t bcmfb_blank_display; -static vi_mmap_t bcmfb_mmap; -static vi_ioctl_t bcmfb_ioctl; -static vi_clear_t bcmfb_clear; -static vi_fill_rect_t bcmfb_fill_rect; -static vi_bitblt_t bcmfb_bitblt; -static vi_diag_t bcmfb_diag; -static vi_save_cursor_palette_t bcmfb_save_cursor_palette; -static vi_load_cursor_palette_t bcmfb_load_cursor_palette; -static vi_copy_t bcmfb_copy; -static vi_putp_t bcmfb_putp; -static vi_putc_t bcmfb_putc; -static vi_puts_t bcmfb_puts; -static vi_putm_t bcmfb_putm; - -static video_switch_t bcmfbvidsw = { - .probe = bcmfb_probe, - .init = bcmfb_init, - .get_info = bcmfb_get_info, - .query_mode = bcmfb_query_mode, - .set_mode = bcmfb_set_mode, - .save_font = bcmfb_save_font, - .load_font = bcmfb_load_font, - .show_font = bcmfb_show_font, - .save_palette = bcmfb_save_palette, - .load_palette = bcmfb_load_palette, - .set_border = bcmfb_set_border, - .save_state = bcmfb_save_state, - .load_state = bcmfb_load_state, - .set_win_org = bcmfb_set_win_org, - .read_hw_cursor = bcmfb_read_hw_cursor, - .set_hw_cursor = bcmfb_set_hw_cursor, - .set_hw_cursor_shape = bcmfb_set_hw_cursor_shape, - .blank_display = bcmfb_blank_display, - .mmap = bcmfb_mmap, - .ioctl = bcmfb_ioctl, - .clear = bcmfb_clear, - .fill_rect = bcmfb_fill_rect, - .bitblt = bcmfb_bitblt, - .diag = bcmfb_diag, - .save_cursor_palette = bcmfb_save_cursor_palette, - .load_cursor_palette = bcmfb_load_cursor_palette, - .copy = bcmfb_copy, - .putp = bcmfb_putp, - .putc = bcmfb_putc, - .puts = bcmfb_puts, - .putm = bcmfb_putm, -}; - -VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure); - -static vr_init_t bcmrend_init; -static vr_clear_t bcmrend_clear; -static vr_draw_border_t bcmrend_draw_border; -static vr_draw_t bcmrend_draw; -static vr_set_cursor_t bcmrend_set_cursor; -static vr_draw_cursor_t bcmrend_draw_cursor; -static vr_blink_cursor_t bcmrend_blink_cursor; -static vr_set_mouse_t bcmrend_set_mouse; -static vr_draw_mouse_t bcmrend_draw_mouse; - -/* - * We use our own renderer; this is because we must emulate a hardware - * cursor. - */ -static sc_rndr_sw_t bcmrend = { - bcmrend_init, - bcmrend_clear, - bcmrend_draw_border, - bcmrend_draw, - bcmrend_set_cursor, - bcmrend_draw_cursor, - bcmrend_blink_cursor, - bcmrend_set_mouse, - bcmrend_draw_mouse -}; - -RENDERER(bcmfb, 0, bcmrend, gfb_set); -RENDERER_MODULE(bcmfb, gfb_set); - -static void -bcmrend_init(scr_stat* scp) -{ -} - -static void -bcmrend_clear(scr_stat* scp, int c, int attr) -{ -} - -static void -bcmrend_draw_border(scr_stat* scp, int color) -{ -} - -static void -bcmrend_draw(scr_stat* scp, int from, int count, int flip) -{ - video_adapter_t* adp = scp->sc->adp; - int i, c, a; - - if (!flip) { - /* Normal printing */ - vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count); - } else { - /* This is for selections and such: invert the color attribute */ - for (i = count; i-- > 0; ++from) { - c = sc_vtb_getc(&scp->vtb, from); - a = sc_vtb_geta(&scp->vtb, from) >> 8; - vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); - } - } -} - -static void -bcmrend_set_cursor(scr_stat* scp, int base, int height, int blink) -{ -} - -static void -bcmrend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip) -{ - video_adapter_t* adp = scp->sc->adp; - struct video_adapter_softc *sc; - int row, col; - uint8_t *addr; - int i, j, bytes; - - sc = (struct video_adapter_softc *)adp; - - if (scp->curs_attr.height <= 0) - return; - - if (sc->fb_addr == 0) - return; - - if (off >= adp->va_info.vi_width * adp->va_info.vi_height) - return; - - /* calculate the coordinates in the video buffer */ - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - - addr = (uint8_t *)sc->fb_addr - + (row + sc->ymargin)*(sc->stride) - + (sc->depth/8) * (col + sc->xmargin); - - bytes = sc->depth/8; - - /* our cursor consists of simply inverting the char under it */ - for (i = 0; i < adp->va_info.vi_cheight; i++) { - for (j = 0; j < adp->va_info.vi_cwidth; j++) { - switch (sc->depth) { - case 32: - case 24: - addr[bytes*j + 2] ^= 0xff; - /* FALLTHROUGH */ - case 16: - addr[bytes*j + 1] ^= 0xff; - addr[bytes*j] ^= 0xff; - break; - default: - break; - } - } - - addr += sc->stride; - } -} - -static void -bcmrend_blink_cursor(scr_stat* scp, int at, int flip) -{ -} - -static void -bcmrend_set_mouse(scr_stat* scp) -{ -} - -static void -bcmrend_draw_mouse(scr_stat* scp, int x, int y, int on) -{ - vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8); -} - -static uint16_t bcmfb_static_window[ROW*COL]; -extern u_char dflt_font_16[]; - -/* - * Update videoadapter settings after changing resolution - */ -static void -bcmfb_update_margins(video_adapter_t *adp) -{ - struct video_adapter_softc *sc; - video_info_t *vi; - - sc = (struct video_adapter_softc *)adp; - vi = &adp->va_info; - - sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; -} - -static int -bcmfb_configure(int flags) -{ - struct video_adapter_softc *va_sc; - - va_sc = &va_softc; - phandle_t display, root; - pcell_t cell; - - if (va_sc->initialized) - return (0); - - va_sc->width = 0; - va_sc->height = 0; - - /* - * It seems there is no way to let syscons framework know - * that framebuffer resolution has changed. So just try - * to fetch data from FDT and go with defaults if failed - */ - root = OF_finddevice("/"); - if ((root != 0) && - (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { - if ((OF_getprop(display, "broadcom,width", - &cell, sizeof(cell))) > 0) - va_sc->width = (int)fdt32_to_cpu(cell); - - if ((OF_getprop(display, "broadcom,height", - &cell, sizeof(cell))) > 0) - va_sc->height = (int)fdt32_to_cpu(cell); - } - - if (va_sc->width == 0) - va_sc->width = FB_WIDTH; - if (va_sc->height == 0) - va_sc->height = FB_HEIGHT; - - bcmfb_init(0, &va_sc->va, 0); - - va_sc->initialized = 1; - - return (0); -} - -static int -bcmfb_probe(int unit, video_adapter_t **adp, void *arg, int flags) -{ - - return (0); -} - -static int -bcmfb_init(int unit, video_adapter_t *adp, int flags) -{ - struct video_adapter_softc *sc; - video_info_t *vi; - - sc = (struct video_adapter_softc *)adp; - vi = &adp->va_info; - - vid_init_struct(adp, "bcmfb", -1, unit); - - sc->font = dflt_font_16; - vi->vi_cheight = BCMFB_FONT_HEIGHT; - vi->vi_cwidth = 8; - - vi->vi_width = sc->width/8; - vi->vi_height = sc->height/vi->vi_cheight; - - /* - * Clamp width/height to syscons maximums - */ - if (vi->vi_width > COL) - vi->vi_width = COL; - if (vi->vi_height > ROW) - vi->vi_height = ROW; - - sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; - - - adp->va_window = (vm_offset_t) bcmfb_static_window; - adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; - - vid_register(&sc->va); - - return (0); -} - -static int -bcmfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - bcopy(&adp->va_info, info, sizeof(*info)); - return (0); -} - -static int -bcmfb_query_mode(video_adapter_t *adp, video_info_t *info) -{ - return (0); -} - -static int -bcmfb_set_mode(video_adapter_t *adp, int mode) -{ - return (0); -} - -static int -bcmfb_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - return (0); -} - -static int -bcmfb_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - struct video_adapter_softc *sc = (struct video_adapter_softc *)adp; - - sc->font = data; - - return (0); -} - -static int -bcmfb_show_font(video_adapter_t *adp, int page) -{ - return (0); -} - -static int -bcmfb_save_palette(video_adapter_t *adp, u_char *palette) -{ - return (0); -} - -static int -bcmfb_load_palette(video_adapter_t *adp, u_char *palette) -{ - return (0); -} - -static int -bcmfb_set_border(video_adapter_t *adp, int border) -{ - return (bcmfb_blank_display(adp, border)); -} - -static int -bcmfb_save_state(video_adapter_t *adp, void *p, size_t size) -{ - return (0); -} - -static int -bcmfb_load_state(video_adapter_t *adp, void *p) -{ - return (0); -} - -static int -bcmfb_set_win_org(video_adapter_t *adp, off_t offset) -{ - return (0); -} - -static int -bcmfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - *col = *row = 0; - - return (0); -} - -static int -bcmfb_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - return (0); -} - -static int -bcmfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - return (0); -} - -static int -bcmfb_blank_display(video_adapter_t *adp, int mode) -{ - - struct video_adapter_softc *sc; - - sc = (struct video_adapter_softc *)adp; - if (sc && sc->fb_addr) - memset((void*)sc->fb_addr, 0, sc->fb_size); - - return (0); -} - -static int -bcmfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - struct video_adapter_softc *sc; - - sc = (struct video_adapter_softc *)adp; - - /* - * This might be a legacy VGA mem request: if so, just point it at the - * framebuffer, since it shouldn't be touched - */ - if (offset < sc->stride*sc->height) { - *paddr = sc->fb_paddr + offset; - return (0); - } - - return (EINVAL); -} - -static int -bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - struct video_adapter_softc *sc; - struct fbtype *fb; - - sc = (struct video_adapter_softc *)adp; - - switch (cmd) { - case FBIOGTYPE: - fb = (struct fbtype *)data; - fb->fb_type = FBTYPE_PCIMISC; - fb->fb_height = sc->height; - fb->fb_width = sc->width; - fb->fb_depth = sc->depth; - if (sc->depth <= 1 || sc->depth > 8) - fb->fb_cmsize = 0; - else - fb->fb_cmsize = 1 << sc->depth; - fb->fb_size = sc->fb_size; - break; - default: - return (fb_commonioctl(adp, cmd, data)); - } - - return (0); -} - -static int -bcmfb_clear(video_adapter_t *adp) -{ - - return (bcmfb_blank_display(adp, 0)); -} - -static int -bcmfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - - return (0); -} - -static int -bcmfb_bitblt(video_adapter_t *adp, ...) -{ - - return (0); -} - -static int -bcmfb_diag(video_adapter_t *adp, int level) -{ - - return (0); -} - -static int -bcmfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (0); -} - -static int -bcmfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (0); -} - -static int -bcmfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - - return (0); -} - -static int -bcmfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - - return (0); -} - -static int -bcmfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) -{ - struct video_adapter_softc *sc; - int row; - int col; - int i, j, k; - uint8_t *addr; - u_char *p; - uint8_t fg, bg, color; - uint16_t rgb; - - sc = (struct video_adapter_softc *)adp; - - if (sc->fb_addr == 0) - return (0); - - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - p = sc->font + c*BCMFB_FONT_HEIGHT; - addr = (uint8_t *)sc->fb_addr - + (row + sc->ymargin)*(sc->stride) - + (sc->depth/8) * (col + sc->xmargin); - - fg = a & 0xf ; - bg = (a >> 4) & 0xf; - - for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { - for (j = 0, k = 7; j < 8; j++, k--) { - if ((p[i] & (1 << k)) == 0) - color = bg; - else - color = fg; - - switch (sc->depth) { - case 32: - addr[4*j+0] = bcmfb_palette[color].r; - addr[4*j+1] = bcmfb_palette[color].g; - addr[4*j+2] = bcmfb_palette[color].b; - addr[4*j+3] = bcmfb_palette[color].a; - break; - case 24: - addr[3*j] = bcmfb_palette[color].r; - addr[3*j+1] = bcmfb_palette[color].g; - addr[3*j+2] = bcmfb_palette[color].b; - break; - case 16: - rgb = (bcmfb_palette[color].r >> 3) << 11; - rgb |= (bcmfb_palette[color].g >> 2) << 5; - rgb |= (bcmfb_palette[color].b >> 3); - addr[2*j] = rgb & 0xff; - addr[2*j + 1] = (rgb >> 8) & 0xff; - default: - /* Not supported yet */ - break; - } - } - - addr += (sc->stride); - } - - return (0); -} - -static int -bcmfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) -{ - int i; - - for (i = 0; i < len; i++) - bcmfb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); - - return (0); -} - -static int -bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, - uint32_t pixel_mask, int size, int width) -{ - - return (0); -} - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t bcmdummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Tue Dec 17 15:11:24 2013 (r259516) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Tue Dec 17 15:23:47 2013 (r259517) @@ -3,6 +3,7 @@ arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc arm/broadcom/bcm2835/bcm2835_dma.c standard arm/broadcom/bcm2835/bcm2835_fb.c optional sc +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Dec 17 15:11:24 2013 (r259516) +++ head/sys/arm/conf/RPI-B Tue Dec 17 15:23:47 2013 (r259517) @@ -66,7 +66,7 @@ device pl011 device pty # Comment following lines for boot console on serial port -device sc +device vt device kbdmux options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 15:34:39 2013 Return-Path: Delivered-To: svn-src-all@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 2B84B586; Tue, 17 Dec 2013 15:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 164841F6F; Tue, 17 Dec 2013 15:34:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHFYcqY025703; Tue, 17 Dec 2013 15:34:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHFYcVb025701; Tue, 17 Dec 2013 15:34:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312171534.rBHFYcVb025701@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 17 Dec 2013 15:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259518 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 15:34:39 -0000 Author: ray Date: Tue Dec 17 15:34:38 2013 New Revision: 259518 URL: http://svnweb.freebsd.org/changeset/base/259518 Log: Fix copyright and some style(9) things. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:23:47 2013 (r259517) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Tue Dec 17 15:34:38 2013 (r259518) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -99,13 +103,14 @@ struct bcmsc_softc { static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); -static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); +static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, + int err); static void bcm_fb_init(void *arg) { - struct bcmsc_softc *sc = arg; - volatile struct bcm_fb_config* fb_config = sc->fb_config; + volatile struct bcm_fb_config *fb_config; + struct bcmsc_softc *sc; struct fb_info *info; phandle_t node; pcell_t cell; @@ -113,6 +118,8 @@ bcm_fb_init(void *arg) device_t fbd; int err = 0; + sc = arg; + fb_config = sc->fb_config; node = ofw_bus_get_node(sc->dev); fb_config->xres = 0; @@ -153,23 +160,25 @@ bcm_fb_init(void *arg) BUS_DMASYNC_POSTREAD); if (fb_config->base != 0) { - device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb_config->xres, fb_config->yres, fb_config->vxres, fb_config->vyres, fb_config->xoffset, fb_config->yoffset, fb_config->bpp); - device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", + device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", fb_config->pitch, fb_config->base, fb_config->screen_size); - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); + info = malloc(sizeof(struct fb_info), M_DEVBUF, + M_WAITOK | M_ZERO); info->fb_name = device_get_nameunit(sc->dev); - info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, + fb_config->screen_size); info->fb_pbase = fb_config->base; info->fb_size = fb_config->screen_size; info->fb_bpp = info->fb_depth = fb_config->bpp; @@ -179,7 +188,8 @@ bcm_fb_init(void *arg) sc->info = info; - fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + fbd = device_add_child(sc->dev, "fbd", + device_get_unit(sc->dev)); if (fbd == NULL) { device_printf(sc->dev, "Failed to add fbd child\n"); return; @@ -244,8 +254,8 @@ bcm_fb_attach(device_t dev) goto fail; } - /* - * We have to wait until interrupts are enabled. + /* + * We have to wait until interrupts are enabled. * Mailbox relies on it to get data from VideoCore */ sc->init_hook.ich_func = bcm_fb_init; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 16:11:00 2013 Return-Path: Delivered-To: svn-src-all@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 4554C9B1; Tue, 17 Dec 2013 16:11:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26D9512AC; Tue, 17 Dec 2013 16:11:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHGB0xu040045; Tue, 17 Dec 2013 16:11:00 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHGB0UW039996; Tue, 17 Dec 2013 16:11:00 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312171611.rBHGB0UW039996@svn.freebsd.org> From: Alan Somers Date: Tue, 17 Dec 2013 16:11:00 +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: r259519 - stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 16:11:00 -0000 Author: asomers Date: Tue Dec 17 16:10:59 2013 New Revision: 259519 URL: http://svnweb.freebsd.org/changeset/base/259519 Log: MFC r258311 opensolaris/uts/common/dtrace/fasttrap.c Fix several problems that can cause panics on kldload and kldunload. * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before fasttrap_provs.fth_table gets allocated. This can lead to a panic on module load, because fasttrap_pid_cleanup_cb references fasttrap_provs.fth_table. Move kproc_create down after the point that fasttrap_provs.fth_table gets allocated, and modify the error handling accordingly. * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until after fasttrap_provs.fth_table got freed. That caused panics on module unload because fasttrap_exec_exit calls fasttrap_provider_retire, which references fasttrap_provs.fth_table. NULL those function pointers earlier. * There wasn't any code to destroy the fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload, leading to a resource leak when WITNESS is enabled. Destroy those mutexes during fasttrap_unload(). Sponsored by: Spectra Logic Corporation Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Dec 17 15:34:38 2013 (r259518) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Dec 17 16:10:59 2013 (r259519) @@ -2276,13 +2276,6 @@ fasttrap_load(void) mutex_init(&fasttrap_count_mtx, "fasttrap count mtx", MUTEX_DEFAULT, NULL); - ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, - &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); - if (ret != 0) { - destroy_dev(fasttrap_cdev); - return (ret); - } - #if defined(sun) fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT); @@ -2336,6 +2329,24 @@ fasttrap_load(void) "providers bucket mtx", MUTEX_DEFAULT, NULL); #endif + ret = kproc_create(fasttrap_pid_cleanup_cb, NULL, + &fasttrap_cleanup_proc, 0, 0, "ftcleanup"); + if (ret != 0) { + destroy_dev(fasttrap_cdev); +#if !defined(sun) + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); +#endif + kmem_free(fasttrap_provs.fth_table, fasttrap_provs.fth_nent * + sizeof (fasttrap_bucket_t)); + mtx_destroy(&fasttrap_cleanup_mtx); + mutex_destroy(&fasttrap_count_mtx); + return (ret); + } + + /* * ... and the procs hash table. */ @@ -2428,6 +2439,20 @@ fasttrap_unload(void) return (-1); } + /* + * Stop new processes from entering these hooks now, before the + * fasttrap_cleanup thread runs. That way all processes will hopefully + * be out of these hooks before we free fasttrap_provs.fth_table + */ + ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); + dtrace_fasttrap_fork = NULL; + + ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); + dtrace_fasttrap_exec = NULL; + + ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); + dtrace_fasttrap_exit = NULL; + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_drain = 1; /* Wait for the cleanup thread to finish up and signal us. */ @@ -2443,6 +2468,14 @@ fasttrap_unload(void) mutex_exit(&fasttrap_count_mtx); #endif +#if !defined(sun) + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) + mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_provs.fth_nent; i++) + mutex_destroy(&fasttrap_provs.fth_table[i].ftb_mtx); + for (i = 0; i < fasttrap_procs.fth_nent; i++) + mutex_destroy(&fasttrap_procs.fth_table[i].ftb_mtx); +#endif kmem_free(fasttrap_tpoints.fth_table, fasttrap_tpoints.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_tpoints.fth_nent = 0; @@ -2455,22 +2488,6 @@ fasttrap_unload(void) fasttrap_procs.fth_nent * sizeof (fasttrap_bucket_t)); fasttrap_procs.fth_nent = 0; - /* - * We know there are no tracepoints in any process anywhere in - * the system so there is no process which has its p_dtrace_count - * greater than zero, therefore we know that no thread can actively - * be executing code in fasttrap_fork(). Similarly for p_dtrace_probes - * and fasttrap_exec() and fasttrap_exit(). - */ - ASSERT(dtrace_fasttrap_fork == &fasttrap_fork); - dtrace_fasttrap_fork = NULL; - - ASSERT(dtrace_fasttrap_exec == &fasttrap_exec_exit); - dtrace_fasttrap_exec = NULL; - - ASSERT(dtrace_fasttrap_exit == &fasttrap_exec_exit); - dtrace_fasttrap_exit = NULL; - #if !defined(sun) destroy_dev(fasttrap_cdev); mutex_destroy(&fasttrap_count_mtx); From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 16:45:19 2013 Return-Path: Delivered-To: svn-src-all@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 BCA74D38; Tue, 17 Dec 2013 16:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A899D15EA; Tue, 17 Dec 2013 16:45:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHGjJq0051446; Tue, 17 Dec 2013 16:45:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHGjJNv051445; Tue, 17 Dec 2013 16:45:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312171645.rBHGjJNv051445@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 17 Dec 2013 16:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259520 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 16:45:19 -0000 Author: ae Date: Tue Dec 17 16:45:19 2013 New Revision: 259520 URL: http://svnweb.freebsd.org/changeset/base/259520 Log: Fix copy/paste typo. MFC after: 1 week Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Dec 17 16:10:59 2013 (r259519) +++ head/sys/kern/kern_jail.c Tue Dec 17 16:45:19 2013 (r259520) @@ -3047,7 +3047,7 @@ prison_restrict_ip6(struct prison *pr, s ii++; continue; } - switch (ij >= ppr->pr_ip4s ? -1 : + switch (ij >= ppr->pr_ip6s ? -1 : qcmp_v6(&pr->pr_ip6[ii], &ppr->pr_ip6[ij])) { case -1: bcopy(pr->pr_ip6 + ii + 1, pr->pr_ip6 + ii, From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 17:28:02 2013 Return-Path: Delivered-To: svn-src-all@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 D42B29C8; Tue, 17 Dec 2013 17:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFC6F18F5; Tue, 17 Dec 2013 17:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHHS2s7066417; Tue, 17 Dec 2013 17:28:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHHS2KH066416; Tue, 17 Dec 2013 17:28:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171728.rBHHS2KH066416@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 17:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259521 - head/sys/fs/fifofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 17:28:02 -0000 Author: kib Date: Tue Dec 17 17:28:02 2013 New Revision: 259521 URL: http://svnweb.freebsd.org/changeset/base/259521 Log: Do not allow O_EXEC opens for fifo, return EINVAL. Besides not making sense, open(O_EXEC) for fifo creates fifoinfo with zero readers and writers counts, which causes premature free of pipes. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/fifofs/fifo_vnops.c Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Tue Dec 17 16:45:19 2013 (r259520) +++ head/sys/fs/fifofs/fifo_vnops.c Tue Dec 17 17:28:02 2013 (r259521) @@ -143,7 +143,7 @@ fifo_open(ap) fp = ap->a_fp; td = ap->a_td; ASSERT_VOP_ELOCKED(vp, "fifo_open"); - if (fp == NULL) + if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { error = pipe_named_ctor(&fpipe, td); From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 17:31:16 2013 Return-Path: Delivered-To: svn-src-all@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 91B26C1F; Tue, 17 Dec 2013 17:31:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCB0197F; Tue, 17 Dec 2013 17:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHHVGxV069204; Tue, 17 Dec 2013 17:31:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHHVG7g069202; Tue, 17 Dec 2013 17:31:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312171731.rBHHVG7g069202@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Dec 2013 17:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259522 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 17:31:16 -0000 Author: kib Date: Tue Dec 17 17:31:16 2013 New Revision: 259522 URL: http://svnweb.freebsd.org/changeset/base/259522 Log: If vn_open_vnode() succeeded in opening the vnode, but subsequent advisory lock cannot be obtained, prevent double-close of the vnode in vn_close() called from the fdrop(), by resetting file' f_ops methods. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Dec 17 17:28:02 2013 (r259521) +++ head/sys/kern/vfs_vnops.c Tue Dec 17 17:31:16 2013 (r259522) @@ -313,6 +313,9 @@ vn_open_vnode(struct vnode *vp, int fmod vn_lock(vp, lock_flags | LK_RETRY); (void)VOP_CLOSE(vp, fmode, cred, td); vn_finished_write(mp); + /* Prevent second close from fdrop()->vn_close(). */ + if (fp != NULL) + fp->f_ops= &badfileops; return (error); } fp->f_flag |= FHASLOCK; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 17:55:15 2013 Return-Path: Delivered-To: svn-src-all@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 A8137A27; Tue, 17 Dec 2013 17:55:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1FC1C7F; Tue, 17 Dec 2013 17:55:15 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75E16B972; Tue, 17 Dec 2013 12:55:14 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu Date: Tue, 17 Dec 2013 12:20:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312131231.04749.jhb@freebsd.org> <86k3f4kjk8.fsf@nine.des.no> In-Reply-To: <86k3f4kjk8.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201312171220.47075.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 12:55:14 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 17:55:15 -0000 On Monday, December 16, 2013 8:32:39 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > Dag-Erling Sm=C3=B8rgrav writes: > > > John Baldwin writes: > > > > LINT64 is yet another kernel config covered by 'make tinderbox', > > > > but not by the periodic tinderbox. It is probably worth adding to > > > > the periodic tinderbox (someday it'd be nice if the two > > > > tinderboxes built the same set of things). > > > Some day it would be nice if people talked to me directly instead of > > > sniping from the sidelines. > > Ah, but when people have raised this exact issue before (that tcbuild > > and 'make tinderbox' build different things), you have blown them off > > repeatedly. >=20 > I have no idea what tcbuild is. I meant it as the name of your scripts (probably have ports-mgmt/tinderbox = on=20 the brain too much). > I blow people off when they complain that the tinderbox doesn't work > exactly like 'make tinderbox' because it's not intended to. I just want it to build the same things and report errors when they are=20 broken. In that sense they should both do the same thing. > > > Oh, and 'make tinderbox' should die. > > No, it is very developer friendly as it Just Works(tm) as a single > > command from an existing source tree checkout. >=20 > We already had 'make universe'. >=20 > The story behind 'make tinderbox' is that Alfred threw a fit over a > tinderbox breakage and insisted, despite being provided with ample proof > to the contrary, that my tinderbox was a black box which nobody knew how > worked and nobody could reproduce and that tinderbox reports were > therefore worthless. He then proceeded to implement 'make tinderbox' > purely to piss me off. It serves no other purpose and needs to die. Ah, a bit touchy I see. While that might have been Alfred's initial motivation, the points still remain that: 1) 'make tinderbox' Just Works as a single command from an existing source tree checkout. I don't have to track down some other thing from some other SVN tree to checkout and configure. It's also easy to reproduce a single failed build step in the same tree by doing 'make buildkernel' etc. so I can fix an issue that pops up and do quick turnaround testing and do a final 'make tinderbox' to make sure all is still well. 2) 'make tinderbox' provides a summary of what failed. 'make universe' does not. You have to go check all the log files by hand to see if anything failed. That is less helpful. It definitely serves a useful purpose for many developers, and I for one don't sit and cackle maniacally while rubbing my hands each time I invoke it because I think that somehow my doing so is pissing you off. > > It also happens to build more of the tree than the periodic tinderbox > > (by building more kernel configs, albeit doing quite a bit of > > duplicate work for platforms like arm in the process). >=20 > That's simply not true. The tinderbox builds exactly the same kernels > as 'make tinderbox' if they're present. The issue here is that a bug in > the source tree prevents some of these kernel configurations from being > generated, hence the tinderbox cannot build them. Ah, I thought at one point it only built GENERIC and LINT type configs, but presumably that has changed? As long as they build the same things I'm happy. I just want to avoid running into unrelated breakages when I do a 'make tinderbox' on a patched tree (the unrelated breakage thing is what I recently ran into with LINT64). =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 17:55:11 2013 Return-Path: Delivered-To: svn-src-all@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 AEC33A25; Tue, 17 Dec 2013 17:55:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85DAD1C7E; Tue, 17 Dec 2013 17:55:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 71F14B939; Tue, 17 Dec 2013 12:55:10 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Date: Tue, 17 Dec 2013 11:41:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> In-Reply-To: <201312150411.rBF4Bhtg018852@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312171141.49251.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 12:55:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 17:55:11 -0000 On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > Author: mjg > Date: Sun Dec 15 04:11:43 2013 > New Revision: 259407 > URL: http://svnweb.freebsd.org/changeset/base/259407 > > Log: > proc exit: don't take PROC_LOCK while freeing rlimits > > Code wishing to check rlimits of some process should check whether it > is exiting first, which current consumers do. Does this measurably reduce contention? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 18:17:52 2013 Return-Path: Delivered-To: svn-src-all@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 782DD703; Tue, 17 Dec 2013 18:17:52 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 704331E7A; Tue, 17 Dec 2013 18:17:51 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x12so6317427wgg.28 for ; Tue, 17 Dec 2013 10:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=s8/o5uo+Boh4UNDRAoKGJ1uI2MhNw2KUlj8/5A/dcuk=; b=slQuDv5S9eW5Nr+ju5hTGNurn0P5LV4aCWZF0ZzGeOKl47XwLBWjY2UPO/zlLgsSwk uYscEfE1HLLBYSn0P2Uenf2EbvPj2T1XHwLAoCPwjvvLpMI7i/+uZd5lrc+8MEQLGhAK flYTk6iWkuiUVDq/JDHlVtCQwWVNtmdEO5jiIECSvNA1lFUIn571Yi/vLzELcIrJb3rv MiYmY/1frXvBcz7Y+XImnq+jviML9f6CsHSXZPkhac+xdECXA3qS/6cJcKCfKKkgYKIV SjdoBb9dTZPD4xJToWrFBJR4LdPMU4wmJhVmZWWwQbH+gV4b8unQeE6YdN2VlMVzcTK2 0zQA== X-Received: by 10.180.101.197 with SMTP id fi5mr4429469wib.46.1387304269796; Tue, 17 Dec 2013 10:17:49 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id z2sm18631879wiy.11.2013.12.17.10.17.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 10:17:48 -0800 (PST) Date: Tue, 17 Dec 2013 19:17:45 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131217181745.GB7535@dft-labs.eu> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201312171141.49251.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 18:17:52 -0000 On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > Author: mjg > > Date: Sun Dec 15 04:11:43 2013 > > New Revision: 259407 > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > Log: > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > Code wishing to check rlimits of some process should check whether it > > is exiting first, which current consumers do. > > Does this measurably reduce contention? > No, this is just a cosmetic change I did while doing some other work with rlimits. It would use some more cosmetic work (e.g. no reason not to lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that later unless this kind of stuff is unwanted. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 18:30:37 2013 Return-Path: Delivered-To: svn-src-all@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 995A5B3F; Tue, 17 Dec 2013 18:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85FC81FAA; Tue, 17 Dec 2013 18:30:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHIUbIQ090500; Tue, 17 Dec 2013 18:30:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHIUbCi090499; Tue, 17 Dec 2013 18:30:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312171830.rBHIUbCi090499@svn.freebsd.org> From: Ed Maste Date: Tue, 17 Dec 2013 18:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259523 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 18:30:37 -0000 Author: emaste Date: Tue Dec 17 18:30:37 2013 New Revision: 259523 URL: http://svnweb.freebsd.org/changeset/base/259523 Log: Require a C++11 compiler to build LLDB In practice the old test (using MK_CLANG_IS_CC) is similar, but COMPILER_FEATURES provides the information we actually want to test. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Dec 17 17:31:16 2013 (r259522) +++ head/share/mk/bsd.own.mk Tue Dec 17 18:30:37 2013 (r259523) @@ -552,10 +552,6 @@ MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no .endif -.if ${MK_CLANG_IS_CC} == "no" -MK_LLDB:= no -.endif - .if defined(NO_TESTS) # This should be handled above along the handling of all other NO_* options. # However, the above is broken when WITH_*=yes are passed to make(1) as @@ -650,6 +646,10 @@ MK_${var}:= no .endif .endfor +.if !${COMPILER_FEATURES:Mc++11} +MK_LLDB:= no +.endif + .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 19:36:48 2013 Return-Path: Delivered-To: svn-src-all@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 3F12F1F5; Tue, 17 Dec 2013 19:36:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14ACF1443; Tue, 17 Dec 2013 19:36:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DF18FB97B; Tue, 17 Dec 2013 14:36:46 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Date: Tue, 17 Dec 2013 14:34:01 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> In-Reply-To: <20131217181745.GB7535@dft-labs.eu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201312171434.01345.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Dec 2013 14:36:47 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 19:36:48 -0000 On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: > On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > > Author: mjg > > > Date: Sun Dec 15 04:11:43 2013 > > > New Revision: 259407 > > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > > > Log: > > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > > > Code wishing to check rlimits of some process should check whether it > > > is exiting first, which current consumers do. > > > > Does this measurably reduce contention? > > > > No, this is just a cosmetic change I did while doing some other work > with rlimits. > > It would use some more cosmetic work (e.g. no reason not to > lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that > later unless this kind of stuff is unwanted. I find it useful to leave the locking in place so it is clear that p_limit is always written to with the lock held. If we ever got a static analyzer that understood locking rules then leaving this locking in would reduce false positives. When I first did locking for fields in struct proc I did it by hand based on grepping the source tree for all uses of a field and ensuring they were locked. I think it might be more confusing later on for another reader to see unlocked access and then have to think about why that is safe. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 20:53:23 2013 Return-Path: Delivered-To: svn-src-all@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 A77051DE; Tue, 17 Dec 2013 20:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9399D1AC1; Tue, 17 Dec 2013 20:53:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHKrNZq041762; Tue, 17 Dec 2013 20:53:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHKrNWB041760; Tue, 17 Dec 2013 20:53:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172053.rBHKrNWB041760@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 20:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259525 - in head/contrib/gcc: . config/rs6000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 20:53:23 -0000 Author: pfg Date: Tue Dec 17 20:53:22 2013 New Revision: 259525 URL: http://svnweb.freebsd.org/changeset/base/259525 Log: gcc: fix ICE in rs600 when using -fno-trapping-math. Solves GCC-PR target/30485 Obtained from: gcc 4.3 (rev. 120902; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/rs6000/rs6000.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 18:44:46 2013 (r259524) +++ head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 20:53:22 2013 (r259525) @@ -399,6 +399,12 @@ (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b for CPUs that have PTA_CX16 set. +2007-01-18 Josh Conner (r120902) + + PR target/30485 + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add + support for UNLE, UNLT, UNGE, and UNGT. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 18:44:46 2013 (r259524) +++ head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 20:53:22 2013 (r259525) @@ -11738,10 +11738,18 @@ rs6000_emit_vector_compare (enum rtx_cod try_again = true; break; case NE: - /* Treat A != B as ~(A==B). */ + case UNLE: + case UNLT: + case UNGE: + case UNGT: + /* Invert condition and try again. + e.g., A != B becomes ~(A==B). */ { + enum rtx_code rev_code; enum insn_code nor_code; - rtx eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1, + + rev_code = reverse_condition_maybe_unordered (rcode); + rtx eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 21:39:41 2013 Return-Path: Delivered-To: svn-src-all@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 5ECA08F6; Tue, 17 Dec 2013 21:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49F5D1F84; Tue, 17 Dec 2013 21:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHLdfdj057235; Tue, 17 Dec 2013 21:39:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHLdf4Z057234; Tue, 17 Dec 2013 21:39:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172139.rBHLdf4Z057234@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 21:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259526 - head/contrib/gcc/config/rs6000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 21:39:41 -0000 Author: pfg Date: Tue Dec 17 21:39:40 2013 New Revision: 259526 URL: http://svnweb.freebsd.org/changeset/base/259526 Log: gcc: fix ICE in rs600 when using -fno-trapping-math. Solve build issue with previous change. Obtained from: gcc 4.3 (rev. 120902; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/config/rs6000/rs6000.c Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 20:53:22 2013 (r259525) +++ head/contrib/gcc/config/rs6000/rs6000.c Tue Dec 17 21:39:40 2013 (r259526) @@ -11747,10 +11747,11 @@ rs6000_emit_vector_compare (enum rtx_cod { enum rtx_code rev_code; enum insn_code nor_code; + rtx eq_rtx; rev_code = reverse_condition_maybe_unordered (rcode); - rtx eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, - dest_mode); + eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, + dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; gcc_assert (nor_code != CODE_FOR_nothing); From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 21:41:24 2013 Return-Path: Delivered-To: svn-src-all@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 4856AA4A; Tue, 17 Dec 2013 21:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A40C1FD3; Tue, 17 Dec 2013 21:41:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHLfNFW059840; Tue, 17 Dec 2013 21:41:23 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHLfNKa059838; Tue, 17 Dec 2013 21:41:23 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312172141.rBHLfNKa059838@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 17 Dec 2013 21:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259527 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 21:41:24 -0000 Author: np Date: Tue Dec 17 21:41:23 2013 New Revision: 259527 URL: http://svnweb.freebsd.org/changeset/base/259527 Log: Do not create a hardware IPv6 server if the listen address is not in6addr_any and is not in the CLIP table either. This fixes a reported TOE+IPv6 NULL-dereference panic in do_pass_open_rpl(). While here, stop creating hardware servers for any loopback address. It's just a waste of server tids. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Dec 17 21:39:40 2013 (r259526) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Dec 17 21:41:23 2013 (r259527) @@ -203,6 +203,17 @@ alloc_lctx(struct adapter *sc, struct in return (NULL); } + if (inp->inp_vflag & INP_IPV6 && + !IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) { + struct tom_data *td = sc->tom_softc; + + lctx->ce = hold_lip(td, &inp->in6p_laddr); + if (lctx->ce == NULL) { + free(lctx, M_CXGBE); + return (NULL); + } + } + lctx->ctrlq = &sc->sge.ctrlq[pi->port_id]; lctx->ofld_rxq = &sc->sge.ofld_rxq[pi->first_ofld_rxq]; refcount_init(&lctx->refcount, 1); @@ -219,6 +230,7 @@ static int free_lctx(struct adapter *sc, struct listen_ctx *lctx) { struct inpcb *inp = lctx->inp; + struct tom_data *td = sc->tom_softc; INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, @@ -230,6 +242,8 @@ free_lctx(struct adapter *sc, struct lis CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p", __func__, lctx->stid, lctx, lctx->inp); + if (lctx->ce) + release_lip(td, lctx->ce); free_stid(sc, lctx); free(lctx, M_CXGBE); @@ -495,6 +509,12 @@ t4_listen_start(struct toedev *tod, stru INP_WLOCK_ASSERT(inp); + /* Don't start a hardware listener for any loopback address. */ + if (inp->inp_vflag & INP_IPV6 && IN6_IS_ADDR_LOOPBACK(&inp->in6p_laddr)) + return (0); + if (!(inp->inp_vflag & INP_IPV6) && + IN_LOOPBACK(ntohl(inp->inp_laddr.s_addr))) + return (0); #if 0 ADAPTER_LOCK(sc); if (IS_BUSY(sc)) { Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Dec 17 21:39:40 2013 (r259526) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Dec 17 21:41:23 2013 (r259527) @@ -176,6 +176,7 @@ struct listen_ctx { struct inpcb *inp; /* listening socket's inp */ struct sge_wrq *ctrlq; struct sge_ofld_rxq *ofld_rxq; + struct clip_entry *ce; TAILQ_HEAD(, synq_entry) synq; }; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 22:16:28 2013 Return-Path: Delivered-To: svn-src-all@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 0B2C6429; Tue, 17 Dec 2013 22:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAC1B1281; Tue, 17 Dec 2013 22:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHMGRwd072382; Tue, 17 Dec 2013 22:16:27 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHMGRLM072381; Tue, 17 Dec 2013 22:16:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312172216.rBHMGRLM072381@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 17 Dec 2013 22:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259528 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 22:16:28 -0000 Author: melifaro Date: Tue Dec 17 22:16:27 2013 New Revision: 259528 URL: http://svnweb.freebsd.org/changeset/base/259528 Log: Simplify contiguous mask checking. Suggested by: glebius MFC after: 2 weeks Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Tue Dec 17 21:41:23 2013 (r259527) +++ head/sys/net/radix.c Tue Dec 17 22:16:27 2013 (r259528) @@ -484,13 +484,13 @@ on1: struct radix_node * rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip) { - caddr_t netmask = (caddr_t)n_arg; - register struct radix_node *x; - register caddr_t cp, cplim; - register int b = 0, mlen, j; + unsigned char *netmask = n_arg; + unsigned char *cp, *cplim; + struct radix_node *x; + int b = 0, mlen, j; int maskduplicated, isnormal; struct radix_node *saved_x; - char addmask_key[RADIX_MAX_KEY_LEN]; + unsigned char addmask_key[RADIX_MAX_KEY_LEN]; if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN) mlen = RADIX_MAX_KEY_LEN; @@ -532,20 +532,18 @@ rn_addmask(void *n_arg, struct radix_nod * Calculate index of mask, and check for normalcy. * First find the first byte with a 0 bit, then if there are * more bits left (remember we already trimmed the trailing 0's), - * the pattern must be one of those in normal_chars[], or we have + * the bits should be contiguous, otherwise we have got * a non-contiguous mask. */ +#define CONTIG(_c) (((~(_c) + 1) & (_c)) == (unsigned char)(~(_c) + 1)) cplim = netmask + mlen; isnormal = 1; for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;) cp++; if (cp != cplim) { - static char normal_chars[] = { - 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; - for (j = 0x80; (j & *cp) != 0; j >>= 1) b++; - if (*cp != normal_chars[b] || cp != (cplim - 1)) + if (!CONTIG(*cp) || cp != (cplim - 1)) isnormal = 0; } b += (cp - netmask) << 3; From owner-svn-src-all@FreeBSD.ORG Tue Dec 17 23:31:53 2013 Return-Path: Delivered-To: svn-src-all@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 55C36EB5; Tue, 17 Dec 2013 23:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36099183A; Tue, 17 Dec 2013 23:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBHNVr6F001433; Tue, 17 Dec 2013 23:31:53 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBHNVpTW001421; Tue, 17 Dec 2013 23:31:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312172331.rBHNVpTW001421@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Dec 2013 23:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259529 - in head/contrib/gcc: . cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2013 23:31:53 -0000 Author: pfg Date: Tue Dec 17 23:31:51 2013 New Revision: 259529 URL: http://svnweb.freebsd.org/changeset/base/259529 Log: gcc: small merges from upstream Solves GCC issues: PR middle-end/32602 PR middle-end/32603 Updates the to documentation and processing improvement. Obtained from: gcc 4.3 (rev. 119427, 126278, 126422; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/calls.c head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/method.c head/contrib/gcc/cp/parser.c head/contrib/gcc/doc/cppopts.texi head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/ChangeLog.gcc43 Tue Dec 17 23:31:51 2013 (r259529) @@ -45,6 +45,20 @@ * flags.h (force_align_functions_log): Delete. * toplev.c (force_align_functions_log): Delete. +2007-07-06 Josh Conner (r126422) + + PR middle-end/32602 + PR middle-end/32603 + * calls.c (store_one_arg): Handle arguments which are partially + on the stack when detecting argument overlap. + +2007-07-03 Eric Christopher (r126278) + + * doc/cppopts.texi: Add conflicting option note to -dM. + * doc/invoke.texi: Add note about possible conflicts with + -E for -dCHARS and note that -dM will not produce + any results if there is no machine dependent reorg. + 2007-06-28 Geoffrey Keating (r126088) * doc/invoke.texi (C++ Dialect Options): Document Modified: head/contrib/gcc/calls.c ============================================================================== --- head/contrib/gcc/calls.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/calls.c Tue Dec 17 23:31:51 2013 (r259529) @@ -4297,6 +4297,7 @@ store_one_arg (struct arg_data *arg, rtx /* expand_call should ensure this. */ gcc_assert (!arg->locate.offset.var + && arg->locate.size.var == 0 && GET_CODE (size_rtx) == CONST_INT); if (arg->locate.offset.constant > i) @@ -4306,7 +4307,21 @@ store_one_arg (struct arg_data *arg, rtx } else if (arg->locate.offset.constant < i) { - if (i < arg->locate.offset.constant + INTVAL (size_rtx)) + /* Use arg->locate.size.constant instead of size_rtx + because we only care about the part of the argument + on the stack. */ + if (i < (arg->locate.offset.constant + + arg->locate.size.constant)) + sibcall_failure = 1; + } + else + { + /* Even though they appear to be at the same location, + if part of the outgoing argument is in registers, + they aren't really at the same location. Check for + this by making sure that the incoming size is the + same as the outgoing size. */ + if (arg->locate.size.constant != INTVAL (size_rtx)) sibcall_failure = 1; } } Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 17 23:31:51 2013 (r259529) @@ -62,6 +62,18 @@ * semantics.c (finish_unary_op_expr): Warn only if result overflowed and operands did not. +2006-12-01 Geoffrey Keating (r119427) + + * decl.c (poplevel): Check DECL_INITIAL invariant. + (duplicate_decls): Preserve DECL_INITIAL when eliminating + a new definition in favour of an old declaration. + (start_preparsed_function): Define and document value of + DECL_INITIAL before and after routine. + (finish_function): Check DECL_INITIAL invariant. + * parser.c + (cp_parser_function_definition_from_specifiers_and_declarator): + Skip duplicate function definitions. + 2006-10-31 Geoffrey Keating (r118360) * name-lookup.c (get_anonymous_namespace_name): New. Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/decl.c Tue Dec 17 23:31:51 2013 (r259529) @@ -758,7 +758,12 @@ poplevel (int keep, int reverse, int fun leave_scope (); if (functionbody) - DECL_INITIAL (current_function_decl) = block; + { + /* The current function is being defined, so its DECL_INITIAL + should be error_mark_node. */ + gcc_assert (DECL_INITIAL (current_function_decl) == error_mark_node); + DECL_INITIAL (current_function_decl) = block; + } else if (block) current_binding_level->blocks = chainon (current_binding_level->blocks, block); @@ -1635,13 +1640,15 @@ duplicate_decls (tree newdecl, tree oldd } /* If the new declaration is a definition, update the file and - line information on the declaration. */ + line information on the declaration, and also make + the old declaration the same definition. */ if (DECL_INITIAL (old_result) == NULL_TREE && DECL_INITIAL (new_result) != NULL_TREE) { DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (old_result) = DECL_SOURCE_LOCATION (newdecl); + DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) DECL_ARGUMENTS (old_result) = DECL_ARGUMENTS (new_result); @@ -10509,7 +10516,13 @@ check_function_type (tree decl, tree cur For C++, we must first check whether that datum makes any sense. For example, "class A local_a(1,2);" means that variable local_a is an aggregate of type A, which should have a constructor - applied to it with the argument list [1, 2]. */ + applied to it with the argument list [1, 2]. + + On entry, DECL_INITIAL (decl1) should be NULL_TREE or error_mark_node, + or may be a BLOCK if the function has been defined previously + in this translation unit. On exit, DECL_INITIAL (decl1) will be + error_mark_node if the function has never been defined, or + a BLOCK if the function has been defined somewhere. */ void start_preparsed_function (tree decl1, tree attrs, int flags) @@ -10638,24 +10651,6 @@ start_preparsed_function (tree decl1, tr cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl); } - /* Initialize RTL machinery. We cannot do this until - CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this - even when processing a template; this is how we get - CFUN set up, and our per-function variables initialized. - FIXME factor out the non-RTL stuff. */ - bl = current_binding_level; - allocate_struct_function (decl1); - current_binding_level = bl; - - /* Even though we're inside a function body, we still don't want to - call expand_expr to calculate the size of a variable-sized array. - We haven't necessarily assigned RTL to all variables yet, so it's - not safe to try to expand expressions involving them. */ - cfun->x_dont_save_pending_sizes_p = 1; - - /* Start the statement-tree, start the tree now. */ - DECL_SAVED_TREE (decl1) = push_stmt_list (); - /* Let the user know we're compiling this function. */ announce_function (decl1); @@ -10701,9 +10696,33 @@ start_preparsed_function (tree decl1, tr maybe_apply_pragma_weak (decl1); } - /* Reset these in case the call to pushdecl changed them. */ + /* Reset this in case the call to pushdecl changed it. */ current_function_decl = decl1; - cfun->decl = decl1; + + gcc_assert (DECL_INITIAL (decl1)); + + /* This function may already have been parsed, in which case just + return; our caller will skip over the body without parsing. */ + if (DECL_INITIAL (decl1) != error_mark_node) + return; + + /* Initialize RTL machinery. We cannot do this until + CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this + even when processing a template; this is how we get + CFUN set up, and our per-function variables initialized. + FIXME factor out the non-RTL stuff. */ + bl = current_binding_level; + allocate_struct_function (decl1); + current_binding_level = bl; + + /* Even though we're inside a function body, we still don't want to + call expand_expr to calculate the size of a variable-sized array. + We haven't necessarily assigned RTL to all variables yet, so it's + not safe to try to expand expressions involving them. */ + cfun->x_dont_save_pending_sizes_p = 1; + + /* Start the statement-tree, start the tree now. */ + DECL_SAVED_TREE (decl1) = push_stmt_list (); /* If we are (erroneously) defining a function that we have already defined before, wipe out what we knew before. */ @@ -11212,6 +11231,10 @@ finish_function (int flags) which then got a warning when stored in a ptr-to-function variable. */ gcc_assert (building_stmt_tree ()); + /* The current function is being defined, so its DECL_INITIAL should + be set, and unless there's a multiple definition, it should be + error_mark_node. */ + gcc_assert (DECL_INITIAL (fndecl) == error_mark_node); /* For a cloned function, we've already got all the code we need; there's no need to add any extra bits. */ Modified: head/contrib/gcc/cp/method.c ============================================================================== --- head/contrib/gcc/cp/method.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/method.c Tue Dec 17 23:31:51 2013 (r259529) @@ -407,10 +407,6 @@ use_thunk (tree thunk_fndecl, bool emit_ } } - /* The back-end expects DECL_INITIAL to contain a BLOCK, so we - create one. */ - DECL_INITIAL (thunk_fndecl) = make_node (BLOCK); - /* Set up cloned argument trees for the thunk. */ t = NULL_TREE; for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a)) @@ -424,17 +420,23 @@ use_thunk (tree thunk_fndecl, bool emit_ } a = nreverse (t); DECL_ARGUMENTS (thunk_fndecl) = a; - BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a; if (this_adjusting && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) { const char *fnname; + tree fn_block; + current_function_decl = thunk_fndecl; DECL_RESULT (thunk_fndecl) = build_decl (RESULT_DECL, 0, integer_type_node); fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0); + /* The back-end expects DECL_INITIAL to contain a BLOCK, so we + create one. */ + fn_block = make_node (BLOCK); + BLOCK_VARS (fn_block) = a; + DECL_INITIAL (thunk_fndecl) = fn_block; init_function_start (thunk_fndecl); current_function_is_thunk = 1; assemble_start_function (thunk_fndecl, fnname); Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/cp/parser.c Tue Dec 17 23:31:51 2013 (r259529) @@ -15637,6 +15637,16 @@ cp_parser_function_definition_from_speci cp_parser_skip_to_end_of_block_or_statement (parser); fn = error_mark_node; } + else if (DECL_INITIAL (current_function_decl) != error_mark_node) + { + /* Seen already, skip it. An error message has already been output. */ + cp_parser_skip_to_end_of_block_or_statement (parser); + fn = current_function_decl; + current_function_decl = NULL_TREE; + /* If this is a function from a class, pop the nested class. */ + if (current_class_name) + pop_nested_class (); + } else fn = cp_parser_function_definition_after_declarator (parser, /*inline_p=*/false); Modified: head/contrib/gcc/doc/cppopts.texi ============================================================================== --- head/contrib/gcc/doc/cppopts.texi Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/doc/cppopts.texi Tue Dec 17 23:31:51 2013 (r259529) @@ -645,6 +645,10 @@ touch foo.h; cpp -dM foo.h @noindent will show all the predefined macros. +If you use @option{-dM} without the @option{-E} option, @option{-dM} is +interpreted as a synonym for @option{-fdump-rtl-mach}. +@xref{Debugging Options, , ,gcc}. + @item D @opindex dD Like @samp{M} except in two respects: it does @emph{not} include the Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Tue Dec 17 22:16:27 2013 (r259528) +++ head/contrib/gcc/doc/invoke.texi Tue Dec 17 23:31:51 2013 (r259529) @@ -3675,7 +3675,9 @@ Says to make debugging dumps during comp compiler. The file names for most of the dumps are made by appending a pass number and a word to the @var{dumpname}. @var{dumpname} is generated from the name of the output file, if explicitly specified and it is not -an executable, otherwise it is the basename of the source file. +an executable, otherwise it is the basename of the source file. These +switches may have different effects when @option{-E} is used for +preprocessing. Most debug dumps can be enabled either passing a letter to the @option{-d} option, or with a long @option{-fdump-rtl} switch; here are the possible @@ -3810,7 +3812,7 @@ Dump after modulo scheduling, to @file{@ @opindex dM @opindex fdump-rtl-mach Dump after performing the machine dependent reorganization pass, to -@file{@var{file}.155r.mach}. +@file{@var{file}.155r.mach} if that pass exists. @item -dn @itemx -fdump-rtl-rnreg From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:07:54 2013 Return-Path: Delivered-To: svn-src-all@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 3A991826; Wed, 18 Dec 2013 00:07:54 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 234A01AA2; Wed, 18 Dec 2013 00:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI07sHC014313; Wed, 18 Dec 2013 00:07:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI07qje014305; Wed, 18 Dec 2013 00:07:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312180007.rBI07qje014305@svn.freebsd.org> From: Glen Barber Date: Wed, 18 Dec 2013 00:07: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: r259530 - in stable/9: release release/amd64 release/i386 release/scripts share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:07:54 -0000 Author: gjb Date: Wed Dec 18 00:07:52 2013 New Revision: 259530 URL: http://svnweb.freebsd.org/changeset/base/259530 Log: MFC r254224, r254294, r254328, r258307, r258309, r258310, r258314, r258317, r258319, r258320, r258669, r258786, r258853, r258949, r259079, r259246: r254224: Update the wrapper script to 'release.sh', as used by the FreeBSD Release Engineering Team as of 9.2-RELEASE. Document that a cross-build release is possible by setting the TARGET and TARGET_ARCH variables. Include an example of using release.sh with and without the optional configuration file. Document the supported release.sh configuration file variables. Update the 'cdrom' target output file to disc1.iso. Update the 'memstick' target output file to memstick.img. Add attributions for the last major updates to this manual page. Fix some mdoc(7) style nits. r254294: Remove the defaults for TARGET/TARGET_ARCH. Note that WORLD_FLAGS and KERNEL_FLAGS set the number of make(1) jobs only on SMP-capable systems. r254328: Remove the {SRC,DOC,PORT}REVISION variables from release(7), and update the default {SRC,DOC,PORT}BRANCH defaults. r258307: Add a script and configuration files to fetch pre-built packages from pkg.FreeBSD.org for inclusion on release medium (dvd1.iso). The script sources ${.CURDIR}/${TARGET}/pkg-stage.conf, which sets several environment variables, such as the pkg(8) ABI, PACKAGESITE, PKG_DBDIR, and PKG_CACHEDIR. PKG_CACHEDIR is set to the directory on the release medium used by bsdconfig(8) (/packages/${ABI}). ABI is determined by output of 'make -C /usr/src/release -V REVISION'. See pkg.conf(5) for descripton on other variables set here. The list of packages to include are set within the configuration file. The script and configuration files are intended to be run by the 'make dvd' target within the release directory, and assume the release is built within a chroot environment (such as by using release.sh). r258309: Set the PKG_CACHEDIR directory to 'dvd/' instead of 'release/' in preparation of adding a 'dvd1.iso' target. r258310: Add the 'dvd1.iso' target. This mimics the 'release.iso' target, with the additional step of fetching packages for inclusion on the dvd image. The 'pkg-stage' target is used to run 'scripts/pkg-stage.sh' if the '${TARGET}/pkg-stage.conf' configuration file exists (currently only amd64 and i386). Allow dvd1.iso to be skipped if NODVD=1. r258314: Fix how ABI is evaluated so it matches more than a dot-zero case. r258317: Document the 'dvdrom' target. r258319: Remove WITHOUT_PROFILE=1 for the dvd1.iso medium. r258320: Simplify PKG_ABI for pkg-stage.sh. r258669: Document the dvdrom target and NODVD variable. r258786: Move OPTIONS_UNSET outside of the PBUILD_FLAGS variable, otherwise the textproc/docproj port build fails. r258853: Turn off the dvdrom target by default. dvd1.iso is now built by specifying 'WITH_DVD=1' during 'make release'. r258949: Ensure WITH_DVD is not empty to prevent 'WITH_DVD= ' from evaluating to true. r259079: Add WITH_DVD to RELEASE_RMAKEFLAGS, otherwise it is not actually passed to 'make release'. r259246: Prevent release build errors found during snapshot builds where if NOPORTS=1, pkg-stage.sh cannot build the ports-mgmt/pkg port if WITH_DVD=1. Tested against: stable/9@r259512 Sponsored by: The FreeBSD Foundation Added: stable/9/release/amd64/pkg-stage.conf - copied, changed from r258307, head/release/amd64/pkg-stage.conf stable/9/release/i386/pkg-stage.conf - copied, changed from r258307, head/release/i386/pkg-stage.conf stable/9/release/scripts/pkg-stage.sh - copied, changed from r258307, head/release/scripts/pkg-stage.sh Modified: stable/9/release/Makefile stable/9/release/release.conf.sample stable/9/release/release.sh stable/9/share/man/man7/release.7 Directory Properties: stable/9/release/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Tue Dec 17 23:31:51 2013 (r259529) +++ stable/9/release/Makefile Wed Dec 18 00:07:52 2013 (r259530) @@ -4,6 +4,7 @@ # # User-driven targets: # cdrom: Builds release CD-ROM media (disc1.iso) +# dvdrom: Builds release DVD-ROM media (dvd1.iso) # memstick: Builds memory stick image (memstick.img) # mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) @@ -18,6 +19,7 @@ # NOPORTS: if set, do not distribute ports tree # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation +# WITH_DVD: if set, generate dvd1.iso # TARGET/TARGET_ARCH: architecture of built release # @@ -26,11 +28,15 @@ PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 -TARGET?= ${MACHINE} +.if !defined(TARGET) || empty(TARGET) +TARGET= ${MACHINE} +.endif +.if !defined(TARGET_ARCH) || empty(TARGET_ARCH) .if ${TARGET} == ${MACHINE} -TARGET_ARCH?= ${MACHINE_ARCH} +TARGET_ARCH= ${MACHINE_ARCH} .else -TARGET_ARCH?= ${TARGET} +TARGET_ARCH= ${TARGET} +.endif .endif IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist @@ -72,6 +78,10 @@ IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom IMAGES+= disc1.iso bootonly.iso +. if defined(WITH_DVD) && !empty(WITH_DVD) +RELEASE_TARGETS+= dvdrom +IMAGES+= dvd1.iso +. endif .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img @@ -80,7 +90,12 @@ IMAGES+= memstick.img IMAGES+= mini-memstick.img .endif +CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} +CLEANDIRS= dist ftp release bootonly dvd +beforeclean: + chflags -R noschg . .include +clean: beforeclean base.txz: mkdir -p ${DISTDIR} @@ -165,6 +180,25 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc +dvd: +# Install system + mkdir -p ${.TARGET} + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 +# Copy distfiles + mkdir -p ${.TARGET}/usr/freebsd-dist + cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist +# Copy documentation, if generated +.if !defined(NODOC) + cp reldoc/* ${.TARGET} +.endif +# Set up installation environment + ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf + echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf + echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + cp ${.CURDIR}/rc.local ${.TARGET}/etc + touch ${.TARGET} + release/cdrom.inf: system echo "CD_VERSION = ${REVISION}-${BRANCH}" > ${.TARGET} echo "CD_VOLUME = 1" >> ${.TARGET} @@ -173,6 +207,9 @@ release.iso: disc1.iso disc1.iso: system release/cdrom.inf sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release +dvd1.iso: dvd pkg-stage + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} dvd + bootonly/cdrom.inf: bootonly echo "CD_VERSION = ${REVISION}-${BRANCH}" > ${.TARGET} echo "CD_VOLUME = 1" >> ${.TARGET} @@ -192,7 +229,14 @@ packagesystem: base.txz kernel.txz ${EXT sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} +pkg-stage: +.if(exists(${.CURDIR}/${TARGET}/pkg-stage.conf)) + sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ + ${REVISION} +.endif + cdrom: disc1.iso bootonly.iso +dvdrom: dvd1.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -202,15 +246,6 @@ release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} -clean: - chflags -R noschg . - rm -rf dist ftp - rm -f packagesystem - rm -f *.txz MANIFEST - rm -f system - rm -rf release bootonly - rm -f disc1.iso bootonly.iso memstick.img - install: .if defined(DESTDIR) && !empty(DESTDIR) mkdir -p ${DESTDIR} Copied and modified: stable/9/release/amd64/pkg-stage.conf (from r258307, head/release/amd64/pkg-stage.conf) ============================================================================== --- head/release/amd64/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307, copy source) +++ stable/9/release/amd64/pkg-stage.conf Wed Dec 18 00:07:52 2013 (r259530) @@ -3,14 +3,14 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:64" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:64" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" Copied and modified: stable/9/release/i386/pkg-stage.conf (from r258307, head/release/i386/pkg-stage.conf) ============================================================================== --- head/release/i386/pkg-stage.conf Mon Nov 18 15:22:55 2013 (r258307, copy source) +++ stable/9/release/i386/pkg-stage.conf Wed Dec 18 00:07:52 2013 (r259530) @@ -3,14 +3,14 @@ # $FreeBSD$ # -export PKG_ABI="freebsd:$(echo ${REVISION} | tr -d '.0'):x86:32" +export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:32" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" -export PKG_CACHEDIR="release/packages/${PKG_ABI}" +export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" export PERMISSIVE="YES" export PKGCMD="/usr/sbin/pkg -d -C ${__PKG_CONF}" Modified: stable/9/release/release.conf.sample ============================================================================== --- stable/9/release/release.conf.sample Tue Dec 17 23:31:51 2013 (r259529) +++ stable/9/release/release.conf.sample Wed Dec 18 00:07:52 2013 (r259530) @@ -44,3 +44,4 @@ PORTREVISION="-rHEAD" #NODOC= #NOPORTS= #RELSTRING= +#WITH_DVD= Modified: stable/9/release/release.sh ============================================================================== --- stable/9/release/release.sh Tue Dec 17 23:31:51 2013 (r259529) +++ stable/9/release/release.sh Wed Dec 18 00:07:52 2013 (r259530) @@ -78,6 +78,9 @@ TARGET_ARCH="${TARGET}" NODOC= NOPORTS= +# Set to non-empty value to build dvd1.iso as part of the release. +WITH_DVD= + get_rev_branch () { # Set up the OSVERSION, BRANCH, and REVISION based on the src/ tree # checked out. @@ -142,7 +145,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS}" + ${DOCPORTS} WITH_DVD=${WITH_DVD}" # Force src checkout if configured FORCE_SRC_KEY= @@ -174,6 +177,7 @@ fi get_rev_branch +cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf cd ${CHROOTDIR}/usr/src make ${CHROOT_WMAKEFLAGS} buildworld make ${CHROOT_IMAKEFLAGS} installworld DESTDIR=${CHROOTDIR} @@ -190,9 +194,9 @@ build_doc_ports() { _OSVERSION=$(sysctl -n kern.osreldate) if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS} OPTIONS_UNSET='FOP IGOR'" + PBUILD_FLAGS="${PBUILD_FLAGS}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} install clean distclean + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean fi } @@ -208,7 +212,6 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO fi if [ -d ${CHROOTDIR}/usr/ports ]; then - cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf build_doc_ports ${CHROOTDIR} fi Copied and modified: stable/9/release/scripts/pkg-stage.sh (from r258307, head/release/scripts/pkg-stage.sh) ============================================================================== --- head/release/scripts/pkg-stage.sh Mon Nov 18 15:22:55 2013 (r258307, copy source) +++ stable/9/release/scripts/pkg-stage.sh Wed Dec 18 00:07:52 2013 (r259530) @@ -24,8 +24,13 @@ fi REVISION="${2}" . "${1}" || exit 1 +# If NOPORTS is set for the release, do not attempt to build pkg(8). +if [ ! -f /usr/ports/Makefile ]; then + exit 0 +fi + if [ ! -x /usr/local/sbin/pkg ]; then - /usr/sbin/pkg bootstrap + /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi /bin/mkdir -p ${PKG_CACHEDIR} Modified: stable/9/share/man/man7/release.7 ============================================================================== --- stable/9/share/man/man7/release.7 Tue Dec 17 23:31:51 2013 (r259529) +++ stable/9/share/man/man7/release.7 Wed Dec 18 00:07:52 2013 (r259530) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2013 +.Dd December 2, 2013 .Dt RELEASE 7 .Os .Sh NAME @@ -50,8 +50,9 @@ For some users, it may be desirable to p build environment, with no local modifications to the source tree or to .Xr make.conf 5 , and with clean checkouts of specific versions of the doc, src, and ports -trees. For this purpose, a script -.Pq Pa src/release/generate-release.sh +trees. +For this purpose, a script +.Pq Pa src/release/release.sh is provided to automate these checkouts and then execute .Dq Li "make release" in a clean @@ -70,72 +71,180 @@ and .Dq Li "make buildkernel" . This is necessary to provide the object files for the release or, when using -.Pa generate-release.sh , +.Pa release.sh , so that the object files for a complete system can be installed into a clean .Xr chroot 8 -environment. In this second case, the built world must be capable of running -on the build system (i.e. it must be for the same architecture and be -compatible with the installed kernel). +environment. +.Pp +If the target release build is for a different architecture or machine type, +the +.Va TARGET +and +.Va TARGET_ARCH +variables must be used. +See the supported +.Fa release.conf +variables for more information. +.Pp The release procedure on some architectures may also require that the .Xr md 4 (memory disk) device driver be present in the kernel -(either by being compiled in or available as a module). +.Pq either by being compiled in or available as a module . .Pp This document does not cover source code management, quality assurance, or other aspects of the release engineering process. .Sh CLEAN RELEASE GENERATION -Official releases of FreeBSD are produced in a totally clean environment to +Official releases of +.Fx +are produced in a totally clean environment to ensure consistency between the versions of the src, ports, and doc trees -and to avoid contamination from the host system (e.g. local patches, changes +and to avoid contamination from the host system +.Po such as local patches, changes to .Xr make.conf 5 , -etc.). This is accomplished using the wrapper script -.Pa src/release/generate-release.sh . -.Pp -.Ic generate-release.sh -svn-branch scratch-dir -.Pp -.Ic generate-release.sh -calls +etc. +.Pc . +This is accomplished using the wrapper script +.Pa src/release/release.sh . +.Pp +.Ic release.sh +.Op Fl c Ar release.conf +.Pp +.Ic release.sh +checks out the +.Li src/ , +.Li ports/ , +and +.Li doc/ +trees to +.Va CHROOTDIR , +then calls +.Dq Li "make buildworld" +and .Dq Li "make installworld" to generate a .Xr chroot 8 -environment in -.Ar scratch-dir . -It then checks out the src tree specified by -.Ar svn-branch -using -.Xr svn 1 . -Once the various source trees have been obtained, it executes +environment. +Next, .Dq Li "make release" -within the +is run within the .Xr chroot 8 environment and places the result in -.Pa $scratch-dir/R . -Note that because this uses a chroot, it cannot be used to cross-build -.Fx -release media. +.Pa $CHROOTDIR/R . .Pp -Environment variables: -.Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev MAKE_FLAGS -This environment variable can be set to pass flags (e.g. -j) to -.Xr make 1 -when invoked by the script. -.It Ev SVNROOT -The location of the FreeBSD SVN source, doc, and ports repositories. +The optional +.Fa release.conf +configuration file supports the following variables: +.Bl -tag -width Ev +.It Va CHROOTDIR +The directory within which the release will be built. +.It Va SVNROOT +The +.Xr svn 1 +host used to check out the various trees. Defaults to -.Pa svn://svn.freebsd.org/base -for the source tree, -.Pa svn://svn.freebsd.org/ports/head -for the Ports Collection, and -.Pa svn://svn.freebsd.org/doc/head -for the Documentation Project source. -.It Ev RELSTRING -Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). -Defaults to the output of -.Ic `uname -s`-`uname -r`-`uname -p` -within the chroot. +.Pa svn://svn.FreeeBSD.org . +.It Va SRCBRANCH +The +.Li src/ +branch to use. +Defaults to +.Va head/@rHEAD . +.It Va DOCBRANCH +The +.Li doc/ +branch to use. +Defaults to +.Va head/@rHEAD . +.It Va PORTBRANCH +The +.Li ports/ +branch to use. +Defaults to +.Va head/@rHEAD . +.It Va TARGET +The target machine type for cross-building a release. +.It Va TARGET_ARCH +The target machine architecture for cross-building a release. +.Pp +For the supported list of +.Va TARGET +and +.Va TARGET_ARCH +combinations, consult the output of +.Dq make targets +as documented in +.Xr build 7 . +.It Va KERNEL +The target kernel configuration to use. +Defaults to +.Va GENERIC . +Multiple +.Va KERNEL +entries may be specified. +.It Va MAKE_CONF +The +.Xr make.conf 5 +to use for the release build. +Defaults to +.Fa /dev/null +to prevent polluting the release with local system changes. +.It Va SRC_CONF +The +.Xr src.conf 5 +to use for the release build. +Defaults to +.Fa /dev/null +to prevent polluting the release with local system changes. +.It Va MAKE_FLAGS +Additional flags to pass to +.Xr make 1 . +.It Va WORLD_FLAGS +Additional flags to pass to +.Xr make 1 +during the +.Dq buildworld +phase. +Defaults to setting the number of +.Xr make 1 +jobs +.Pq Ar -j +to the number of CPUs available on a SMP-capable system. +.It Va KERNEL_FLAGS +Additional flags to pass to +.Xr make 1 +during the +.Dq buildkernel +phase. +Defaults to setting the number of +.Xr make 1 +jobs +.Pq Ar -j +to half the number of CPUs available on a SMP-capable system. +.It Va NODOC +Set to a non-empty value to skip the +.Li doc/ +tree checkout. +When set, +.Va NODOC +will prevent the +.Fa doc.txz +distribution package from being created. +.It Va NOPORTS +Set to a non-empty value to skip the +.Li ports/ +tree checkout. +When set, +.Va NOPORTS +will prevent the +.Fa ports.txz +distribution package from being created. +Setting this also sets +.Va NODOC . +.It Va WITH_DVD +Set to a non-empty value to include the +.Cm dvdrom +target. .El .Sh MAKEFILE TARGETS The release makefile @@ -164,17 +273,27 @@ and possibly that the (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). This target produces files called -.Pa release.iso +.Pa disc1.iso and .Pa bootonly.iso as its output. +.It Cm dvdrom +Builds installation DVD-ROM images. +This may require the +.Xr md 4 +(memory disk) device driver be present in the kernel +(either by being compiled in or available as a module). +This target produces the +.Pa dvd1.iso +file as its output. .It Cm memstick Builds an installation memory stick image named -.Pa memstick . +.Pa memstick.img . Not applicable on all platforms. Requires that the .Xr md 4 -(memory disk) device driver be present in the kernel -(either by being compiled in or available as a module). +.Pq memory disk +device driver be present in the kernel +.Pq either by being compiled in or available as a module . .It Cm mini-memstick Similar to .Cm memstick , @@ -190,39 +309,51 @@ and suitable for upload to an FTP mirror Major subtargets called by targets above: .Bl -tag -width ".Cm packagesystem" .It Cm packagesystem -Generates all the distribution archives (e.g. base, kernel, ports, doc) +Generates all the distribution archives +.Pq base, kernel, ports, doc applicable on this platform. .It Cm system Builds a bootable installation system containing all the distribution files packaged by the .Cm packagesystem target, and suitable for imaging by the -.Cm cdrom +.Cm cdrom , +.Cm dvdrom and .Cm memstick targets. .It Cm reldoc Builds the release documentation. This includes the release notes, -hardware guide, and installation instructions. Other documentation (e.g. -the Handbook) is built during the +hardware guide, and installation instructions. +Other documentation, such as the Handbook, +is built during the .Cm base.txz target invoked by .Cm packagesystem. .El .Sh ENVIRONMENT Optional variables: -.Bl -tag -width ".Va TARGET_ARCH" -.It Va WORLDDIR -Location of a directory containing the src tree. By default, the directory +.Bl -tag -width ".Ev TARGET_ARCH" +.It Ev OSRELEASE +Optional base name for generated media images +.Pq e.g., FreeBSD-9.0-RC2-amd64 . +Defaults to the output of +.Ic `uname -s`-`uname -r`-`uname -p` +within the chroot. +.It Ev WORLDDIR +Location of a directory containing the src tree. +By default, the directory above the one containing the makefile .Pq Pa src . .It Va PORTSDIR -Location of a directory containing the ports tree. By default, +Location of a directory containing the ports tree. +By default, .Pa /usr/ports . If it is unset or cannot be found, ports will not be included in the release. .It Va DOCDIR -Location of a directory containing the doc tree. By default, +Location of a directory containing the doc tree. +By default, .Pa /usr/doc . If it is unset or cannot be found, most documentation will not be included in the release; see @@ -279,7 +410,8 @@ Typically, one only needs to set .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .It Pa /usr/src/release/Makefile -.It Pa /usr/src/release/generate-release.sh +.It Pa /usr/src/release/release.sh +.It Pa /usr/src/release/release.conf.sample .El .Sh EXAMPLES The following sequence of commands can be used to build a @@ -304,13 +436,27 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export SVNROOT=svn://svn.freebsd.org/base -sh generate-release.sh head /local3/release +sh release.sh +.Ed +.Pp +Optionally, a configuration file can be used customize the release build, +such as the subversion revision to use, the branch of the subversion tree for +.Li src/ , +.Li ports/ , +and +.Li doc/ . +.Bd -literal -offset indent +cd /usr/src/release +sh release.sh -c $HOME/release.conf .Ed .Pp After running these commands, all prepared release files are available in the -.Pa /local3/release/R +.Pa /scratch directory. +The target directory can be changed by specifying the +.Va CHROOTDIR +variable in +.Li release.conf . .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , @@ -361,6 +507,16 @@ was overhauled and the wrapper script .Pa src/release/generate-release.sh introduced to support the introduction of a new installer. .Pp +For the +.Fx 9.2 +release, +.Pa src/release/release.sh +was introduced to support per-build configuration files. +.Pa src/release/release.sh +is heavily based on the +.Pa src/release/generate-release.sh +script. +.Pp At near 1000 revisions spread over multiple branches, the .Xr svn 1 log of @@ -375,5 +531,22 @@ was originally written by .An Jordan Hubbard , and .An Poul-Henning Kamp . -This manual page was written by +.Pp +This manual page was originally written by .An Murray Stokely Aq murray@FreeBSD.org . +.Pp +It was updated by +.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org +to include the +.Fa generate-release.sh +script used for the +.Fx 9.0 +release cycle. +.Pp +It was later updated by +.An Glen Barber Aq gjb@FreeBSD.org +to include the +.Fa release.sh +script used for the +.Fx 9.2 +release cycle. From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:10:30 2013 Return-Path: Delivered-To: svn-src-all@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 BACE3A59; Wed, 18 Dec 2013 00:10: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A73A51ABA; Wed, 18 Dec 2013 00:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI0AUhd015279; Wed, 18 Dec 2013 00:10:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI0AUIa015278; Wed, 18 Dec 2013 00:10:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312180010.rBI0AUIa015278@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 00:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259531 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:10:30 -0000 Author: pfg Date: Wed Dec 18 00:10:30 2013 New Revision: 259531 URL: http://svnweb.freebsd.org/changeset/base/259531 Log: gcc: point to our address for bug reports. As recommended by the FSF in gcc/version.c : "If you distribute a modified version of GCC, please change this to refer to a document giving instructions for reporting bugs to you, not us." MFC after: 2 weeks Modified: head/contrib/gcc/version.c Modified: head/contrib/gcc/version.c ============================================================================== --- head/contrib/gcc/version.c Wed Dec 18 00:07:52 2013 (r259530) +++ head/contrib/gcc/version.c Wed Dec 18 00:10:30 2013 (r259531) @@ -18,7 +18,7 @@ forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ -const char bug_report_url[] = ""; +const char bug_report_url[] = ""; /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:14:59 2013 Return-Path: Delivered-To: svn-src-all@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 312E4D87; Wed, 18 Dec 2013 00:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D73C1B28; Wed, 18 Dec 2013 00:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI0EwNa018066; Wed, 18 Dec 2013 00:14:58 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI0Ewd9018065; Wed, 18 Dec 2013 00:14:58 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312180014.rBI0Ewd9018065@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 18 Dec 2013 00:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259532 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:14:59 -0000 Author: ray Date: Wed Dec 18 00:14:58 2013 New Revision: 259532 URL: http://svnweb.freebsd.org/changeset/base/259532 Log: Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_altgr is not zero. Submitted by: andreast Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Dec 18 00:10:30 2013 (r259531) +++ head/sys/dev/vt/vt_core.c Wed Dec 18 00:14:58 2013 (r259532) @@ -113,6 +113,7 @@ const struct terminal_class vt_termclass int sc_txtmouse_no_retrace_wait; static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "Newcons parameters"); +VT_SYSCTL_INT(enable_altgr, 0, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "Newcons debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); @@ -404,6 +405,8 @@ vt_processkey(keyboard_t *kbd, struct vt if (c & RELKEY) { switch (c & ~RELKEY) { case (SPCLKEY | RALT): + if (vt_enable_altgr != 0) + break; case (SPCLKEY | LALT): vd->vd_kbstate &= ~ALKED; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:21:28 2013 Return-Path: Delivered-To: svn-src-all@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 8D5BBA1; Wed, 18 Dec 2013 00:21:28 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A96471CB6; Wed, 18 Dec 2013 00:21:27 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id u57so6951000wes.32 for ; Tue, 17 Dec 2013 16:21:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=EsSL5CE/6wIsGFRn6Vg5Lqm9qIRJ2A0sDi5X0sLsEqY=; b=07ZIxmSJ9LfegDFZOqnkPRNnPsdB69LIIM6rmilTiKbQdZwY/nL/brfiFHm6eV1k53 AqcNyDHr9nOYGmY3MKZakR2DDntBFOqViE3L6oaZM6HUtAQACTW1Fsu/Jv1P3hT5pSmr Q4dMWQrPV3an8hWiCk6AjvnpIwFFPrDLFTvGN0ZY3y5mfRrc6cTGRPUmho/deOHyHvVU howsvLBLt/hNRkvgBr8UI6PMFtP4ILs+DB5OmvDFpGv07RYcyDcd9RdnD67jyGtGqNBx oqxdVJNfVhyKUYFVaufMdpN9R5tyVmQa2yq31NcdRsANgQAGmqZluGNgblQ74FkCsI6Y lPdw== X-Received: by 10.194.78.179 with SMTP id c19mr666849wjx.84.1387326085512; Tue, 17 Dec 2013 16:21:25 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id cx3sm55827949wib.0.2013.12.17.16.21.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 16:21:24 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 18 Dec 2013 01:21:22 +0100 From: Baptiste Daroussin To: Aleksandr Rybalko Subject: Re: svn commit: r259532 - head/sys/dev/vt Message-ID: <20131218002122.GP99753@ithaqua.etoilebsd.net> References: <201312180014.rBI0Ewd9018065@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WOTjKnJ88wpJKlWH" Content-Disposition: inline In-Reply-To: <201312180014.rBI0Ewd9018065@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:21:28 -0000 --WOTjKnJ88wpJKlWH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2013 at 12:14:58AM +0000, Aleksandr Rybalko wrote: > Author: ray > Date: Wed Dec 18 00:14:58 2013 > New Revision: 259532 > URL: http://svnweb.freebsd.org/changeset/base/259532 >=20 > Log: > Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_= altgr is > not zero. > =20 > Submitted by: andreast > Sponsored by: The FreeBSD Foundation altgr support should probably be 1 by default in that case, many keyboards = need that key by default. Example on french keyboard it is used for: #{[|`\^@]} Without those, very hard to hack or just use a console :) regards, Bapt --WOTjKnJ88wpJKlWH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlKw6oIACgkQ8kTtMUmk6ExK/gCfby1wucALC3n9U6eL0YosATD6 tBgAoIcAQ35aCf7h/ernPqFKNYI0PLyz =6JRG -----END PGP SIGNATURE----- --WOTjKnJ88wpJKlWH-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:22:00 2013 Return-Path: Delivered-To: svn-src-all@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 14D401F7; Wed, 18 Dec 2013 00:22:00 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id BC9C61CBA; Wed, 18 Dec 2013 00:21:59 +0000 (UTC) Received: from rnote.ddteam.net (7-17-135-95.pool.ukrtel.net [95.135.17.7]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id E59C9C4958; Wed, 18 Dec 2013 02:21:57 +0200 (EET) Date: Wed, 18 Dec 2013 02:21:56 +0200 From: Aleksandr Rybalko To: Andreas Tobler Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-Id: <20131218022156.ed5c6a17.ray@freebsd.org> In-Reply-To: <52A79A82.7050801@FreeBSD.org> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tijl Coosemans , src-committers@FreeBSD.org, Aleksandr Rybalko X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:22:00 -0000 On Tue, 10 Dec 2013 23:49:38 +0100 Andreas Tobler wrote: > On 10.12.13 14:43, Tijl Coosemans wrote: > > On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: > >> That keyboards have no Shift key for that? :) > >> I will be glad to apply your changes, but I have to know how it > >> should be controlled. > >> > >> RU and UA PC keyboards have same 3 symbols '2', '"', '@' > >> To get '2' i have to press only '2' > >> To get '@' I have to press Shift+'2' > >> To get '"' I have to switch to UA or RU and press Shift+'2' > >> > >> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary > >> lang switch. Which commonly mapped to one of Alt. Right? > >> So R-Alt+Shift+'2'? > > > > https://en.wikipedia.org/wiki/AltGr > > Thanks Tijl! > > To get the @ I have to press AltGr + '2'. > There are combinations where I have to press AltGr+Shift. e.g to get > the 'broken bar, ¦', AltGr+Shift+'7'. > > Andreas > Hello Andreas and Tijl! Since I think not a whole world have AltGr key (read as "not most keyboards on the Earth") :) Think it is OK to use R.Alt as an Alt by default, and enable AltGr with sysctl kern.vt.enable_altgr. Committed at r259532. Any other opinions are welcomed! WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 00:24:21 2013 Return-Path: Delivered-To: svn-src-all@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 BDD1B352; Wed, 18 Dec 2013 00:24:21 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89F5B1CD1; Wed, 18 Dec 2013 00:24:20 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id z2so4561978wiv.1 for ; Tue, 17 Dec 2013 16:24:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ATAfrc+0+xoQ+MgY5ZJu3/yOK9j9+dkDLMMG/VejID8=; b=NV8Rkok+MkNyxco9kdnkGZGOMcHXsKoXLxgyHzzHUFRSG5TPo5b0tuozumaavrSx8X dF1DOiohbAfqtp4o63N/4J8MI7L6Tw2/ch55XhDzhC95p/oloBva5tpup60dUdC3IKrN Zp6PEAx12TJ7zD5Ct8vScqDG+dCXJr8zLZcprjDAIC4XtPi5FJetNGb1pkVY8FhY7db4 +1d5EXLl/3ac5Xsh7VRy7NDUGCciTIGLpVhGixM7OhUl1Uzm0DPzkUcyOxxgb2HpIHNk +ErzkK0ftMlFYhlwQP0LpnLhEaXpO/iJRWxHgwWA9FYrngUThyJnrBtJVXCjJqW9KwRN EqFw== X-Received: by 10.194.240.129 with SMTP id wa1mr22000963wjc.31.1387326258946; Tue, 17 Dec 2013 16:24:18 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id fj8sm55861876wib.1.2013.12.17.16.24.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 16:24:17 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 18 Dec 2013 01:24:16 +0100 From: Baptiste Daroussin To: Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-ID: <20131218002415.GQ99753@ithaqua.etoilebsd.net> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R4+lwT0Y15rLnKR0" Content-Disposition: inline In-Reply-To: <20131218022156.ed5c6a17.ray@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 00:24:21 -0000 --R4+lwT0Y15rLnKR0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: > On Tue, 10 Dec 2013 23:49:38 +0100 > Andreas Tobler wrote: >=20 > > On 10.12.13 14:43, Tijl Coosemans wrote: > > > On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: > > >> That keyboards have no Shift key for that? :) > > >> I will be glad to apply your changes, but I have to know how it > > >> should be controlled. > > >> > > >> RU and UA PC keyboards have same 3 symbols '2', '"', '@' > > >> To get '2' i have to press only '2' > > >> To get '@' I have to press Shift+'2' > > >> To get '"' I have to switch to UA or RU and press Shift+'2' > > >> > > >> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary > > >> lang switch. Which commonly mapped to one of Alt. Right? > > >> So R-Alt+Shift+'2'? > > >=20 > > > https://en.wikipedia.org/wiki/AltGr > >=20 > > Thanks Tijl! > >=20 > > To get the @ I have to press AltGr + '2'. > > There are combinations where I have to press AltGr+Shift. e.g to get > > the 'broken bar, =A6', AltGr+Shift+'7'. > >=20 > > Andreas > >=20 >=20 > Hello Andreas and Tijl! >=20 > Since I think not a whole world have AltGr key (read as "not most > keyboards on the Earth") :) > Think it is OK to use R.Alt as an Alt by default, and enable AltGr with > sysctl kern.vt.enable_altgr. >=20 I tend to disagree with you, lots of keyboards mapping are concerned here. Bapt --R4+lwT0Y15rLnKR0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlKw6y8ACgkQ8kTtMUmk6Ex2iACeKYIJzFJoSzjcXO1VAx5fKp2T sIIAn3c9eWHcR/Cq1cvi6QMWd1n5BWaN =YsiB -----END PGP SIGNATURE----- --R4+lwT0Y15rLnKR0-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 01:14:27 2013 Return-Path: Delivered-To: svn-src-all@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 12CB5BE1; Wed, 18 Dec 2013 01:14:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E7628107A; Wed, 18 Dec 2013 01:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI1EQ4s039434; Wed, 18 Dec 2013 01:14:26 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI1EQiY039431; Wed, 18 Dec 2013 01:14:26 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312180114.rBI1EQiY039431@svn.freebsd.org> From: Glen Barber Date: Wed, 18 Dec 2013 01:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259533 - in stable/10: release release/scripts usr.sbin/bsdconfig/share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 01:14:27 -0000 Author: gjb Date: Wed Dec 18 01:14:25 2013 New Revision: 259533 URL: http://svnweb.freebsd.org/changeset/base/259533 Log: MFC r259426, r259427: r259426: Add a pkg(8) repository configuration file for cdrom-based package installation. As part of the 'pkg-stage' target, copy the configuration file to the 'packages/repos/' directory on the DVD filesystem. r259427: Export 'REPOS_DIR' when the selected source medium for package installation is cdrom. This enables bsdconfig(8) to make use of the on-disc pkg(8) repository configuration, which fixes package selection and installation from the dvd installer. Sponsored by: The FreeBSD Foundation Added: stable/10/release/scripts/FreeBSD_install_cdrom.conf - copied unchanged from r259426, head/release/scripts/FreeBSD_install_cdrom.conf Modified: stable/10/release/Makefile stable/10/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Wed Dec 18 00:14:58 2013 (r259532) +++ stable/10/release/Makefile Wed Dec 18 01:14:25 2013 (r259533) @@ -225,7 +225,11 @@ pkg-stage: .if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf) sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ ${REVISION} + mkdir -p ${.OBJDIR}/dvd/packages/repos/ + cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ + ${.OBJDIR}/dvd/packages/repos/ .endif + touch ${.TARGET} cdrom: disc1.iso bootonly.iso dvdrom: dvd1.iso Copied: stable/10/release/scripts/FreeBSD_install_cdrom.conf (from r259426, head/release/scripts/FreeBSD_install_cdrom.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/release/scripts/FreeBSD_install_cdrom.conf Wed Dec 18 01:14:25 2013 (r259533, copy of r259426, head/release/scripts/FreeBSD_install_cdrom.conf) @@ -0,0 +1,12 @@ +# +# $FreeBSD$ +# +# The pkg(8) repository configuration file for the installation DVD. +# + +FreeBSD_install_cdrom: { + url: "file:///dist/packages/${ABI}", + mirror_type: "none", + enabled: yes +} + Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Wed Dec 18 00:14:58 2013 (r259532) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Wed Dec 18 01:14:25 2013 (r259533) @@ -119,6 +119,9 @@ f_index_initialize() $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_CDROM) + __site="file://$MOUNTPOINT/packages/$PKG_ABI" + export REPOS_DIR="$MOUNTPOINT/packages/repos" ;; *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 01:27:31 2013 Return-Path: Delivered-To: svn-src-all@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 BEBBA1C2; Wed, 18 Dec 2013 01:27:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC701169; Wed, 18 Dec 2013 01:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI1RVk4043284; Wed, 18 Dec 2013 01:27:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI1RVY5043280; Wed, 18 Dec 2013 01:27:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312180127.rBI1RVY5043280@svn.freebsd.org> From: Glen Barber Date: Wed, 18 Dec 2013 01:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259534 - in releng/10.0: release release/scripts usr.sbin/bsdconfig/share/packages X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 01:27:31 -0000 Author: gjb Date: Wed Dec 18 01:27:30 2013 New Revision: 259534 URL: http://svnweb.freebsd.org/changeset/base/259534 Log: MFC r259426, r259427: r259426: Add a pkg(8) repository configuration file for cdrom-based package installation. As part of the 'pkg-stage' target, copy the configuration file to the 'packages/repos/' directory on the DVD filesystem. r259427: Export 'REPOS_DIR' when the selected source medium for package installation is cdrom. This enables bsdconfig(8) to make use of the on-disc pkg(8) repository configuration, which fixes package selection and installation from the dvd installer. Approved by: re (delphij, glebius) Sponsored by: The FreeBSD Foundation Added: releng/10.0/release/scripts/FreeBSD_install_cdrom.conf - copied unchanged from r259533, stable/10/release/scripts/FreeBSD_install_cdrom.conf Modified: releng/10.0/release/Makefile releng/10.0/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/release/Makefile ============================================================================== --- releng/10.0/release/Makefile Wed Dec 18 01:14:25 2013 (r259533) +++ releng/10.0/release/Makefile Wed Dec 18 01:27:30 2013 (r259534) @@ -217,7 +217,11 @@ pkg-stage: .if(exists(${.CURDIR}/${TARGET}/pkg-stage.conf)) sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \ ${REVISION} + mkdir -p ${.OBJDIR}/dvd/packages/repos/ + cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ + ${.OBJDIR}/dvd/packages/repos/ .endif + touch ${.TARGET} cdrom: disc1.iso bootonly.iso dvdrom: dvd1.iso Copied: releng/10.0/release/scripts/FreeBSD_install_cdrom.conf (from r259533, stable/10/release/scripts/FreeBSD_install_cdrom.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/10.0/release/scripts/FreeBSD_install_cdrom.conf Wed Dec 18 01:27:30 2013 (r259534, copy of r259533, stable/10/release/scripts/FreeBSD_install_cdrom.conf) @@ -0,0 +1,12 @@ +# +# $FreeBSD$ +# +# The pkg(8) repository configuration file for the installation DVD. +# + +FreeBSD_install_cdrom: { + url: "file:///dist/packages/${ABI}", + mirror_type: "none", + enabled: yes +} + Modified: releng/10.0/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- releng/10.0/usr.sbin/bsdconfig/share/packages/index.subr Wed Dec 18 01:14:25 2013 (r259533) +++ releng/10.0/usr.sbin/bsdconfig/share/packages/index.subr Wed Dec 18 01:27:30 2013 (r259534) @@ -119,6 +119,9 @@ f_index_initialize() $DEVICE_TYPE_HTTP_PROXY) f_getvar $VAR_HTTP_PROXY_PATH __site __site="$__site/packages/$PKG_ABI" ;; + $DEVICE_TYPE_CDROM) + __site="file://$MOUNTPOINT/packages/$PKG_ABI" + export REPOS_DIR="$MOUNTPOINT/packages/repos" ;; *) # UFS, DISK, CDROM, USB, DOS, NFS, etc. __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 01:41:53 2013 Return-Path: Delivered-To: svn-src-all@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 3A2BC771; Wed, 18 Dec 2013 01:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 254341263; Wed, 18 Dec 2013 01:41:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI1fq6u049559; Wed, 18 Dec 2013 01:41:52 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI1fqme049557; Wed, 18 Dec 2013 01:41:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312180141.rBI1fqme049557@svn.freebsd.org> From: Mark Johnston Date: Wed, 18 Dec 2013 01:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259535 - in head/sys: cddl/contrib/opensolaris/uts/intel/dtrace kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 01:41:53 -0000 Author: markj Date: Wed Dec 18 01:41:52 2013 New Revision: 259535 URL: http://svnweb.freebsd.org/changeset/base/259535 Log: The fasttrap fork handler is responsible for removing tracepoints in the child process that were inherited from its parent. However, this should not be done in the case of a vfork, since the fork handler ends up removing the tracepoints from the shared vm space, and userland DTrace probes in the parent will no longer fire as a result. Now the child of a vfork may trigger userland DTrace probes enabled in its parent, so modify the fasttrap probe handler to handle this case and handle the child process in the same way that it would handle the traced process. In particular, if once traces function foo() in a process that vforks, and the child calls foo(), fasttrap will treat this call as having come from the parent. This is the behaviour of the upstream code. While here, add #ifdef guards to some code that isn't present upstream. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/kern/kern_fork.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 18 01:27:30 2013 (r259534) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 18 01:41:52 2013 (r259535) @@ -1001,6 +1001,9 @@ int fasttrap_pid_probe(struct reg *rp) { proc_t *p = curproc; +#if !defined(sun) + proc_t *pp; +#endif uintptr_t pc = rp->r_rip - 1; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; @@ -1036,24 +1039,32 @@ fasttrap_pid_probe(struct reg *rp) curthread->t_dtrace_regv = 0; #endif -#if defined(sun) /* * Treat a child created by a call to vfork(2) as if it were its * parent. We know that there's only one thread of control in such a * process: this one. */ +#if defined(sun) while (p->p_flag & SVFORK) { p = p->p_parent; } -#endif - PROC_LOCK(p); - _PHOLD(p); pid = p->p_pid; -#if defined(sun) pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; mutex_enter(pid_mtx); +#else + pp = p; + sx_slock(&proctree_lock); + while (pp->p_vmspace == pp->p_pptr->p_vmspace) + pp = pp->p_pptr; + pid = pp->p_pid; + sx_sunlock(&proctree_lock); + pp = NULL; + + PROC_LOCK(p); + _PHOLD(p); #endif + bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; /* @@ -1073,9 +1084,10 @@ fasttrap_pid_probe(struct reg *rp) if (tp == NULL) { #if defined(sun) mutex_exit(pid_mtx); -#endif +#else _PRELE(p); PROC_UNLOCK(p); +#endif return (-1); } @@ -1197,9 +1209,10 @@ fasttrap_pid_probe(struct reg *rp) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; - PROC_UNLOCK(p); #if defined(sun) mutex_exit(pid_mtx); +#else + PROC_UNLOCK(p); #endif tp = &tp_local; @@ -1749,7 +1762,7 @@ fasttrap_pid_probe(struct reg *rp) #if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { #else - if (uwrite(curproc, scratch, i, addr)) { + if (uwrite(p, scratch, i, addr)) { #endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; @@ -1808,10 +1821,12 @@ done: rp->r_rip = new_pc; +#if !defined(sun) PROC_LOCK(p); proc_write_regs(curthread, rp); _PRELE(p); PROC_UNLOCK(p); +#endif return (0); } Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 18 01:27:30 2013 (r259534) +++ head/sys/kern/kern_fork.c Wed Dec 18 01:41:52 2013 (r259535) @@ -676,12 +676,12 @@ do_fork(struct thread *td, int flags, st #ifdef KDTRACE_HOOKS /* - * Tell the DTrace fasttrap provider about the new process - * if it has registered an interest. We have to do this only after - * p_state is PRS_NORMAL since the fasttrap module will use pfind() - * later on. + * Tell the DTrace fasttrap provider about the new process so that any + * tracepoints inherited from the parent can be removed. We have to do + * this only after p_state is PRS_NORMAL since the fasttrap module will + * use pfind() later on. */ - if (dtrace_fasttrap_fork) + if ((flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 03:51:05 2013 Return-Path: Delivered-To: svn-src-all@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 7C4F1266; Wed, 18 Dec 2013 03:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68EEC1E67; Wed, 18 Dec 2013 03:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI3p5Qh097399; Wed, 18 Dec 2013 03:51:05 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI3p5Eb097397; Wed, 18 Dec 2013 03:51:05 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201312180351.rBI3p5Eb097397@svn.freebsd.org> From: Peter Grehan Date: Wed, 18 Dec 2013 03:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259536 - 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 03:51:05 -0000 Author: grehan Date: Wed Dec 18 03:51:04 2013 New Revision: 259536 URL: http://svnweb.freebsd.org/changeset/base/259536 Log: MFC r259302,r259413 r259302 bhyve(8) man page r259413 mdoc: sort SEE ALSO Added: stable/10/usr.sbin/bhyve/bhyve.8 - copied, changed from r259302, head/usr.sbin/bhyve/bhyve.8 Modified: stable/10/usr.sbin/bhyve/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Wed Dec 18 01:41:52 2013 (r259535) +++ stable/10/usr.sbin/bhyve/Makefile Wed Dec 18 03:51:04 2013 (r259536) @@ -6,6 +6,7 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 +MAN= bhyve.8 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c SRCS+= inout.c ioapic.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c @@ -15,8 +16,6 @@ SRCS+= uart_emul.c virtio.c xmsr.c spinu .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c -NO_MAN= - DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} LDADD= -lvmmapi -lmd -lutil -lpthread Copied and modified: stable/10/usr.sbin/bhyve/bhyve.8 (from r259302, head/usr.sbin/bhyve/bhyve.8) ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 08:31:13 2013 (r259302, copy source) +++ stable/10/usr.sbin/bhyve/bhyve.8 Wed Dec 18 03:51:04 2013 (r259536) @@ -288,8 +288,8 @@ bhyve -c 4 \e\ .Xr nmdm 4 , .Xr vmm 4 , .Xr ethers 5 , -.Xr bhyveload 8 , -.Xr bhyvectl 8 +.Xr bhyvectl 8 , +.Xr bhyveload 8 .Sh HISTORY .Nm first appeared in From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 03:58:52 2013 Return-Path: Delivered-To: svn-src-all@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 7AE8E415; Wed, 18 Dec 2013 03:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66A521E9E; Wed, 18 Dec 2013 03:58:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI3wq1R098238; Wed, 18 Dec 2013 03:58:52 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI3wpHX098235; Wed, 18 Dec 2013 03:58:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312180358.rBI3wpHX098235@svn.freebsd.org> From: Neel Natu Date: Wed, 18 Dec 2013 03:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259537 - in head: lib/libvmmapi usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 03:58:52 -0000 Author: neel Date: Wed Dec 18 03:58:51 2013 New Revision: 259537 URL: http://svnweb.freebsd.org/changeset/base/259537 Log: Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to 'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively. It should now be clear that these functions operate on passthru devices. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:51:04 2013 (r259536) +++ head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:58:51 2013 (r259537) @@ -563,8 +563,8 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in } int -vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - uint64_t addr, uint64_t msg, int numvec) +vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + uint64_t addr, uint64_t msg, int numvec) { struct vm_pptdev_msi pptmsi; @@ -581,8 +581,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu } int -vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) +vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, + int idx, uint64_t addr, uint64_t msg, uint32_t vector_control) { struct vm_pptdev_msix pptmsix; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:51:04 2013 (r259536) +++ head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:58:51 2013 (r259537) @@ -82,10 +82,11 @@ int vm_assign_pptdev(struct vmctx *ctx, int vm_unassign_pptdev(struct vmctx *ctx, int bus, int slot, int func); int vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); -int vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - uint64_t addr, uint64_t msg, int numvec); -int vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func, - int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); +int vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, uint64_t addr, uint64_t msg, int numvec); +int vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, + int func, int idx, uint64_t addr, uint64_t msg, + uint32_t vector_control); /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Wed Dec 18 03:51:04 2013 (r259536) +++ head/usr.sbin/bhyve/pci_passthru.c Wed Dec 18 03:58:51 2013 (r259537) @@ -345,12 +345,10 @@ msix_table_write(struct vmctx *ctx, int /* If the entry is masked, don't set it up */ if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 || (vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { - error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus, - sc->psc_sel.pc_dev, - sc->psc_sel.pc_func, - index, entry->addr, - entry->msg_data, - entry->vector_control); + error = vm_setup_pptdev_msix(ctx, vcpu, + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func, index, entry->addr, + entry->msg_data, entry->vector_control); } } } @@ -652,12 +650,12 @@ passthru_cfgwrite(struct vmctx *ctx, int if (msicap_access(sc, coff)) { msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val); - error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus, + error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.addr, pi->pi_msi.msg_data, pi->pi_msi.maxmsgnum); if (error != 0) { - printf("vm_setup_msi returned error %d\r\n", errno); + printf("vm_setup_pptdev_msi error %d\r\n", errno); exit(1); } return (0); @@ -668,7 +666,7 @@ passthru_cfgwrite(struct vmctx *ctx, int if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_msix(ctx, vcpu, + error = vm_setup_pptdev_msix(ctx, vcpu, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, i, pi->pi_msix.table[i].addr, @@ -676,8 +674,8 @@ passthru_cfgwrite(struct vmctx *ctx, int pi->pi_msix.table[i].vector_control); if (error) { - printf("vm_setup_msix error %d\r\n", - errno); + printf("vm_setup_pptdev_msix error " + "%d\r\n", errno); exit(1); } } From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 04:36:35 2013 Return-Path: Delivered-To: svn-src-all@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 AFE70D0F; Wed, 18 Dec 2013 04:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C59E1146; Wed, 18 Dec 2013 04:36:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4aZcd012692; Wed, 18 Dec 2013 04:36:35 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4aZHW012691; Wed, 18 Dec 2013 04:36:35 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312180436.rBI4aZHW012691@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 04:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259538 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 04:36:35 -0000 Author: glebius Date: Wed Dec 18 04:36:35 2013 New Revision: 259538 URL: http://svnweb.freebsd.org/changeset/base/259538 Log: Fix build. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Dec 18 03:58:51 2013 (r259537) +++ head/sys/dev/netmap/netmap.c Wed Dec 18 04:36:35 2013 (r259538) @@ -151,6 +151,7 @@ ports attached to the switch) #include /* bus_dmamap_* */ #include #include +#include /* reduce conditional code */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 04:44:39 2013 Return-Path: Delivered-To: svn-src-all@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 0E5C8EEF; Wed, 18 Dec 2013 04:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF24F11C0; Wed, 18 Dec 2013 04:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4icqZ015943; Wed, 18 Dec 2013 04:44:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4icNi015942; Wed, 18 Dec 2013 04:44:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312180444.rBI4icNi015942@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 04:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259539 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 04:44:39 -0000 Author: marcel Date: Wed Dec 18 04:44:38 2013 New Revision: 259539 URL: http://svnweb.freebsd.org/changeset/base/259539 Log: Support long filenames. Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Wed Dec 18 04:36:35 2013 (r259538) +++ head/lib/libstand/dosfs.c Wed Dec 18 04:44:38 2013 (r259539) @@ -381,21 +381,32 @@ dos_readdir(struct open_file *fd, struct if (dd.de.name[0] == 0xe5) continue; - /* Skip volume labels */ - if (dd.de.attr & FA_LABEL) - continue; - - if ((dd.de.attr & FA_MASK) == FA_XDE) { - if (dd.xde.seq & 0x40) - chk = dd.xde.chk; - else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) - continue; - x = dd.xde.seq & ~0x40; - if (x < 1 || x > 20) { - x = 0; + /* Check if directory entry is volume label */ + if (dd.de.attr & FA_LABEL) { + /* + * If volume label set, check if the current entry is + * extended entry (FA_XDE) for long file names. + */ + if ((dd.de.attr & FA_MASK) == FA_XDE) { + /* + * Read through all following extended entries + * to get the long file name. 0x40 marks the + * last entry containing part of long file name. + */ + if (dd.xde.seq & 0x40) + chk = dd.xde.chk; + else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) + continue; + x = dd.xde.seq & ~0x40; + if (x < 1 || x > 20) { + x = 0; + continue; + } + cp_xdnm(fn, &dd.xde); + } else { + /* skip only volume label entries */ continue; } - cp_xdnm(fn, &dd.xde); } else { if (xdn == 1) { x = 0; From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 04:52:30 2013 Return-Path: Delivered-To: svn-src-all@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 CBAA81D5; Wed, 18 Dec 2013 04:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7C651237; Wed, 18 Dec 2013 04:52:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI4qUo2019170; Wed, 18 Dec 2013 04:52:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI4qURt019169; Wed, 18 Dec 2013 04:52:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312180452.rBI4qURt019169@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 04:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259540 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 04:52:30 -0000 Author: marcel Date: Wed Dec 18 04:52:30 2013 New Revision: 259540 URL: http://svnweb.freebsd.org/changeset/base/259540 Log: Clear f_rabuf after freeing the memory it points to. This prevents a possible double free. Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/close.c Modified: head/lib/libstand/close.c ============================================================================== --- head/lib/libstand/close.c Wed Dec 18 04:44:38 2013 (r259539) +++ head/lib/libstand/close.c Wed Dec 18 04:52:30 2013 (r259540) @@ -75,8 +75,10 @@ close(int fd) errno = EBADF; return (-1); } - if (f->f_rabuf != NULL) + if (f->f_rabuf != NULL) { free(f->f_rabuf); + f->f_rabuf = NULL; + } if (!(f->f_flags & F_RAW) && f->f_ops) err1 = (f->f_ops->fo_close)(f); if (!(f->f_flags & F_NODEV) && f->f_dev) From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 05:20:55 2013 Return-Path: Delivered-To: svn-src-all@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 322BF8CB; Wed, 18 Dec 2013 05:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D3481445; Wed, 18 Dec 2013 05:20:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI5KsEN029781; Wed, 18 Dec 2013 05:20:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI5KsPE029776; Wed, 18 Dec 2013 05:20:54 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312180520.rBI5KsPE029776@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 05:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259541 - in stable/10/sys: amd64/conf dev/xen/netback dev/xen/netfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 05:20:55 -0000 Author: glebius Date: Wed Dec 18 05:20:53 2013 New Revision: 259541 URL: http://svnweb.freebsd.org/changeset/base/259541 Log: Merge r256868,257276-257277,257515,257913 from head. These are fixes required to make Xen buÑ‚ldable w/o INET. Sponsored by: Nginx, Inc. Modified: stable/10/sys/amd64/conf/NOTES stable/10/sys/dev/xen/netback/netback.c stable/10/sys/dev/xen/netback/netback_unit_tests.c stable/10/sys/dev/xen/netfront/netfront.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/conf/NOTES ============================================================================== --- stable/10/sys/amd64/conf/NOTES Wed Dec 18 04:52:30 2013 (r259540) +++ stable/10/sys/amd64/conf/NOTES Wed Dec 18 05:20:53 2013 (r259541) @@ -473,6 +473,12 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device hyperv # HyperV drivers + +# Xen HVM Guest Optimizations +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver + ##################################################################### # Modified: stable/10/sys/dev/xen/netback/netback.c ============================================================================== --- stable/10/sys/dev/xen/netback/netback.c Wed Dec 18 04:52:30 2013 (r259540) +++ stable/10/sys/dev/xen/netback/netback.c Wed Dec 18 05:20:53 2013 (r259541) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * from this FreeBSD domain to other domains. */ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_global.h" #include "opt_sctp.h" @@ -183,7 +184,6 @@ static int xnb_rxpkt2gnttab(const struct static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, const gnttab_copy_table gnttab, int n_entries, netif_rx_back_ring_t *ring); -static void xnb_add_mbuf_cksum(struct mbuf *mbufc); static void xnb_stop(struct xnb_softc*); static int xnb_ioctl(struct ifnet*, u_long, caddr_t); static void xnb_start_locked(struct ifnet*); @@ -194,6 +194,9 @@ static void xnb_ifinit(void*); static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +#if defined(INET) || defined(INET6) +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +#endif /*------------------------------ Data Structures -----------------------------*/ @@ -1778,7 +1781,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con } mbufc->m_pkthdr.len = total_size; +#if defined(INET) || defined(INET6) xnb_add_mbuf_cksum(mbufc); +#endif } /** @@ -2121,6 +2126,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt, return n_responses; } +#if defined(INET) || defined(INET6) /** * Add IP, TCP, and/or UDP checksums to every mbuf in a chain. The first mbuf * in the chain must start with a struct ether_header. @@ -2175,6 +2181,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc) break; } } +#endif /* INET || INET6 */ static void xnb_stop(struct xnb_softc *xnb) @@ -2191,8 +2198,8 @@ static int xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct xnb_softc *xnb = ifp->if_softc; -#ifdef INET struct ifreq *ifr = (struct ifreq*) data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr*)data; #endif int error = 0; Modified: stable/10/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- stable/10/sys/dev/xen/netback/netback_unit_tests.c Wed Dec 18 04:52:30 2013 (r259540) +++ stable/10/sys/dev/xen/netback/netback_unit_tests.c Wed Dec 18 05:20:53 2013 (r259541) @@ -104,10 +104,6 @@ struct test_fixture { typedef struct test_fixture test_fixture_t; -static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, - uint16_t ip_id, uint16_t ip_p, - uint16_t ip_off, uint16_t ip_sum); -static void xnb_fill_tcp(struct mbuf *m); static int xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags); static int xnb_unit_test_runner(test_fixture_t const tests[], int ntests, char *buffer, size_t buflen); @@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra; static testcase_t xnb_rxpkt2rsp_2short; static testcase_t xnb_rxpkt2rsp_2slots; static testcase_t xnb_rxpkt2rsp_copyerror; +static testcase_t xnb_sscanf_llu; +static testcase_t xnb_sscanf_lld; +static testcase_t xnb_sscanf_hhu; +static testcase_t xnb_sscanf_hhd; +static testcase_t xnb_sscanf_hhn; + +#if defined(INET) || defined(INET6) /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */ static testcase_t xnb_add_mbuf_cksum_arp; static testcase_t xnb_add_mbuf_cksum_tcp; static testcase_t xnb_add_mbuf_cksum_udp; static testcase_t xnb_add_mbuf_cksum_icmp; static testcase_t xnb_add_mbuf_cksum_tcp_swcksum; -static testcase_t xnb_sscanf_llu; -static testcase_t xnb_sscanf_lld; -static testcase_t xnb_sscanf_hhu; -static testcase_t xnb_sscanf_hhd; -static testcase_t xnb_sscanf_hhn; +static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, + uint16_t ip_id, uint16_t ip_p, + uint16_t ip_off, uint16_t ip_sum); +static void xnb_fill_tcp(struct mbuf *m); +#endif /* INET || INET6 */ /** Private data used by unit tests */ static struct { @@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) {setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data}, +#if defined(INET) || defined(INET6) {null_setup, xnb_add_mbuf_cksum_arp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_icmp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown}, {null_setup, xnb_add_mbuf_cksum_udp, null_teardown}, +#endif {null_setup, xnb_sscanf_hhd, null_teardown}, {null_setup, xnb_sscanf_hhu, null_teardown}, {null_setup, xnb_sscanf_lld, null_teardown}, @@ -2066,6 +2071,7 @@ xnb_rxpkt2rsp_copyerror(char *buffer, si safe_m_freem(&mbuf); } +#if defined(INET) || defined(INET6) /** * xnb_add_mbuf_cksum on an ARP request packet */ @@ -2430,6 +2436,7 @@ xnb_add_mbuf_cksum_tcp_swcksum(char *buf m_freem(mbufc); } +#endif /* INET || INET6 */ /** * sscanf on unsigned chars Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Wed Dec 18 04:52:30 2013 (r259540) +++ stable/10/sys/dev/xen/netfront/netfront.c Wed Dec 18 05:20:53 2013 (r259541) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -165,7 +166,6 @@ static int xn_configure_features(struct static void xn_watchdog(struct ifnet *); #endif -static void show_device(struct netfront_info *sc); #ifdef notyet static void netfront_closing(device_t dev); #endif @@ -644,8 +644,6 @@ setup_device(device_t dev, struct netfro goto fail; } - show_device(info); - return (0); fail: @@ -967,7 +965,7 @@ static void xn_rxeof(struct netfront_info *np) { struct ifnet *ifp; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) struct lro_ctrl *lro = &np->xn_lro; struct lro_entry *queued; #endif @@ -1064,7 +1062,7 @@ xn_rxeof(struct netfront_info *np) * Do we really need to drop the rx lock? */ XN_RX_UNLOCK(np); -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* Use LRO if possible */ if ((ifp->if_capenable & IFCAP_LRO) == 0 || lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) { @@ -1082,7 +1080,7 @@ xn_rxeof(struct netfront_info *np) np->rx.rsp_cons = i; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* * Flush any outstanding LRO work */ @@ -1969,25 +1967,6 @@ network_connect(struct netfront_info *np return (0); } -static void -show_device(struct netfront_info *sc) -{ -#ifdef DEBUG - if (sc) { - IPRINTK("\n", - sc->xn_ifno, - be_state_name[sc->xn_backend_state], - sc->xn_user_state ? "open" : "closed", - sc->xn_evtchn, - sc->xn_irq, - sc->xn_tx_if, - sc->xn_rx_if); - } else { - IPRINTK("\n"); - } -#endif -} - static void xn_query_features(struct netfront_info *np) { @@ -2024,14 +2003,14 @@ xn_configure_features(struct netfront_in int err; err = 0; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) tcp_lro_free(&np->xn_lro); #endif np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); np->xn_ifp->if_hwassist &= ~CSUM_TSO; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { err = tcp_lro_init(&np->xn_lro); if (err) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 06:24:23 2013 Return-Path: Delivered-To: svn-src-all@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 4E278134; Wed, 18 Dec 2013 06:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 200151907; Wed, 18 Dec 2013 06:24:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI6OMDC051610; Wed, 18 Dec 2013 06:24:22 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI6OMc2051603; Wed, 18 Dec 2013 06:24:22 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312180624.rBI6OMc2051603@svn.freebsd.org> From: Neel Natu Date: Wed, 18 Dec 2013 06:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259542 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 06:24:23 -0000 Author: neel Date: Wed Dec 18 06:24:21 2013 New Revision: 259542 URL: http://svnweb.freebsd.org/changeset/base/259542 Log: Use vmcs_read() and vmcs_write() in preference to vmread() and vmwrite() respectively. The vmcs_xxx() functions provide inline error checking of all accesses to the VMCS. Modified: head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx_genassym.c Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmcs.c Wed Dec 18 06:24:21 2013 (r259542) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include "vmm_host.h" -#include "vmcs.h" #include "vmx_cpufunc.h" +#include "vmcs.h" #include "ept.h" #include "vmx.h" @@ -454,19 +454,6 @@ done: return (error); } -uint64_t -vmcs_read(uint32_t encoding) -{ - int error; - uint64_t val; - - error = vmread(encoding, &val); - if (error != 0) - panic("vmcs_read(%u) error %d", encoding, error); - - return (val); -} - #ifdef DDB extern int vmxon_enabled[]; Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmcs.h Wed Dec 18 06:24:21 2013 (r259542) @@ -58,7 +58,26 @@ int vmcs_getdesc(struct vmcs *vmcs, int struct seg_desc *desc); int vmcs_setdesc(struct vmcs *vmcs, int ident, struct seg_desc *desc); -uint64_t vmcs_read(uint32_t encoding); + +static __inline uint64_t +vmcs_read(uint32_t encoding) +{ + int error; + uint64_t val; + + error = vmread(encoding, &val); + KASSERT(error == 0, ("vmcs_read(%u) error %d", encoding, error)); + return (val); +} + +static __inline void +vmcs_write(uint32_t encoding, uint64_t val) +{ + int error; + + error = vmwrite(encoding, val); + KASSERT(error == 0, ("vmcs_write(%u) error %d", encoding, error)); +} #define vmexit_instruction_length() vmcs_read(VMCS_EXIT_INSTRUCTION_LENGTH) #define vmcs_guest_rip() vmcs_read(VMCS_GUEST_RIP) Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmx.c Wed Dec 18 06:24:21 2013 (r259542) @@ -324,9 +324,8 @@ vmx_setjmp_trace(struct vmx *vmx, int vc VCPU_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", vmx_setjmp_rc2str(rc), rc); - host_rsp = host_rip = ~0; - vmread(VMCS_HOST_RIP, &host_rip); - vmread(VMCS_HOST_RSP, &host_rsp); + host_rip = vmcs_read(VMCS_HOST_RIP); + host_rsp = vmcs_read(VMCS_HOST_RSP); VCPU_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp %#lx", host_rip, host_rsp); @@ -909,10 +908,10 @@ vmx_astpending_trace(struct vmx *vmx, in #endif } -static int +static void vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu) { - int error, lastcpu; + int lastcpu; struct vmxstate *vmxstate; struct invvpid_desc invvpid_desc = { 0 }; @@ -920,24 +919,14 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i lastcpu = vmxstate->lastcpu; vmxstate->lastcpu = curcpu; - if (lastcpu == curcpu) { - error = 0; - goto done; - } + if (lastcpu == curcpu) + return; vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1); - error = vmwrite(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); - if (error != 0) - goto done; - - error = vmwrite(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); - if (error != 0) - goto done; + vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase()); + vmcs_write(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase()); + vmcs_write(VMCS_HOST_GS_BASE, vmm_get_host_gsbase()); /* * If we are using VPIDs then invalidate all mappings tagged with 'vpid' @@ -958,18 +947,6 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i invvpid_desc.vpid = vmxstate->vpid; invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); } -done: - return (error); -} - -static void -vm_exit_update_rip(struct vm_exit *vmexit) -{ - int error; - - error = vmwrite(VMCS_GUEST_RIP, vmexit->rip + vmexit->inst_length); - if (error) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); } /* @@ -980,66 +957,45 @@ CTASSERT((PROCBASED_CTLS_ONE_SETTING & P static void __inline vmx_set_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_int_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_INT_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_int_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_set_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls |= PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_set_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static void __inline vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu) { - int error; vmx->cap[vcpu].proc_ctls &= ~PROCBASED_NMI_WINDOW_EXITING; - - error = vmwrite(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); - if (error) - panic("vmx_clear_nmi_window_exiting: vmwrite error %d", error); + vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls); } static int vmx_inject_nmi(struct vmx *vmx, int vcpu) { - int error; uint64_t info, interruptibility; /* Bail out if no NMI requested */ if (!vm_nmi_pending(vmx->vm, vcpu)) return (0); - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_nmi: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & nmi_blocking_bits) goto nmiblocked; @@ -1049,10 +1005,7 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu */ info = VMCS_INTERRUPTION_INFO_NMI | VMCS_INTERRUPTION_INFO_VALID; info |= IDT_NMI; - - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_nmi: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); @@ -1074,7 +1027,7 @@ nmiblocked: static void vmx_inject_interrupts(struct vmx *vmx, int vcpu) { - int error, vector; + int vector; uint64_t info, rflags, interruptibility; const int HWINTR_BLOCKED = VMCS_INTERRUPTIBILITY_STI_BLOCKING | @@ -1087,9 +1040,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * VM entry but the actual entry into guest mode was aborted * because of a pending AST. */ - error = vmread(VMCS_ENTRY_INTR_INFO, &info); - if (error) - panic("vmx_inject_interrupts: vmread(intrinfo) %d", error); + info = vmcs_read(VMCS_ENTRY_INTR_INFO); if (info & VMCS_INTERRUPTION_INFO_VALID) return; @@ -1108,27 +1059,18 @@ vmx_inject_interrupts(struct vmx *vmx, i panic("vmx_inject_interrupts: invalid vector %d\n", vector); /* Check RFLAGS.IF and the interruptibility state of the guest */ - error = vmread(VMCS_GUEST_RFLAGS, &rflags); - if (error) - panic("vmx_inject_interrupts: vmread(rflags) %d", error); - + rflags = vmcs_read(VMCS_GUEST_RFLAGS); if ((rflags & PSL_I) == 0) goto cantinject; - error = vmread(VMCS_GUEST_INTERRUPTIBILITY, &interruptibility); - if (error) { - panic("vmx_inject_interrupts: vmread(interruptibility) %d", - error); - } + interruptibility = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (interruptibility & HWINTR_BLOCKED) goto cantinject; /* Inject the interrupt */ info = VMCS_INTERRUPTION_INFO_HW_INTR | VMCS_INTERRUPTION_INFO_VALID; info |= vector; - error = vmwrite(VMCS_ENTRY_INTR_INFO, info); - if (error) - panic("vmx_inject_interrupts: vmwrite(intrinfo) %d", error); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); /* Update the Local APIC ISR */ lapic_intr_accepted(vmx->vm, vcpu, vector); @@ -1150,7 +1092,7 @@ cantinject: static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { - int error, cr, vmcs_guest_cr, vmcs_shadow_cr; + int cr, vmcs_guest_cr, vmcs_shadow_cr; uint64_t crval, regval, ones_mask, zeros_mask; const struct vmxctx *vmxctx; @@ -1165,7 +1107,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmxctx = &vmx->ctx[vcpu]; /* - * We must use vmwrite() directly here because vmcs_setreg() will + * We must use vmcs_write() directly here because vmcs_setreg() will * call vmclear(vmcs) as a side-effect which we certainly don't want. */ switch ((exitqual >> 8) & 0xf) { @@ -1182,11 +1124,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i regval = vmxctx->guest_rbx; break; case 4: - error = vmread(VMCS_GUEST_RSP, ®val); - if (error) { - panic("vmx_emulate_cr_access: " - "error %d reading guest rsp", error); - } + regval = vmcs_read(VMCS_GUEST_RSP); break; case 5: regval = vmxctx->guest_rbp; @@ -1234,20 +1172,11 @@ vmx_emulate_cr_access(struct vmx *vmx, i vmcs_guest_cr = VMCS_GUEST_CR4; vmcs_shadow_cr = VMCS_CR4_SHADOW; } - - error = vmwrite(vmcs_shadow_cr, regval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d shadow", - error, cr); - } + vmcs_write(vmcs_shadow_cr, regval); crval = regval | ones_mask; crval &= ~zeros_mask; - error = vmwrite(vmcs_guest_cr, crval); - if (error) { - panic("vmx_emulate_cr_access: error %d writing cr%d", - error, cr); - } + vmcs_write(vmcs_guest_cr, crval); if (cr == 0 && regval & CR0_PG) { uint64_t efer, entry_ctls; @@ -1257,29 +1186,13 @@ vmx_emulate_cr_access(struct vmx *vmx, i * the "IA-32e mode guest" bit in VM-entry control must be * equal. */ - error = vmread(VMCS_GUEST_IA32_EFER, &efer); - if (error) { - panic("vmx_emulate_cr_access: error %d efer read", - error); - } + efer = vmcs_read(VMCS_GUEST_IA32_EFER); if (efer & EFER_LME) { efer |= EFER_LMA; - error = vmwrite(VMCS_GUEST_IA32_EFER, efer); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " efer write", error); - } - error = vmread(VMCS_ENTRY_CTLS, &entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls read", error); - } + vmcs_write(VMCS_GUEST_IA32_EFER, efer); + entry_ctls = vmcs_read(VMCS_ENTRY_CTLS); entry_ctls |= VM_ENTRY_GUEST_LMA; - error = vmwrite(VMCS_ENTRY_CTLS, entry_ctls); - if (error) { - panic("vmx_emulate_cr_access: error %d" - " entry ctls write", error); - } + vmcs_write(VMCS_ENTRY_CTLS, entry_ctls); } } @@ -1336,7 +1249,7 @@ vmx_exit_process(struct vmx *vmx, int vc struct vmcs *vmcs; struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; - uint64_t qual, gpa, rflags; + uint64_t qual, gpa; bool retu; handled = 0; @@ -1365,12 +1278,13 @@ vmx_exit_process(struct vmx *vmx, int vc idtvec_info = vmcs_idt_vectoring_info(); if (idtvec_info & VMCS_IDT_VEC_VALID) { idtvec_info &= ~(1 << 12); /* clear undefined bit */ - vmwrite(VMCS_ENTRY_INTR_INFO, idtvec_info); + vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { idtvec_err = vmcs_idt_vectoring_err(); - vmwrite(VMCS_ENTRY_EXCEPTION_ERROR, idtvec_err); + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, + idtvec_err); } - vmwrite(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); + vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); } default: break; @@ -1419,10 +1333,8 @@ vmx_exit_process(struct vmx *vmx, int vc break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); - if ((error = vmread(VMCS_GUEST_RFLAGS, &rflags)) != 0) - panic("vmx_exit_process: vmread(rflags) %d", error); vmexit->exitcode = VM_EXITCODE_HLT; - vmexit->u.hlt.rflags = rflags; + vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -1509,9 +1421,9 @@ vmx_exit_process(struct vmx *vmx, int vc * the one we just processed. Therefore we update the * guest rip in the VMCS and in 'vmexit'. */ - vm_exit_update_rip(vmexit); vmexit->rip += vmexit->inst_length; vmexit->inst_length = 0; + vmcs_write(VMCS_GUEST_RIP, vmexit->rip); } else { if (vmexit->exitcode == VM_EXITCODE_BOGUS) { /* @@ -1533,7 +1445,7 @@ vmx_exit_process(struct vmx *vmx, int vc static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap) { - int error, vie, rc, handled, astpending; + int vie, rc, handled, astpending; uint32_t exit_reason; struct vmx *vmx; struct vmxctx *vmxctx; @@ -1566,14 +1478,9 @@ vmx_run(void *arg, int vcpu, register_t * If the life of a virtual machine was spent entirely in the context * of a single process we could do this once in vmcs_set_defaults(). */ - if ((error = vmwrite(VMCS_HOST_CR3, rcr3())) != 0) - panic("vmx_run: error %d writing to VMCS_HOST_CR3", error); - - if ((error = vmwrite(VMCS_GUEST_RIP, rip)) != 0) - panic("vmx_run: error %d writing to VMCS_GUEST_RIP", error); - - if ((error = vmx_set_pcpu_defaults(vmx, vcpu)) != 0) - panic("vmx_run: error %d setting up pcpu defaults", error); + vmcs_write(VMCS_HOST_CR3, rcr3()); + vmcs_write(VMCS_GUEST_RIP, rip); + vmx_set_pcpu_defaults(vmx, vcpu); do { vmx_inject_interrupts(vmx, vcpu); Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Wed Dec 18 05:20:53 2013 (r259541) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Wed Dec 18 06:24:21 2013 (r259542) @@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include "vmx.h" #include "vmx_cpufunc.h" +#include "vmx.h" ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop)); ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 07:23:42 2013 Return-Path: Delivered-To: svn-src-all@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 CB4F9B4F; Wed, 18 Dec 2013 07:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D45F1EDB; Wed, 18 Dec 2013 07:23:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7Ng9I072890; Wed, 18 Dec 2013 07:23:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7Nguj072889; Wed, 18 Dec 2013 07:23:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201312180723.rBI7Nguj072889@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Dec 2013 07:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259543 - head/sys/dev/ae X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 07:23:42 -0000 Author: yongari Date: Wed Dec 18 07:23:42 2013 New Revision: 259543 URL: http://svnweb.freebsd.org/changeset/base/259543 Log: Failed m_devget(9) indicates lack of free mbuf cluster. Update if_iqdrops counter for that case since the received frame is ok. While here, simplify updating counter logic. Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Dec 18 06:24:21 2013 (r259542) +++ head/sys/dev/ae/if_ae.c Wed Dec 18 07:23:42 2013 (r259543) @@ -135,7 +135,7 @@ static void ae_mac_config(ae_softc_t *sc static int ae_intr(void *arg); static void ae_int_task(void *arg, int pending); static void ae_tx_intr(ae_softc_t *sc); -static int ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd); static void ae_rx_intr(ae_softc_t *sc); static void ae_watchdog(ae_softc_t *sc); static void ae_tick(void *arg); @@ -1884,7 +1884,7 @@ ae_tx_intr(ae_softc_t *sc) BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } -static int +static void ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) { struct ifnet *ifp; @@ -1903,12 +1903,15 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) size = le16toh(rxd->len) - ETHER_CRC_LEN; if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { if_printf(ifp, "Runt frame received."); - return (EIO); + ifp->if_ierrors++; + return; } m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL); - if (m == NULL) - return (ENOBUFS); + if (m == NULL) { + ifp->if_iqdrops++; + return; + } if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (flags & AE_RXD_HAS_VLAN) != 0) { @@ -1916,14 +1919,13 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) m->m_flags |= M_VLANTAG; } + ifp->if_ipackets++; /* * Pass it through. */ AE_UNLOCK(sc); (*ifp->if_input)(ifp, m); AE_LOCK(sc); - - return (0); } static void @@ -1932,7 +1934,7 @@ ae_rx_intr(ae_softc_t *sc) ae_rxd_t *rxd; struct ifnet *ifp; uint16_t flags; - int count, error; + int count; KASSERT(sc != NULL, ("[ae, %d]: sc is NULL!", __LINE__)); @@ -1960,17 +1962,10 @@ ae_rx_intr(ae_softc_t *sc) */ sc->rxd_cur = (sc->rxd_cur + 1) % AE_RXD_COUNT_DEFAULT; - if ((flags & AE_RXD_SUCCESS) == 0) { - ifp->if_ierrors++; - continue; - } - error = ae_rxeof(sc, rxd); - if (error != 0) { + if ((flags & AE_RXD_SUCCESS) != 0) + ae_rxeof(sc, rxd); + else ifp->if_ierrors++; - continue; - } else { - ifp->if_ipackets++; - } } if (count > 0) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 07:34:58 2013 Return-Path: Delivered-To: svn-src-all@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 3FAC11E1; Wed, 18 Dec 2013 07:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9191FC7; Wed, 18 Dec 2013 07:34:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7YwcQ076594; Wed, 18 Dec 2013 07:34:58 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7YvQY076592; Wed, 18 Dec 2013 07:34:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180734.rBI7YvQY076592@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 07:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259544 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 07:34:58 -0000 Author: kevlo Date: Wed Dec 18 07:34:57 2013 New Revision: 259544 URL: http://svnweb.freebsd.org/changeset/base/259544 Log: Add support to IQ calibration. Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:23:42 2013 (r259543) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:34:57 2013 (r259544) @@ -345,6 +345,7 @@ static int run_write(struct run_softc *, static int run_write_region_1(struct run_softc *, uint16_t, const uint8_t *, int); static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, int); +static int run_efuse_read(struct run_softc *, uint16_t, uint16_t *, int); static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *); static int run_rt2870_rf_write(struct run_softc *, uint32_t); @@ -391,6 +392,7 @@ static int run_raw_xmit(struct ieee80211 const struct ieee80211_bpf_params *); static void run_start(struct ifnet *); static int run_ioctl(struct ifnet *, u_long, caddr_t); +static void run_iq_calib(struct run_softc *, u_int); static void run_set_agc(struct run_softc *, uint8_t); static void run_select_chan_group(struct run_softc *, int); static void run_set_rx_antenna(struct run_softc *, int); @@ -436,6 +438,28 @@ static void run_init_locked(struct run_s static void run_stop(void *); static void run_delay(struct run_softc *, u_int); +static const struct rt2860_rate { + uint8_t rate; + uint8_t mcs; + enum ieee80211_phytype phy; + uint8_t ctl_ridx; + uint16_t sp_ack_dur; + uint16_t lp_ack_dur; +} rt2860_rates[] = { + { 2, 0, IEEE80211_T_DS, 0, 314, 314 }, + { 4, 1, IEEE80211_T_DS, 1, 258, 162 }, + { 11, 2, IEEE80211_T_DS, 2, 223, 127 }, + { 22, 3, IEEE80211_T_DS, 3, 213, 117 }, + { 12, 0, IEEE80211_T_OFDM, 4, 60, 60 }, + { 18, 1, IEEE80211_T_OFDM, 4, 52, 52 }, + { 24, 2, IEEE80211_T_OFDM, 6, 48, 48 }, + { 36, 3, IEEE80211_T_OFDM, 6, 44, 44 }, + { 48, 4, IEEE80211_T_OFDM, 8, 44, 44 }, + { 72, 5, IEEE80211_T_OFDM, 8, 40, 40 }, + { 96, 6, IEEE80211_T_OFDM, 8, 40, 40 }, + { 108, 7, IEEE80211_T_OFDM, 8, 40, 40 } +}; + static const struct { uint16_t reg; uint32_t val; @@ -1249,9 +1273,8 @@ run_set_region_4(struct run_softc *sc, u return (error); } -/* Read 16-bit from eFUSE ROM (RT3070 only.) */ static int -run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) +run_efuse_read(struct run_softc *sc, uint16_t addr, uint16_t *val, int count) { uint32_t tmp; uint16_t reg; @@ -1260,7 +1283,8 @@ run_efuse_read_2(struct run_softc *sc, u if ((error = run_read(sc, RT3070_EFUSE_CTRL, &tmp)) != 0) return (error); - addr *= 2; + if (count == 2) + addr *= 2; /*- * Read one 16-byte block into registers EFUSE_DATA[0-3]: * DATA0: F E D C @@ -1290,10 +1314,23 @@ run_efuse_read_2(struct run_softc *sc, u if ((error = run_read(sc, reg, &tmp)) != 0) return (error); - *val = (addr & 2) ? tmp >> 16 : tmp & 0xffff; + if (count == 2) + *val = (addr & 2) ? tmp >> 16 : tmp & 0xffff; + else { + tmp >>= (8 *(addr & 0x3)); + memmove(val, &tmp, sizeof(*val)); + } return (0); } + +/* Read 16-bit from eFUSE ROM (RT3070 only.) */ +static int +run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) +{ + return (run_efuse_read(sc, addr, val, 2)); +} + static int run_eeprom_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) { @@ -3600,6 +3637,107 @@ run_ioctl(struct ifnet *ifp, u_long cmd, } static void +run_iq_calib(struct run_softc *sc, u_int chan) +{ + uint16_t val; + + /* Tx0 IQ gain. */ + run_bbp_write(sc, 158, 0x2c); + if (chan <= 14) + run_efuse_read(sc, RT5390_EEPROM_IQ_GAIN_CAL_TX0_2GHZ, &val, 1); + else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx0 IQ phase. */ + run_bbp_write(sc, 158, 0x2d); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_PHASE_CAL_TX0_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx1 IQ gain. */ + run_bbp_write(sc, 158, 0x4a); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_GAIN_CAL_TX1_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* Tx1 IQ phase. */ + run_bbp_write(sc, 158, 0x4b); + if (chan <= 14) { + run_efuse_read(sc, RT5390_EEPROM_IQ_PHASE_CAL_TX1_2GHZ, + &val, 1); + } else if (chan <= 64) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5GHZ, + &val, 1); + } else if (chan <= 138) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5GHZ, + &val, 1); + } else if (chan <= 165) { + run_efuse_read(sc, + RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5GHZ, + &val, 1); + } else + val = 0; + run_bbp_write(sc, 159, val & 0xff); + + /* RF IQ compensation control. */ + run_bbp_write(sc, 158, 0x04); + run_efuse_read(sc, RT5390_EEPROM_RF_IQ_COMPENSATION_CTL, + &val, 1); + run_bbp_write(sc, 159, val & 0xff); + + /* RF IQ imbalance compensation control. */ + run_bbp_write(sc, 158, 0x03); + run_efuse_read(sc, + RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL, &val, 1); + run_bbp_write(sc, 159, val & 0xff); +} + +static void run_set_agc(struct run_softc *sc, uint8_t agc) { uint8_t bbp; @@ -4333,6 +4471,10 @@ run_set_chan(struct run_softc *sc, struc run_delay(sc, 10); + /* Perform IQ calibrations. */ + if (sc->mac_ver >= 0x5392) + run_iq_calib(sc, chan); + return (0); } Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:23:42 2013 (r259543) +++ head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:34:57 2013 (r259544) @@ -905,31 +905,32 @@ struct rt2860_rxwi { #define RT2860_EEPROM_BBP_BASE 0x78 #define RT3071_EEPROM_RF_BASE 0x82 +/* + * EEPROM IQ calibration. + */ +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_2GHZ 0x130 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_2GHZ 0x131 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_2GHZ 0x133 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_2GHZ 0x134 +#define RT5390_EEPROM_RF_IQ_COMPENSATION_CTL 0x13c +#define RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL 0x13d +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH36_TO_CH64_5GHZ 0x144 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH36_TO_CH64_5GHZ 0x145 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH100_TO_CH138_5GHZ 0x146 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH100_TO_CH138_5GHZ 0x147 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX0_CH140_TO_CH165_5GHZ 0x148 +#define RT5390_EEPROM_IQ_PHASE_CAL_TX0_CH140_TO_CH165_5GHZ 0x149 +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH36_TO_CH64_5GHZ 0x14a +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH36_TO_CH64_5GHZ 0x14b +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH100_TO_CH138_5GHZ 0x14c +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH100_TO_CH138_5GHZ 0x14d +#define RT5390_EEPROM_IQ_GAIN_CAL_TX1_CH140_TO_CH165_5GHZ 0x14e +#define RT5390_EEPROM_IQ_PHASE_CAL_TX1_CH140_TO_CH165_5GHZ 0x14f + #define RT2860_RIDX_CCK1 0 #define RT2860_RIDX_CCK11 3 #define RT2860_RIDX_OFDM6 4 #define RT2860_RIDX_MAX 12 -static const struct rt2860_rate { - uint8_t rate; - uint8_t mcs; - enum ieee80211_phytype phy; - uint8_t ctl_ridx; - uint16_t sp_ack_dur; - uint16_t lp_ack_dur; -} rt2860_rates[] = { - { 2, 0, IEEE80211_T_DS, 0, 314, 314 }, - { 4, 1, IEEE80211_T_DS, 1, 258, 162 }, - { 11, 2, IEEE80211_T_DS, 2, 223, 127 }, - { 22, 3, IEEE80211_T_DS, 3, 213, 117 }, - { 12, 0, IEEE80211_T_OFDM, 4, 60, 60 }, - { 18, 1, IEEE80211_T_OFDM, 4, 52, 52 }, - { 24, 2, IEEE80211_T_OFDM, 6, 48, 48 }, - { 36, 3, IEEE80211_T_OFDM, 6, 44, 44 }, - { 48, 4, IEEE80211_T_OFDM, 8, 44, 44 }, - { 72, 5, IEEE80211_T_OFDM, 8, 40, 40 }, - { 96, 6, IEEE80211_T_OFDM, 8, 40, 40 }, - { 108, 7, IEEE80211_T_OFDM, 8, 40, 40 } -}; /* * EEPROM access macro. From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 07:47:50 2013 Return-Path: Delivered-To: svn-src-all@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 D43A4916; Wed, 18 Dec 2013 07:47:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C03F010D2; Wed, 18 Dec 2013 07:47:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI7loZt080430; Wed, 18 Dec 2013 07:47:50 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI7loWH080429; Wed, 18 Dec 2013 07:47:50 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180747.rBI7loWH080429@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 07:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259545 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 07:47:50 -0000 Author: kevlo Date: Wed Dec 18 07:47:50 2013 New Revision: 259545 URL: http://svnweb.freebsd.org/changeset/base/259545 Log: Fix typo in comment. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:34:57 2013 (r259544) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:47:50 2013 (r259545) @@ -4471,7 +4471,7 @@ run_set_chan(struct run_softc *sc, struc run_delay(sc, 10); - /* Perform IQ calibrations. */ + /* Perform IQ calibration. */ if (sc->mac_ver >= 0x5392) run_iq_calib(sc, chan); From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 08:39:13 2013 Return-Path: Delivered-To: svn-src-all@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 5EF6D678; Wed, 18 Dec 2013 08:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4634B15CD; Wed, 18 Dec 2013 08:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI8dDhW098211; Wed, 18 Dec 2013 08:39:13 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI8dCT3098208; Wed, 18 Dec 2013 08:39:12 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180839.rBI8dCT3098208@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 08:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259546 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 08:39:13 -0000 Author: kevlo Date: Wed Dec 18 08:39:12 2013 New Revision: 259546 URL: http://svnweb.freebsd.org/changeset/base/259546 Log: Fix style: add tab after #define. Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 07:47:50 2013 (r259545) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:39:12 2013 (r259546) @@ -70,14 +70,14 @@ __FBSDID("$FreeBSD$"); #include #include "usbdevs.h" -#define USB_DEBUG_VAR run_debug +#define USB_DEBUG_VAR run_debug #include #include #include #ifdef USB_DEBUG -#define RUN_DEBUG +#define RUN_DEBUG #endif #ifdef RUN_DEBUG @@ -87,17 +87,17 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, "run debug level"); #endif -#define IEEE80211_HAS_ADDR4(wh) \ +#define IEEE80211_HAS_ADDR4(wh) \ (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) /* * Because of LOR in run_key_delete(), use atomic instead. * '& RUN_CMDQ_MASQ' is to loop cmdq[]. */ -#define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) +#define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) static const STRUCT_USB_HOST_ID run_devs[] = { -#define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } +#define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), RUN_DEV(ABOCOM, RT3070), @@ -4772,8 +4772,8 @@ run_enable_tsf_sync(struct run_softc *sc static void run_enable_mrr(struct run_softc *sc) { -#define CCK(mcs) (mcs) -#define OFDM(mcs) (1 << 3 | (mcs)) +#define CCK(mcs) (mcs) +#define OFDM(mcs) (1 << 3 | (mcs)) run_write(sc, RT2860_LG_FBK_CFG0, OFDM(6) << 28 | /* 54->48 */ OFDM(5) << 24 | /* 48->36 */ Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 07:47:50 2013 (r259545) +++ head/sys/dev/usb/wlan/if_runreg.h Wed Dec 18 08:39:12 2013 (r259546) @@ -22,689 +22,687 @@ #ifndef _IF_RUNREG_H_ #define _IF_RUNREG_H_ -#define RT2860_CONFIG_NO 1 -#define RT2860_IFACE_INDEX 0 +#define RT2860_CONFIG_NO 1 +#define RT2860_IFACE_INDEX 0 -#define RT3070_OPT_14 0x0114 +#define RT3070_OPT_14 0x0114 /* SCH/DMA registers */ -#define RT2860_INT_STATUS 0x0200 -#define RT2860_INT_MASK 0x0204 -#define RT2860_WPDMA_GLO_CFG 0x0208 -#define RT2860_WPDMA_RST_IDX 0x020c -#define RT2860_DELAY_INT_CFG 0x0210 -#define RT2860_WMM_AIFSN_CFG 0x0214 -#define RT2860_WMM_CWMIN_CFG 0x0218 -#define RT2860_WMM_CWMAX_CFG 0x021c -#define RT2860_WMM_TXOP0_CFG 0x0220 -#define RT2860_WMM_TXOP1_CFG 0x0224 -#define RT2860_GPIO_CTRL 0x0228 -#define RT2860_MCU_CMD_REG 0x022c -#define RT2860_TX_BASE_PTR(qid) (0x0230 + (qid) * 16) -#define RT2860_TX_MAX_CNT(qid) (0x0234 + (qid) * 16) -#define RT2860_TX_CTX_IDX(qid) (0x0238 + (qid) * 16) -#define RT2860_TX_DTX_IDX(qid) (0x023c + (qid) * 16) -#define RT2860_RX_BASE_PTR 0x0290 -#define RT2860_RX_MAX_CNT 0x0294 -#define RT2860_RX_CALC_IDX 0x0298 -#define RT2860_FS_DRX_IDX 0x029c -#define RT2860_USB_DMA_CFG 0x02a0 /* RT2870 only */ -#define RT2860_US_CYC_CNT 0x02a4 +#define RT2860_INT_STATUS 0x0200 +#define RT2860_INT_MASK 0x0204 +#define RT2860_WPDMA_GLO_CFG 0x0208 +#define RT2860_WPDMA_RST_IDX 0x020c +#define RT2860_DELAY_INT_CFG 0x0210 +#define RT2860_WMM_AIFSN_CFG 0x0214 +#define RT2860_WMM_CWMIN_CFG 0x0218 +#define RT2860_WMM_CWMAX_CFG 0x021c +#define RT2860_WMM_TXOP0_CFG 0x0220 +#define RT2860_WMM_TXOP1_CFG 0x0224 +#define RT2860_GPIO_CTRL 0x0228 +#define RT2860_MCU_CMD_REG 0x022c +#define RT2860_TX_BASE_PTR(qid) (0x0230 + (qid) * 16) +#define RT2860_TX_MAX_CNT(qid) (0x0234 + (qid) * 16) +#define RT2860_TX_CTX_IDX(qid) (0x0238 + (qid) * 16) +#define RT2860_TX_DTX_IDX(qid) (0x023c + (qid) * 16) +#define RT2860_RX_BASE_PTR 0x0290 +#define RT2860_RX_MAX_CNT 0x0294 +#define RT2860_RX_CALC_IDX 0x0298 +#define RT2860_FS_DRX_IDX 0x029c +#define RT2860_USB_DMA_CFG 0x02a0 /* RT2870 only */ +#define RT2860_US_CYC_CNT 0x02a4 /* PBF registers */ -#define RT2860_SYS_CTRL 0x0400 -#define RT2860_HOST_CMD 0x0404 -#define RT2860_PBF_CFG 0x0408 -#define RT2860_MAX_PCNT 0x040c -#define RT2860_BUF_CTRL 0x0410 -#define RT2860_MCU_INT_STA 0x0414 -#define RT2860_MCU_INT_ENA 0x0418 -#define RT2860_TXQ_IO(qid) (0x041c + (qid) * 4) -#define RT2860_RX0Q_IO 0x0424 -#define RT2860_BCN_OFFSET0 0x042c -#define RT2860_BCN_OFFSET1 0x0430 -#define RT2860_TXRXQ_STA 0x0434 -#define RT2860_TXRXQ_PCNT 0x0438 -#define RT2860_PBF_DBG 0x043c -#define RT2860_CAP_CTRL 0x0440 +#define RT2860_SYS_CTRL 0x0400 +#define RT2860_HOST_CMD 0x0404 +#define RT2860_PBF_CFG 0x0408 +#define RT2860_MAX_PCNT 0x040c +#define RT2860_BUF_CTRL 0x0410 +#define RT2860_MCU_INT_STA 0x0414 +#define RT2860_MCU_INT_ENA 0x0418 +#define RT2860_TXQ_IO(qid) (0x041c + (qid) * 4) +#define RT2860_RX0Q_IO 0x0424 +#define RT2860_BCN_OFFSET0 0x042c +#define RT2860_BCN_OFFSET1 0x0430 +#define RT2860_TXRXQ_STA 0x0434 +#define RT2860_TXRXQ_PCNT 0x0438 +#define RT2860_PBF_DBG 0x043c +#define RT2860_CAP_CTRL 0x0440 /* RT3070 registers */ -#define RT3070_RF_CSR_CFG 0x0500 -#define RT3070_EFUSE_CTRL 0x0580 -#define RT3070_EFUSE_DATA0 0x0590 -#define RT3070_EFUSE_DATA1 0x0594 -#define RT3070_EFUSE_DATA2 0x0598 -#define RT3070_EFUSE_DATA3 0x059c -#define RT3070_LDO_CFG0 0x05d4 -#define RT3070_GPIO_SWITCH 0x05dc +#define RT3070_RF_CSR_CFG 0x0500 +#define RT3070_EFUSE_CTRL 0x0580 +#define RT3070_EFUSE_DATA0 0x0590 +#define RT3070_EFUSE_DATA1 0x0594 +#define RT3070_EFUSE_DATA2 0x0598 +#define RT3070_EFUSE_DATA3 0x059c +#define RT3070_LDO_CFG0 0x05d4 +#define RT3070_GPIO_SWITCH 0x05dc /* RT5592 registers */ -#define RT5592_DEBUG_INDEX 0x05e8 +#define RT5592_DEBUG_INDEX 0x05e8 /* MAC registers */ -#define RT2860_ASIC_VER_ID 0x1000 -#define RT2860_MAC_SYS_CTRL 0x1004 -#define RT2860_MAC_ADDR_DW0 0x1008 -#define RT2860_MAC_ADDR_DW1 0x100c -#define RT2860_MAC_BSSID_DW0 0x1010 -#define RT2860_MAC_BSSID_DW1 0x1014 -#define RT2860_MAX_LEN_CFG 0x1018 -#define RT2860_BBP_CSR_CFG 0x101c -#define RT2860_RF_CSR_CFG0 0x1020 -#define RT2860_RF_CSR_CFG1 0x1024 -#define RT2860_RF_CSR_CFG2 0x1028 -#define RT2860_LED_CFG 0x102c +#define RT2860_ASIC_VER_ID 0x1000 +#define RT2860_MAC_SYS_CTRL 0x1004 +#define RT2860_MAC_ADDR_DW0 0x1008 +#define RT2860_MAC_ADDR_DW1 0x100c +#define RT2860_MAC_BSSID_DW0 0x1010 +#define RT2860_MAC_BSSID_DW1 0x1014 +#define RT2860_MAX_LEN_CFG 0x1018 +#define RT2860_BBP_CSR_CFG 0x101c +#define RT2860_RF_CSR_CFG0 0x1020 +#define RT2860_RF_CSR_CFG1 0x1024 +#define RT2860_RF_CSR_CFG2 0x1028 +#define RT2860_LED_CFG 0x102c /* undocumented registers */ -#define RT2860_DEBUG 0x10f4 +#define RT2860_DEBUG 0x10f4 /* MAC Timing control registers */ -#define RT2860_XIFS_TIME_CFG 0x1100 -#define RT2860_BKOFF_SLOT_CFG 0x1104 -#define RT2860_NAV_TIME_CFG 0x1108 -#define RT2860_CH_TIME_CFG 0x110c -#define RT2860_PBF_LIFE_TIMER 0x1110 -#define RT2860_BCN_TIME_CFG 0x1114 -#define RT2860_TBTT_SYNC_CFG 0x1118 -#define RT2860_TSF_TIMER_DW0 0x111c -#define RT2860_TSF_TIMER_DW1 0x1120 -#define RT2860_TBTT_TIMER 0x1124 -#define RT2860_INT_TIMER_CFG 0x1128 -#define RT2860_INT_TIMER_EN 0x112c -#define RT2860_CH_IDLE_TIME 0x1130 +#define RT2860_XIFS_TIME_CFG 0x1100 +#define RT2860_BKOFF_SLOT_CFG 0x1104 +#define RT2860_NAV_TIME_CFG 0x1108 +#define RT2860_CH_TIME_CFG 0x110c +#define RT2860_PBF_LIFE_TIMER 0x1110 +#define RT2860_BCN_TIME_CFG 0x1114 +#define RT2860_TBTT_SYNC_CFG 0x1118 +#define RT2860_TSF_TIMER_DW0 0x111c +#define RT2860_TSF_TIMER_DW1 0x1120 +#define RT2860_TBTT_TIMER 0x1124 +#define RT2860_INT_TIMER_CFG 0x1128 +#define RT2860_INT_TIMER_EN 0x112c +#define RT2860_CH_IDLE_TIME 0x1130 /* MAC Power Save configuration registers */ -#define RT2860_MAC_STATUS_REG 0x1200 -#define RT2860_PWR_PIN_CFG 0x1204 -#define RT2860_AUTO_WAKEUP_CFG 0x1208 +#define RT2860_MAC_STATUS_REG 0x1200 +#define RT2860_PWR_PIN_CFG 0x1204 +#define RT2860_AUTO_WAKEUP_CFG 0x1208 /* MAC TX configuration registers */ -#define RT2860_EDCA_AC_CFG(aci) (0x1300 + (aci) * 4) -#define RT2860_EDCA_TID_AC_MAP 0x1310 -#define RT2860_TX_PWR_CFG(ridx) (0x1314 + (ridx) * 4) -#define RT2860_TX_PIN_CFG 0x1328 -#define RT2860_TX_BAND_CFG 0x132c -#define RT2860_TX_SW_CFG0 0x1330 -#define RT2860_TX_SW_CFG1 0x1334 -#define RT2860_TX_SW_CFG2 0x1338 -#define RT2860_TXOP_THRES_CFG 0x133c -#define RT2860_TXOP_CTRL_CFG 0x1340 -#define RT2860_TX_RTS_CFG 0x1344 -#define RT2860_TX_TIMEOUT_CFG 0x1348 -#define RT2860_TX_RTY_CFG 0x134c -#define RT2860_TX_LINK_CFG 0x1350 -#define RT2860_HT_FBK_CFG0 0x1354 -#define RT2860_HT_FBK_CFG1 0x1358 -#define RT2860_LG_FBK_CFG0 0x135c -#define RT2860_LG_FBK_CFG1 0x1360 -#define RT2860_CCK_PROT_CFG 0x1364 -#define RT2860_OFDM_PROT_CFG 0x1368 -#define RT2860_MM20_PROT_CFG 0x136c -#define RT2860_MM40_PROT_CFG 0x1370 -#define RT2860_GF20_PROT_CFG 0x1374 -#define RT2860_GF40_PROT_CFG 0x1378 -#define RT2860_EXP_CTS_TIME 0x137c -#define RT2860_EXP_ACK_TIME 0x1380 +#define RT2860_EDCA_AC_CFG(aci) (0x1300 + (aci) * 4) +#define RT2860_EDCA_TID_AC_MAP 0x1310 +#define RT2860_TX_PWR_CFG(ridx) (0x1314 + (ridx) * 4) +#define RT2860_TX_PIN_CFG 0x1328 +#define RT2860_TX_BAND_CFG 0x132c +#define RT2860_TX_SW_CFG0 0x1330 +#define RT2860_TX_SW_CFG1 0x1334 +#define RT2860_TX_SW_CFG2 0x1338 +#define RT2860_TXOP_THRES_CFG 0x133c +#define RT2860_TXOP_CTRL_CFG 0x1340 +#define RT2860_TX_RTS_CFG 0x1344 +#define RT2860_TX_TIMEOUT_CFG 0x1348 +#define RT2860_TX_RTY_CFG 0x134c +#define RT2860_TX_LINK_CFG 0x1350 +#define RT2860_HT_FBK_CFG0 0x1354 +#define RT2860_HT_FBK_CFG1 0x1358 +#define RT2860_LG_FBK_CFG0 0x135c +#define RT2860_LG_FBK_CFG1 0x1360 +#define RT2860_CCK_PROT_CFG 0x1364 +#define RT2860_OFDM_PROT_CFG 0x1368 +#define RT2860_MM20_PROT_CFG 0x136c +#define RT2860_MM40_PROT_CFG 0x1370 +#define RT2860_GF20_PROT_CFG 0x1374 +#define RT2860_GF40_PROT_CFG 0x1378 +#define RT2860_EXP_CTS_TIME 0x137c +#define RT2860_EXP_ACK_TIME 0x1380 /* MAC RX configuration registers */ -#define RT2860_RX_FILTR_CFG 0x1400 -#define RT2860_AUTO_RSP_CFG 0x1404 -#define RT2860_LEGACY_BASIC_RATE 0x1408 -#define RT2860_HT_BASIC_RATE 0x140c -#define RT2860_HT_CTRL_CFG 0x1410 -#define RT2860_SIFS_COST_CFG 0x1414 -#define RT2860_RX_PARSER_CFG 0x1418 +#define RT2860_RX_FILTR_CFG 0x1400 +#define RT2860_AUTO_RSP_CFG 0x1404 +#define RT2860_LEGACY_BASIC_RATE 0x1408 +#define RT2860_HT_BASIC_RATE 0x140c +#define RT2860_HT_CTRL_CFG 0x1410 +#define RT2860_SIFS_COST_CFG 0x1414 +#define RT2860_RX_PARSER_CFG 0x1418 /* MAC Security configuration registers */ -#define RT2860_TX_SEC_CNT0 0x1500 -#define RT2860_RX_SEC_CNT0 0x1504 -#define RT2860_CCMP_FC_MUTE 0x1508 +#define RT2860_TX_SEC_CNT0 0x1500 +#define RT2860_RX_SEC_CNT0 0x1504 +#define RT2860_CCMP_FC_MUTE 0x1508 /* MAC HCCA/PSMP configuration registers */ -#define RT2860_TXOP_HLDR_ADDR0 0x1600 -#define RT2860_TXOP_HLDR_ADDR1 0x1604 -#define RT2860_TXOP_HLDR_ET 0x1608 -#define RT2860_QOS_CFPOLL_RA_DW0 0x160c -#define RT2860_QOS_CFPOLL_A1_DW1 0x1610 -#define RT2860_QOS_CFPOLL_QC 0x1614 +#define RT2860_TXOP_HLDR_ADDR0 0x1600 +#define RT2860_TXOP_HLDR_ADDR1 0x1604 +#define RT2860_TXOP_HLDR_ET 0x1608 +#define RT2860_QOS_CFPOLL_RA_DW0 0x160c +#define RT2860_QOS_CFPOLL_A1_DW1 0x1610 +#define RT2860_QOS_CFPOLL_QC 0x1614 /* MAC Statistics Counters */ -#define RT2860_RX_STA_CNT0 0x1700 -#define RT2860_RX_STA_CNT1 0x1704 -#define RT2860_RX_STA_CNT2 0x1708 -#define RT2860_TX_STA_CNT0 0x170c -#define RT2860_TX_STA_CNT1 0x1710 -#define RT2860_TX_STA_CNT2 0x1714 -#define RT2860_TX_STAT_FIFO 0x1718 +#define RT2860_RX_STA_CNT0 0x1700 +#define RT2860_RX_STA_CNT1 0x1704 +#define RT2860_RX_STA_CNT2 0x1708 +#define RT2860_TX_STA_CNT0 0x170c +#define RT2860_TX_STA_CNT1 0x1710 +#define RT2860_TX_STA_CNT2 0x1714 +#define RT2860_TX_STAT_FIFO 0x1718 /* RX WCID search table */ -#define RT2860_WCID_ENTRY(wcid) (0x1800 + (wcid) * 8) +#define RT2860_WCID_ENTRY(wcid) (0x1800 + (wcid) * 8) -#define RT2860_FW_BASE 0x2000 -#define RT2870_FW_BASE 0x3000 +#define RT2860_FW_BASE 0x2000 +#define RT2870_FW_BASE 0x3000 /* Pair-wise key table */ -#define RT2860_PKEY(wcid) (0x4000 + (wcid) * 32) +#define RT2860_PKEY(wcid) (0x4000 + (wcid) * 32) /* IV/EIV table */ -#define RT2860_IVEIV(wcid) (0x6000 + (wcid) * 8) +#define RT2860_IVEIV(wcid) (0x6000 + (wcid) * 8) /* WCID attribute table */ -#define RT2860_WCID_ATTR(wcid) (0x6800 + (wcid) * 4) +#define RT2860_WCID_ATTR(wcid) (0x6800 + (wcid) * 4) /* Shared Key Table */ -#define RT2860_SKEY(vap, kidx) (0x6c00 + (vap) * 128 + (kidx) * 32) +#define RT2860_SKEY(vap, kidx) (0x6c00 + (vap) * 128 + (kidx) * 32) /* Shared Key Mode */ -#define RT2860_SKEY_MODE_0_7 0x7000 -#define RT2860_SKEY_MODE_8_15 0x7004 -#define RT2860_SKEY_MODE_16_23 0x7008 -#define RT2860_SKEY_MODE_24_31 0x700c +#define RT2860_SKEY_MODE_0_7 0x7000 +#define RT2860_SKEY_MODE_8_15 0x7004 +#define RT2860_SKEY_MODE_16_23 0x7008 +#define RT2860_SKEY_MODE_24_31 0x700c /* Shared Memory between MCU and host */ -#define RT2860_H2M_MAILBOX 0x7010 -#define RT2860_H2M_MAILBOX_CID 0x7014 -#define RT2860_H2M_MAILBOX_STATUS 0x701c -#define RT2860_H2M_INTSRC 0x7024 -#define RT2860_H2M_BBPAGENT 0x7028 -#define RT2860_BCN_BASE(vap) (0x7800 + (vap) * 512) +#define RT2860_H2M_MAILBOX 0x7010 +#define RT2860_H2M_MAILBOX_CID 0x7014 +#define RT2860_H2M_MAILBOX_STATUS 0x701c +#define RT2860_H2M_INTSRC 0x7024 +#define RT2860_H2M_BBPAGENT 0x7028 +#define RT2860_BCN_BASE(vap) (0x7800 + (vap) * 512) /* possible flags for register RT2860_PCI_EECTRL */ -#define RT2860_C (1 << 0) -#define RT2860_S (1 << 1) -#define RT2860_D (1 << 2) -#define RT2860_SHIFT_D 2 -#define RT2860_Q (1 << 3) -#define RT2860_SHIFT_Q 3 +#define RT2860_C (1 << 0) +#define RT2860_S (1 << 1) +#define RT2860_D (1 << 2) +#define RT2860_SHIFT_D 2 +#define RT2860_Q (1 << 3) +#define RT2860_SHIFT_Q 3 /* possible flags for registers INT_STATUS/INT_MASK */ -#define RT2860_TX_COHERENT (1 << 17) -#define RT2860_RX_COHERENT (1 << 16) -#define RT2860_MAC_INT_4 (1 << 15) -#define RT2860_MAC_INT_3 (1 << 14) -#define RT2860_MAC_INT_2 (1 << 13) -#define RT2860_MAC_INT_1 (1 << 12) -#define RT2860_MAC_INT_0 (1 << 11) -#define RT2860_TX_RX_COHERENT (1 << 10) -#define RT2860_MCU_CMD_INT (1 << 9) -#define RT2860_TX_DONE_INT5 (1 << 8) -#define RT2860_TX_DONE_INT4 (1 << 7) -#define RT2860_TX_DONE_INT3 (1 << 6) -#define RT2860_TX_DONE_INT2 (1 << 5) -#define RT2860_TX_DONE_INT1 (1 << 4) -#define RT2860_TX_DONE_INT0 (1 << 3) -#define RT2860_RX_DONE_INT (1 << 2) -#define RT2860_TX_DLY_INT (1 << 1) -#define RT2860_RX_DLY_INT (1 << 0) +#define RT2860_TX_COHERENT (1 << 17) +#define RT2860_RX_COHERENT (1 << 16) +#define RT2860_MAC_INT_4 (1 << 15) +#define RT2860_MAC_INT_3 (1 << 14) +#define RT2860_MAC_INT_2 (1 << 13) +#define RT2860_MAC_INT_1 (1 << 12) +#define RT2860_MAC_INT_0 (1 << 11) +#define RT2860_TX_RX_COHERENT (1 << 10) +#define RT2860_MCU_CMD_INT (1 << 9) +#define RT2860_TX_DONE_INT5 (1 << 8) +#define RT2860_TX_DONE_INT4 (1 << 7) +#define RT2860_TX_DONE_INT3 (1 << 6) +#define RT2860_TX_DONE_INT2 (1 << 5) +#define RT2860_TX_DONE_INT1 (1 << 4) +#define RT2860_TX_DONE_INT0 (1 << 3) +#define RT2860_RX_DONE_INT (1 << 2) +#define RT2860_TX_DLY_INT (1 << 1) +#define RT2860_RX_DLY_INT (1 << 0) /* possible flags for register WPDMA_GLO_CFG */ -#define RT2860_HDR_SEG_LEN_SHIFT 8 -#define RT2860_BIG_ENDIAN (1 << 7) -#define RT2860_TX_WB_DDONE (1 << 6) -#define RT2860_WPDMA_BT_SIZE_SHIFT 4 -#define RT2860_WPDMA_BT_SIZE16 0 -#define RT2860_WPDMA_BT_SIZE32 1 -#define RT2860_WPDMA_BT_SIZE64 2 -#define RT2860_WPDMA_BT_SIZE128 3 -#define RT2860_RX_DMA_BUSY (1 << 3) -#define RT2860_RX_DMA_EN (1 << 2) -#define RT2860_TX_DMA_BUSY (1 << 1) -#define RT2860_TX_DMA_EN (1 << 0) +#define RT2860_HDR_SEG_LEN_SHIFT 8 +#define RT2860_BIG_ENDIAN (1 << 7) +#define RT2860_TX_WB_DDONE (1 << 6) +#define RT2860_WPDMA_BT_SIZE_SHIFT 4 +#define RT2860_WPDMA_BT_SIZE16 0 +#define RT2860_WPDMA_BT_SIZE32 1 +#define RT2860_WPDMA_BT_SIZE64 2 +#define RT2860_WPDMA_BT_SIZE128 3 +#define RT2860_RX_DMA_BUSY (1 << 3) +#define RT2860_RX_DMA_EN (1 << 2) +#define RT2860_TX_DMA_BUSY (1 << 1) +#define RT2860_TX_DMA_EN (1 << 0) /* possible flags for register DELAY_INT_CFG */ -#define RT2860_TXDLY_INT_EN (1U << 31) -#define RT2860_TXMAX_PINT_SHIFT 24 -#define RT2860_TXMAX_PTIME_SHIFT 16 -#define RT2860_RXDLY_INT_EN (1 << 15) -#define RT2860_RXMAX_PINT_SHIFT 8 -#define RT2860_RXMAX_PTIME_SHIFT 0 +#define RT2860_TXDLY_INT_EN (1U << 31) +#define RT2860_TXMAX_PINT_SHIFT 24 +#define RT2860_TXMAX_PTIME_SHIFT 16 +#define RT2860_RXDLY_INT_EN (1 << 15) +#define RT2860_RXMAX_PINT_SHIFT 8 +#define RT2860_RXMAX_PTIME_SHIFT 0 /* possible flags for register GPIO_CTRL */ -#define RT2860_GPIO_D_SHIFT 8 -#define RT2860_GPIO_O_SHIFT 0 +#define RT2860_GPIO_D_SHIFT 8 +#define RT2860_GPIO_O_SHIFT 0 /* possible flags for register USB_DMA_CFG */ -#define RT2860_USB_TX_BUSY (1U << 31) -#define RT2860_USB_RX_BUSY (1 << 30) -#define RT2860_USB_EPOUT_VLD_SHIFT 24 -#define RT2860_USB_TX_EN (1 << 23) -#define RT2860_USB_RX_EN (1 << 22) -#define RT2860_USB_RX_AGG_EN (1 << 21) -#define RT2860_USB_TXOP_HALT (1 << 20) -#define RT2860_USB_TX_CLEAR (1 << 19) -#define RT2860_USB_PHY_WD_EN (1 << 16) -#define RT2860_USB_PHY_MAN_RST (1 << 15) -#define RT2860_USB_RX_AGG_LMT(x) ((x) << 8) /* in unit of 1KB */ -#define RT2860_USB_RX_AGG_TO(x) ((x) & 0xff) /* in unit of 33ns */ +#define RT2860_USB_TX_BUSY (1U << 31) +#define RT2860_USB_RX_BUSY (1 << 30) +#define RT2860_USB_EPOUT_VLD_SHIFT 24 +#define RT2860_USB_TX_EN (1 << 23) +#define RT2860_USB_RX_EN (1 << 22) +#define RT2860_USB_RX_AGG_EN (1 << 21) +#define RT2860_USB_TXOP_HALT (1 << 20) +#define RT2860_USB_TX_CLEAR (1 << 19) +#define RT2860_USB_PHY_WD_EN (1 << 16) +#define RT2860_USB_PHY_MAN_RST (1 << 15) +#define RT2860_USB_RX_AGG_LMT(x) ((x) << 8) /* in unit of 1KB */ +#define RT2860_USB_RX_AGG_TO(x) ((x) & 0xff) /* in unit of 33ns */ /* possible flags for register US_CYC_CNT */ -#define RT2860_TEST_EN (1 << 24) -#define RT2860_TEST_SEL_SHIFT 16 -#define RT2860_BT_MODE_EN (1 << 8) -#define RT2860_US_CYC_CNT_SHIFT 0 +#define RT2860_TEST_EN (1 << 24) +#define RT2860_TEST_SEL_SHIFT 16 +#define RT2860_BT_MODE_EN (1 << 8) +#define RT2860_US_CYC_CNT_SHIFT 0 /* possible flags for register SYS_CTRL */ -#define RT2860_HST_PM_SEL (1 << 16) -#define RT2860_CAP_MODE (1 << 14) -#define RT2860_PME_OEN (1 << 13) -#define RT2860_CLKSELECT (1 << 12) -#define RT2860_PBF_CLK_EN (1 << 11) -#define RT2860_MAC_CLK_EN (1 << 10) -#define RT2860_DMA_CLK_EN (1 << 9) -#define RT2860_MCU_READY (1 << 7) -#define RT2860_ASY_RESET (1 << 4) -#define RT2860_PBF_RESET (1 << 3) -#define RT2860_MAC_RESET (1 << 2) -#define RT2860_DMA_RESET (1 << 1) -#define RT2860_MCU_RESET (1 << 0) +#define RT2860_HST_PM_SEL (1 << 16) +#define RT2860_CAP_MODE (1 << 14) +#define RT2860_PME_OEN (1 << 13) +#define RT2860_CLKSELECT (1 << 12) +#define RT2860_PBF_CLK_EN (1 << 11) +#define RT2860_MAC_CLK_EN (1 << 10) +#define RT2860_DMA_CLK_EN (1 << 9) +#define RT2860_MCU_READY (1 << 7) +#define RT2860_ASY_RESET (1 << 4) +#define RT2860_PBF_RESET (1 << 3) +#define RT2860_MAC_RESET (1 << 2) +#define RT2860_DMA_RESET (1 << 1) +#define RT2860_MCU_RESET (1 << 0) /* possible values for register HOST_CMD */ -#define RT2860_MCU_CMD_SLEEP 0x30 -#define RT2860_MCU_CMD_WAKEUP 0x31 -#define RT2860_MCU_CMD_LEDS 0x50 -#define RT2860_MCU_CMD_LED_RSSI 0x51 -#define RT2860_MCU_CMD_LED1 0x52 -#define RT2860_MCU_CMD_LED2 0x53 -#define RT2860_MCU_CMD_LED3 0x54 -#define RT2860_MCU_CMD_RFRESET 0x72 -#define RT2860_MCU_CMD_ANTSEL 0x73 -#define RT2860_MCU_CMD_BBP 0x80 -#define RT2860_MCU_CMD_PSLEVEL 0x83 +#define RT2860_MCU_CMD_SLEEP 0x30 +#define RT2860_MCU_CMD_WAKEUP 0x31 +#define RT2860_MCU_CMD_LEDS 0x50 +#define RT2860_MCU_CMD_LED_RSSI 0x51 +#define RT2860_MCU_CMD_LED1 0x52 +#define RT2860_MCU_CMD_LED2 0x53 +#define RT2860_MCU_CMD_LED3 0x54 +#define RT2860_MCU_CMD_RFRESET 0x72 +#define RT2860_MCU_CMD_ANTSEL 0x73 +#define RT2860_MCU_CMD_BBP 0x80 +#define RT2860_MCU_CMD_PSLEVEL 0x83 /* possible flags for register PBF_CFG */ -#define RT2860_TX1Q_NUM_SHIFT 21 -#define RT2860_TX2Q_NUM_SHIFT 16 -#define RT2860_NULL0_MODE (1 << 15) -#define RT2860_NULL1_MODE (1 << 14) -#define RT2860_RX_DROP_MODE (1 << 13) -#define RT2860_TX0Q_MANUAL (1 << 12) -#define RT2860_TX1Q_MANUAL (1 << 11) -#define RT2860_TX2Q_MANUAL (1 << 10) -#define RT2860_RX0Q_MANUAL (1 << 9) -#define RT2860_HCCA_EN (1 << 8) -#define RT2860_TX0Q_EN (1 << 4) -#define RT2860_TX1Q_EN (1 << 3) -#define RT2860_TX2Q_EN (1 << 2) -#define RT2860_RX0Q_EN (1 << 1) +#define RT2860_TX1Q_NUM_SHIFT 21 +#define RT2860_TX2Q_NUM_SHIFT 16 +#define RT2860_NULL0_MODE (1 << 15) +#define RT2860_NULL1_MODE (1 << 14) +#define RT2860_RX_DROP_MODE (1 << 13) +#define RT2860_TX0Q_MANUAL (1 << 12) +#define RT2860_TX1Q_MANUAL (1 << 11) +#define RT2860_TX2Q_MANUAL (1 << 10) +#define RT2860_RX0Q_MANUAL (1 << 9) +#define RT2860_HCCA_EN (1 << 8) +#define RT2860_TX0Q_EN (1 << 4) +#define RT2860_TX1Q_EN (1 << 3) +#define RT2860_TX2Q_EN (1 << 2) +#define RT2860_RX0Q_EN (1 << 1) /* possible flags for register BUF_CTRL */ -#define RT2860_WRITE_TXQ(qid) (1 << (11 - (qid))) -#define RT2860_NULL0_KICK (1 << 7) -#define RT2860_NULL1_KICK (1 << 6) -#define RT2860_BUF_RESET (1 << 5) -#define RT2860_READ_TXQ(qid) (1 << (3 - (qid)) -#define RT2860_READ_RX0Q (1 << 0) +#define RT2860_WRITE_TXQ(qid) (1 << (11 - (qid))) +#define RT2860_NULL0_KICK (1 << 7) +#define RT2860_NULL1_KICK (1 << 6) +#define RT2860_BUF_RESET (1 << 5) +#define RT2860_READ_TXQ(qid) (1 << (3 - (qid)) +#define RT2860_READ_RX0Q (1 << 0) /* possible flags for registers MCU_INT_STA/MCU_INT_ENA */ -#define RT2860_MCU_MAC_INT_8 (1 << 24) -#define RT2860_MCU_MAC_INT_7 (1 << 23) -#define RT2860_MCU_MAC_INT_6 (1 << 22) -#define RT2860_MCU_MAC_INT_4 (1 << 20) -#define RT2860_MCU_MAC_INT_3 (1 << 19) -#define RT2860_MCU_MAC_INT_2 (1 << 18) -#define RT2860_MCU_MAC_INT_1 (1 << 17) -#define RT2860_MCU_MAC_INT_0 (1 << 16) -#define RT2860_DTX0_INT (1 << 11) -#define RT2860_DTX1_INT (1 << 10) -#define RT2860_DTX2_INT (1 << 9) -#define RT2860_DRX0_INT (1 << 8) -#define RT2860_HCMD_INT (1 << 7) -#define RT2860_N0TX_INT (1 << 6) -#define RT2860_N1TX_INT (1 << 5) -#define RT2860_BCNTX_INT (1 << 4) -#define RT2860_MTX0_INT (1 << 3) -#define RT2860_MTX1_INT (1 << 2) -#define RT2860_MTX2_INT (1 << 1) -#define RT2860_MRX0_INT (1 << 0) +#define RT2860_MCU_MAC_INT_8 (1 << 24) +#define RT2860_MCU_MAC_INT_7 (1 << 23) +#define RT2860_MCU_MAC_INT_6 (1 << 22) +#define RT2860_MCU_MAC_INT_4 (1 << 20) +#define RT2860_MCU_MAC_INT_3 (1 << 19) +#define RT2860_MCU_MAC_INT_2 (1 << 18) +#define RT2860_MCU_MAC_INT_1 (1 << 17) +#define RT2860_MCU_MAC_INT_0 (1 << 16) +#define RT2860_DTX0_INT (1 << 11) +#define RT2860_DTX1_INT (1 << 10) +#define RT2860_DTX2_INT (1 << 9) +#define RT2860_DRX0_INT (1 << 8) +#define RT2860_HCMD_INT (1 << 7) +#define RT2860_N0TX_INT (1 << 6) +#define RT2860_N1TX_INT (1 << 5) +#define RT2860_BCNTX_INT (1 << 4) +#define RT2860_MTX0_INT (1 << 3) +#define RT2860_MTX1_INT (1 << 2) +#define RT2860_MTX2_INT (1 << 1) +#define RT2860_MRX0_INT (1 << 0) /* possible flags for register TXRXQ_PCNT */ -#define RT2860_RX0Q_PCNT_MASK 0xff000000 -#define RT2860_TX2Q_PCNT_MASK 0x00ff0000 -#define RT2860_TX1Q_PCNT_MASK 0x0000ff00 -#define RT2860_TX0Q_PCNT_MASK 0x000000ff +#define RT2860_RX0Q_PCNT_MASK 0xff000000 +#define RT2860_TX2Q_PCNT_MASK 0x00ff0000 +#define RT2860_TX1Q_PCNT_MASK 0x0000ff00 +#define RT2860_TX0Q_PCNT_MASK 0x000000ff /* possible flags for register CAP_CTRL */ -#define RT2860_CAP_ADC_FEQ (1U << 31) -#define RT2860_CAP_START (1 << 30) -#define RT2860_MAN_TRIG (1 << 29) -#define RT2860_TRIG_OFFSET_SHIFT 16 -#define RT2860_START_ADDR_SHIFT 0 +#define RT2860_CAP_ADC_FEQ (1U << 31) +#define RT2860_CAP_START (1 << 30) +#define RT2860_MAN_TRIG (1 << 29) +#define RT2860_TRIG_OFFSET_SHIFT 16 +#define RT2860_START_ADDR_SHIFT 0 /* possible flags for register RF_CSR_CFG */ -#define RT3070_RF_KICK (1 << 17) -#define RT3070_RF_WRITE (1 << 16) +#define RT3070_RF_KICK (1 << 17) +#define RT3070_RF_WRITE (1 << 16) /* possible flags for register EFUSE_CTRL */ -#define RT3070_SEL_EFUSE (1U << 31) -#define RT3070_EFSROM_KICK (1 << 30) -#define RT3070_EFSROM_AIN_MASK 0x03ff0000 -#define RT3070_EFSROM_AIN_SHIFT 16 -#define RT3070_EFSROM_MODE_MASK 0x000000c0 -#define RT3070_EFUSE_AOUT_MASK 0x0000003f +#define RT3070_SEL_EFUSE (1U << 31) +#define RT3070_EFSROM_KICK (1 << 30) +#define RT3070_EFSROM_AIN_MASK 0x03ff0000 +#define RT3070_EFSROM_AIN_SHIFT 16 +#define RT3070_EFSROM_MODE_MASK 0x000000c0 +#define RT3070_EFUSE_AOUT_MASK 0x0000003f /* possible flag for register DEBUG_INDEX */ -#define RT5592_SEL_XTAL (1U << 31) +#define RT5592_SEL_XTAL (1U << 31) /* possible flags for register MAC_SYS_CTRL */ -#define RT2860_RX_TS_EN (1 << 7) -#define RT2860_WLAN_HALT_EN (1 << 6) -#define RT2860_PBF_LOOP_EN (1 << 5) -#define RT2860_CONT_TX_TEST (1 << 4) -#define RT2860_MAC_RX_EN (1 << 3) -#define RT2860_MAC_TX_EN (1 << 2) -#define RT2860_BBP_HRST (1 << 1) -#define RT2860_MAC_SRST (1 << 0) +#define RT2860_RX_TS_EN (1 << 7) +#define RT2860_WLAN_HALT_EN (1 << 6) +#define RT2860_PBF_LOOP_EN (1 << 5) +#define RT2860_CONT_TX_TEST (1 << 4) +#define RT2860_MAC_RX_EN (1 << 3) +#define RT2860_MAC_TX_EN (1 << 2) +#define RT2860_BBP_HRST (1 << 1) +#define RT2860_MAC_SRST (1 << 0) /* possible flags for register MAC_BSSID_DW1 */ -#define RT2860_MULTI_BCN_NUM_SHIFT 18 -#define RT2860_MULTI_BSSID_MODE_SHIFT 16 +#define RT2860_MULTI_BCN_NUM_SHIFT 18 +#define RT2860_MULTI_BSSID_MODE_SHIFT 16 /* possible flags for register MAX_LEN_CFG */ -#define RT2860_MIN_MPDU_LEN_SHIFT 16 -#define RT2860_MAX_PSDU_LEN_SHIFT 12 -#define RT2860_MAX_PSDU_LEN8K 0 -#define RT2860_MAX_PSDU_LEN16K 1 -#define RT2860_MAX_PSDU_LEN32K 2 -#define RT2860_MAX_PSDU_LEN64K 3 -#define RT2860_MAX_MPDU_LEN_SHIFT 0 +#define RT2860_MIN_MPDU_LEN_SHIFT 16 +#define RT2860_MAX_PSDU_LEN_SHIFT 12 +#define RT2860_MAX_PSDU_LEN8K 0 +#define RT2860_MAX_PSDU_LEN16K 1 +#define RT2860_MAX_PSDU_LEN32K 2 +#define RT2860_MAX_PSDU_LEN64K 3 +#define RT2860_MAX_MPDU_LEN_SHIFT 0 /* possible flags for registers BBP_CSR_CFG/H2M_BBPAGENT */ -#define RT2860_BBP_RW_PARALLEL (1 << 19) -#define RT2860_BBP_PAR_DUR_112_5 (1 << 18) -#define RT2860_BBP_CSR_KICK (1 << 17) -#define RT2860_BBP_CSR_READ (1 << 16) -#define RT2860_BBP_ADDR_SHIFT 8 -#define RT2860_BBP_DATA_SHIFT 0 +#define RT2860_BBP_RW_PARALLEL (1 << 19) +#define RT2860_BBP_PAR_DUR_112_5 (1 << 18) +#define RT2860_BBP_CSR_KICK (1 << 17) +#define RT2860_BBP_CSR_READ (1 << 16) +#define RT2860_BBP_ADDR_SHIFT 8 +#define RT2860_BBP_DATA_SHIFT 0 /* possible flags for register RF_CSR_CFG0 */ -#define RT2860_RF_REG_CTRL (1U << 31) -#define RT2860_RF_LE_SEL1 (1 << 30) -#define RT2860_RF_LE_STBY (1 << 29) -#define RT2860_RF_REG_WIDTH_SHIFT 24 -#define RT2860_RF_REG_0_SHIFT 0 +#define RT2860_RF_REG_CTRL (1U << 31) +#define RT2860_RF_LE_SEL1 (1 << 30) +#define RT2860_RF_LE_STBY (1 << 29) +#define RT2860_RF_REG_WIDTH_SHIFT 24 +#define RT2860_RF_REG_0_SHIFT 0 /* possible flags for register RF_CSR_CFG1 */ -#define RT2860_RF_DUR_5 (1 << 24) -#define RT2860_RF_REG_1_SHIFT 0 +#define RT2860_RF_DUR_5 (1 << 24) +#define RT2860_RF_REG_1_SHIFT 0 /* possible flags for register LED_CFG */ -#define RT2860_LED_POL (1 << 30) -#define RT2860_Y_LED_MODE_SHIFT 28 -#define RT2860_G_LED_MODE_SHIFT 26 -#define RT2860_R_LED_MODE_SHIFT 24 -#define RT2860_LED_MODE_OFF 0 -#define RT2860_LED_MODE_BLINK_TX 1 -#define RT2860_LED_MODE_SLOW_BLINK 2 -#define RT2860_LED_MODE_ON 3 -#define RT2860_SLOW_BLK_TIME_SHIFT 16 -#define RT2860_LED_OFF_TIME_SHIFT 8 -#define RT2860_LED_ON_TIME_SHIFT 0 +#define RT2860_LED_POL (1 << 30) +#define RT2860_Y_LED_MODE_SHIFT 28 +#define RT2860_G_LED_MODE_SHIFT 26 +#define RT2860_R_LED_MODE_SHIFT 24 +#define RT2860_LED_MODE_OFF 0 +#define RT2860_LED_MODE_BLINK_TX 1 +#define RT2860_LED_MODE_SLOW_BLINK 2 +#define RT2860_LED_MODE_ON 3 +#define RT2860_SLOW_BLK_TIME_SHIFT 16 +#define RT2860_LED_OFF_TIME_SHIFT 8 +#define RT2860_LED_ON_TIME_SHIFT 0 /* possible flags for register XIFS_TIME_CFG */ -#define RT2860_BB_RXEND_EN (1 << 29) -#define RT2860_EIFS_TIME_SHIFT 20 -#define RT2860_OFDM_XIFS_TIME_SHIFT 16 -#define RT2860_OFDM_SIFS_TIME_SHIFT 8 -#define RT2860_CCK_SIFS_TIME_SHIFT 0 +#define RT2860_BB_RXEND_EN (1 << 29) +#define RT2860_EIFS_TIME_SHIFT 20 +#define RT2860_OFDM_XIFS_TIME_SHIFT 16 +#define RT2860_OFDM_SIFS_TIME_SHIFT 8 +#define RT2860_CCK_SIFS_TIME_SHIFT 0 /* possible flags for register BKOFF_SLOT_CFG */ -#define RT2860_CC_DELAY_TIME_SHIFT 8 -#define RT2860_SLOT_TIME 0 +#define RT2860_CC_DELAY_TIME_SHIFT 8 +#define RT2860_SLOT_TIME 0 /* possible flags for register NAV_TIME_CFG */ -#define RT2860_NAV_UPD (1U << 31) -#define RT2860_NAV_UPD_VAL_SHIFT 16 -#define RT2860_NAV_CLR_EN (1 << 15) -#define RT2860_NAV_TIMER_SHIFT 0 +#define RT2860_NAV_UPD (1U << 31) +#define RT2860_NAV_UPD_VAL_SHIFT 16 +#define RT2860_NAV_CLR_EN (1 << 15) +#define RT2860_NAV_TIMER_SHIFT 0 /* possible flags for register CH_TIME_CFG */ -#define RT2860_EIFS_AS_CH_BUSY (1 << 4) -#define RT2860_NAV_AS_CH_BUSY (1 << 3) -#define RT2860_RX_AS_CH_BUSY (1 << 2) -#define RT2860_TX_AS_CH_BUSY (1 << 1) -#define RT2860_CH_STA_TIMER_EN (1 << 0) +#define RT2860_EIFS_AS_CH_BUSY (1 << 4) +#define RT2860_NAV_AS_CH_BUSY (1 << 3) +#define RT2860_RX_AS_CH_BUSY (1 << 2) +#define RT2860_TX_AS_CH_BUSY (1 << 1) +#define RT2860_CH_STA_TIMER_EN (1 << 0) /* possible values for register BCN_TIME_CFG */ -#define RT2860_TSF_INS_COMP_SHIFT 24 -#define RT2860_BCN_TX_EN (1 << 20) -#define RT2860_TBTT_TIMER_EN (1 << 19) -#define RT2860_TSF_SYNC_MODE_SHIFT 17 -#define RT2860_TSF_SYNC_MODE_DIS 0 -#define RT2860_TSF_SYNC_MODE_STA 1 -#define RT2860_TSF_SYNC_MODE_IBSS 2 -#define RT2860_TSF_SYNC_MODE_HOSTAP 3 -#define RT2860_TSF_TIMER_EN (1 << 16) -#define RT2860_BCN_INTVAL_SHIFT 0 +#define RT2860_TSF_INS_COMP_SHIFT 24 +#define RT2860_BCN_TX_EN (1 << 20) +#define RT2860_TBTT_TIMER_EN (1 << 19) +#define RT2860_TSF_SYNC_MODE_SHIFT 17 +#define RT2860_TSF_SYNC_MODE_DIS 0 +#define RT2860_TSF_SYNC_MODE_STA 1 +#define RT2860_TSF_SYNC_MODE_IBSS 2 +#define RT2860_TSF_SYNC_MODE_HOSTAP 3 +#define RT2860_TSF_TIMER_EN (1 << 16) +#define RT2860_BCN_INTVAL_SHIFT 0 /* possible flags for register TBTT_SYNC_CFG */ -#define RT2860_BCN_CWMIN_SHIFT 20 -#define RT2860_BCN_AIFSN_SHIFT 16 -#define RT2860_BCN_EXP_WIN_SHIFT 8 -#define RT2860_TBTT_ADJUST_SHIFT 0 +#define RT2860_BCN_CWMIN_SHIFT 20 +#define RT2860_BCN_AIFSN_SHIFT 16 +#define RT2860_BCN_EXP_WIN_SHIFT 8 +#define RT2860_TBTT_ADJUST_SHIFT 0 /* possible flags for register INT_TIMER_CFG */ -#define RT2860_GP_TIMER_SHIFT 16 -#define RT2860_PRE_TBTT_TIMER_SHIFT 0 +#define RT2860_GP_TIMER_SHIFT 16 +#define RT2860_PRE_TBTT_TIMER_SHIFT 0 /* possible flags for register INT_TIMER_EN */ -#define RT2860_GP_TIMER_EN (1 << 1) -#define RT2860_PRE_TBTT_INT_EN (1 << 0) +#define RT2860_GP_TIMER_EN (1 << 1) +#define RT2860_PRE_TBTT_INT_EN (1 << 0) /* possible flags for register MAC_STATUS_REG */ -#define RT2860_RX_STATUS_BUSY (1 << 1) -#define RT2860_TX_STATUS_BUSY (1 << 0) +#define RT2860_RX_STATUS_BUSY (1 << 1) +#define RT2860_TX_STATUS_BUSY (1 << 0) /* possible flags for register PWR_PIN_CFG */ -#define RT2860_IO_ADDA_PD (1 << 3) -#define RT2860_IO_PLL_PD (1 << 2) -#define RT2860_IO_RA_PE (1 << 1) -#define RT2860_IO_RF_PE (1 << 0) +#define RT2860_IO_ADDA_PD (1 << 3) +#define RT2860_IO_PLL_PD (1 << 2) +#define RT2860_IO_RA_PE (1 << 1) +#define RT2860_IO_RF_PE (1 << 0) /* possible flags for register AUTO_WAKEUP_CFG */ -#define RT2860_AUTO_WAKEUP_EN (1 << 15) -#define RT2860_SLEEP_TBTT_NUM_SHIFT 8 -#define RT2860_WAKEUP_LEAD_TIME_SHIFT 0 +#define RT2860_AUTO_WAKEUP_EN (1 << 15) +#define RT2860_SLEEP_TBTT_NUM_SHIFT 8 +#define RT2860_WAKEUP_LEAD_TIME_SHIFT 0 /* possible flags for register TX_PIN_CFG */ -#define RT2860_TRSW_POL (1 << 19) -#define RT2860_TRSW_EN (1 << 18) -#define RT2860_RFTR_POL (1 << 17) -#define RT2860_RFTR_EN (1 << 16) -#define RT2860_LNA_PE_G1_POL (1 << 15) -#define RT2860_LNA_PE_A1_POL (1 << 14) -#define RT2860_LNA_PE_G0_POL (1 << 13) -#define RT2860_LNA_PE_A0_POL (1 << 12) -#define RT2860_LNA_PE_G1_EN (1 << 11) -#define RT2860_LNA_PE_A1_EN (1 << 10) -#define RT2860_LNA_PE1_EN (RT2860_LNA_PE_A1_EN | RT2860_LNA_PE_G1_EN) -#define RT2860_LNA_PE_G0_EN (1 << 9) -#define RT2860_LNA_PE_A0_EN (1 << 8) -#define RT2860_LNA_PE0_EN (RT2860_LNA_PE_A0_EN | RT2860_LNA_PE_G0_EN) -#define RT2860_PA_PE_G1_POL (1 << 7) -#define RT2860_PA_PE_A1_POL (1 << 6) -#define RT2860_PA_PE_G0_POL (1 << 5) -#define RT2860_PA_PE_A0_POL (1 << 4) -#define RT2860_PA_PE_G1_EN (1 << 3) -#define RT2860_PA_PE_A1_EN (1 << 2) -#define RT2860_PA_PE_G0_EN (1 << 1) -#define RT2860_PA_PE_A0_EN (1 << 0) +#define RT2860_TRSW_POL (1 << 19) +#define RT2860_TRSW_EN (1 << 18) +#define RT2860_RFTR_POL (1 << 17) +#define RT2860_RFTR_EN (1 << 16) +#define RT2860_LNA_PE_G1_POL (1 << 15) +#define RT2860_LNA_PE_A1_POL (1 << 14) +#define RT2860_LNA_PE_G0_POL (1 << 13) +#define RT2860_LNA_PE_A0_POL (1 << 12) +#define RT2860_LNA_PE_G1_EN (1 << 11) +#define RT2860_LNA_PE_A1_EN (1 << 10) +#define RT2860_LNA_PE1_EN (RT2860_LNA_PE_A1_EN | RT2860_LNA_PE_G1_EN) +#define RT2860_LNA_PE_G0_EN (1 << 9) +#define RT2860_LNA_PE_A0_EN (1 << 8) +#define RT2860_LNA_PE0_EN (RT2860_LNA_PE_A0_EN | RT2860_LNA_PE_G0_EN) +#define RT2860_PA_PE_G1_POL (1 << 7) +#define RT2860_PA_PE_A1_POL (1 << 6) +#define RT2860_PA_PE_G0_POL (1 << 5) +#define RT2860_PA_PE_A0_POL (1 << 4) +#define RT2860_PA_PE_G1_EN (1 << 3) +#define RT2860_PA_PE_A1_EN (1 << 2) +#define RT2860_PA_PE_G0_EN (1 << 1) +#define RT2860_PA_PE_A0_EN (1 << 0) /* possible flags for register TX_BAND_CFG */ -#define RT2860_5G_BAND_SEL_N (1 << 2) -#define RT2860_5G_BAND_SEL_P (1 << 1) -#define RT2860_TX_BAND_SEL (1 << 0) +#define RT2860_5G_BAND_SEL_N (1 << 2) +#define RT2860_5G_BAND_SEL_P (1 << 1) +#define RT2860_TX_BAND_SEL (1 << 0) /* possible flags for register TX_SW_CFG0 */ -#define RT2860_DLY_RFTR_EN_SHIFT 24 -#define RT2860_DLY_TRSW_EN_SHIFT 16 -#define RT2860_DLY_PAPE_EN_SHIFT 8 -#define RT2860_DLY_TXPE_EN_SHIFT 0 +#define RT2860_DLY_RFTR_EN_SHIFT 24 +#define RT2860_DLY_TRSW_EN_SHIFT 16 +#define RT2860_DLY_PAPE_EN_SHIFT 8 +#define RT2860_DLY_TXPE_EN_SHIFT 0 /* possible flags for register TX_SW_CFG1 */ -#define RT2860_DLY_RFTR_DIS_SHIFT 16 -#define RT2860_DLY_TRSW_DIS_SHIFT 8 -#define RT2860_DLY_PAPE_DIS SHIFT 0 +#define RT2860_DLY_RFTR_DIS_SHIFT 16 +#define RT2860_DLY_TRSW_DIS_SHIFT 8 +#define RT2860_DLY_PAPE_DIS SHIFT 0 /* possible flags for register TX_SW_CFG2 */ -#define RT2860_DLY_LNA_EN_SHIFT 24 -#define RT2860_DLY_LNA_DIS_SHIFT 16 -#define RT2860_DLY_DAC_EN_SHIFT 8 -#define RT2860_DLY_DAC_DIS_SHIFT 0 +#define RT2860_DLY_LNA_EN_SHIFT 24 +#define RT2860_DLY_LNA_DIS_SHIFT 16 +#define RT2860_DLY_DAC_EN_SHIFT 8 +#define RT2860_DLY_DAC_DIS_SHIFT 0 /* possible flags for register TXOP_THRES_CFG */ -#define RT2860_TXOP_REM_THRES_SHIFT 24 -#define RT2860_CF_END_THRES_SHIFT 16 -#define RT2860_RDG_IN_THRES 8 -#define RT2860_RDG_OUT_THRES 0 +#define RT2860_TXOP_REM_THRES_SHIFT 24 +#define RT2860_CF_END_THRES_SHIFT 16 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 08:53:41 2013 Return-Path: Delivered-To: svn-src-all@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 78EE5D51; Wed, 18 Dec 2013 08:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 658EE1703; Wed, 18 Dec 2013 08:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBI8rfFR004806; Wed, 18 Dec 2013 08:53:41 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBI8rfJD004805; Wed, 18 Dec 2013 08:53:41 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201312180853.rBI8rfJD004805@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Dec 2013 08:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259547 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 08:53:41 -0000 Author: kevlo Date: Wed Dec 18 08:53:40 2013 New Revision: 259547 URL: http://svnweb.freebsd.org/changeset/base/259547 Log: Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write() is uint8_t. Spotted by: yongari Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:39:12 2013 (r259546) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 18 08:53:40 2013 (r259547) @@ -3659,7 +3659,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx0 IQ phase. */ run_bbp_write(sc, 158, 0x2d); @@ -3680,7 +3680,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx1 IQ gain. */ run_bbp_write(sc, 158, 0x4a); @@ -3701,7 +3701,7 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* Tx1 IQ phase. */ run_bbp_write(sc, 158, 0x4b); @@ -3722,19 +3722,19 @@ run_iq_calib(struct run_softc *sc, u_int &val, 1); } else val = 0; - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* RF IQ compensation control. */ run_bbp_write(sc, 158, 0x04); run_efuse_read(sc, RT5390_EEPROM_RF_IQ_COMPENSATION_CTL, &val, 1); - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); /* RF IQ imbalance compensation control. */ run_bbp_write(sc, 158, 0x03); run_efuse_read(sc, RT5390_EEPROM_RF_IQ_IMBALANCE_COMPENSATION_CTL, &val, 1); - run_bbp_write(sc, 159, val & 0xff); + run_bbp_write(sc, 159, val); } static void From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 12:18:18 2013 Return-Path: Delivered-To: svn-src-all@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 45CB56D; Wed, 18 Dec 2013 12:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31D361890; Wed, 18 Dec 2013 12:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICIIIP079335; Wed, 18 Dec 2013 12:18:18 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICIIC3079334; Wed, 18 Dec 2013 12:18:18 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201312181218.rBICIIC3079334@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 18 Dec 2013 12:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259548 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 12:18:18 -0000 Author: ru Date: Wed Dec 18 12:18:17 2013 New Revision: 259548 URL: http://svnweb.freebsd.org/changeset/base/259548 Log: shm_open(2): Fixed the history information. While here, sort xrefs. Reviewed by: jhb Modified: head/lib/libc/sys/shm_open.2 Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Wed Dec 18 08:53:40 2013 (r259547) +++ head/lib/libc/sys/shm_open.2 Wed Dec 18 12:18:17 2013 (r259548) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2007 +.Dd December 18, 2013 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -253,8 +253,8 @@ requires write permission to the shared .El .Sh SEE ALSO .Xr close 2 , -.Xr ftruncate 2 , .Xr fstat 2 , +.Xr ftruncate 2 , .Xr mmap 2 , .Xr munmap 2 .Sh STANDARDS @@ -273,7 +273,7 @@ functions first appeared in .Fx 4.3 . The functions were reimplemented as system calls using shared memory objects directly rather than files in -.Fx 7.0 . +.Fx 8.0 . .Sh AUTHORS .An Garrett A. Wollman Aq wollman@FreeBSD.org (C library support and this manual page) From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 12:50:44 2013 Return-Path: Delivered-To: svn-src-all@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 C0CC7E44; Wed, 18 Dec 2013 12:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A070B1B5D; Wed, 18 Dec 2013 12:50:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICoiNh091809; Wed, 18 Dec 2013 12:50:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICoi48091807; Wed, 18 Dec 2013 12:50:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312181250.rBICoi48091807@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 12:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259549 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 12:50:44 -0000 Author: glebius Date: Wed Dec 18 12:50:43 2013 New Revision: 259549 URL: http://svnweb.freebsd.org/changeset/base/259549 Log: - 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. Reviewed by: kib Sponsored by: Nginx, Inc. Modified: head/sys/kern/tty.c head/sys/sys/tty.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Dec 18 12:18:17 2013 (r259548) +++ head/sys/kern/tty.c Wed Dec 18 12:50:43 2013 (r259549) @@ -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. */ @@ -1174,16 +1174,18 @@ SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTY * the user. */ -void -tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +int +tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) { 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) @@ -1205,57 +1207,92 @@ 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; } } + + 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); } /* Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Wed Dec 18 12:18:17 2013 (r259548) +++ head/sys/sys/tty.h Wed Dec 18 12:50:43 2013 (r259549) @@ -171,8 +171,11 @@ void tty_rel_gone(struct tty *tp); #define tty_getlock(tp) ((tp)->t_mtx) /* 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_makedev(tp, cred, fmt, ...) \ + (void )tty_makedevf((tp), (cred), 0, (fmt), ## __VA_ARGS__) #define tty_makealias(tp,fmt,...) \ make_dev_alias((tp)->t_dev, fmt, ## __VA_ARGS__) From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 12:53:25 2013 Return-Path: Delivered-To: svn-src-all@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 49121FE7; Wed, 18 Dec 2013 12:53:25 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0825F1C82; Wed, 18 Dec 2013 12:53:24 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 27BED7CC8; Wed, 18 Dec 2013 12:53:24 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id F187730E3A; Wed, 18 Dec 2013 13:53:24 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312131231.04749.jhb@freebsd.org> <86k3f4kjk8.fsf@nine.des.no> <201312171220.47075.jhb@freebsd.org> Date: Wed, 18 Dec 2013 13:53:24 +0100 In-Reply-To: <201312171220.47075.jhb@freebsd.org> (John Baldwin's message of "Tue, 17 Dec 2013 12:20:46 -0500") Message-ID: <86eh5agw1n.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 12:53:25 -0000 John Baldwin writes: > 1) 'make tinderbox' Just Works as a single command from an existing source > tree checkout. [...] > > 2) 'make tinderbox' provides a summary of what failed. 'make universe' > does not. [...] So remove all the .if !defined(DOING_TINDERBOX) code the tinderbox target, and 'make universe' will do what you want without confusing people. > Ah, I thought at one point it only built GENERIC and LINT type configs, > but presumably that has changed? That changed a long time ago. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 12:53:49 2013 Return-Path: Delivered-To: svn-src-all@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 EF7651C0; Wed, 18 Dec 2013 12:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEF2B1C8A; Wed, 18 Dec 2013 12:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBICrmCM092676; Wed, 18 Dec 2013 12:53:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBICrm5W092675; Wed, 18 Dec 2013 12:53:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312181253.rBICrm5W092675@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Dec 2013 12:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259550 - head/sys/dev/nmdm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 12:53:49 -0000 Author: glebius Date: Wed Dec 18 12:53:48 2013 New Revision: 259550 URL: http://svnweb.freebsd.org/changeset/base/259550 Log: 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. Reviewed by: kib Sponsored by: Nginx, Inc. Modified: head/sys/dev/nmdm/nmdm.c Modified: head/sys/dev/nmdm/nmdm.c ============================================================================== --- head/sys/dev/nmdm/nmdm.c Wed Dec 18 12:50:43 2013 (r259549) +++ head/sys/dev/nmdm/nmdm.c Wed Dec 18 12:53:48 2013 (r259550) @@ -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,47 +98,68 @@ struct nmdmsoftc { static int nmdm_count = 0; -static struct nmdmsoftc * -nmdm_alloc(unsigned long unit) +static void +nmdm_close(struct tty *tp) { - struct nmdmsoftc *ns; - struct tty *tp; - - atomic_add_int(&nmdm_count, 1); + struct nmdmpart *np; + struct nmdmpart *onp; + struct tty *otp; + + np = tty_softc(tp); + onp = np->np_other; + otp = onp->np_tty; - ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK|M_ZERO); - mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); + /* If second part is opened, do not destroy ourselves. */ + if (tty_opened(otp)) + return; - /* Hook the pairs together. */ - ns->ns_part1.np_pair = ns; - ns->ns_part1.np_other = &ns->ns_part2; - TASK_INIT(&ns->ns_part1.np_task, 0, nmdm_task_tty, &ns->ns_part1); - callout_init_mtx(&ns->ns_part1.np_callout, &ns->ns_mtx, 0); + /* Shut down self. */ + tty_rel_gone(tp); - ns->ns_part2.np_pair = ns; - ns->ns_part2.np_other = &ns->ns_part1; - TASK_INIT(&ns->ns_part2.np_task, 0, nmdm_task_tty, &ns->ns_part2); - callout_init_mtx(&ns->ns_part2.np_callout, &ns->ns_mtx, 0); + /* 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); +} - /* 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); +static void +nmdm_free(void *softc) +{ + struct nmdmpart *np = (struct nmdmpart *)softc; + struct nmdmsoftc *ns = np->np_pair; - tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2, - &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luB", unit); + callout_drain(&np->np_callout); + taskqueue_drain(taskqueue_swi, &np->np_task); - return (ns); + /* + * 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; unsigned long unit; char *end; - struct nmdmsoftc *ns; + int error; if (*dev != NULL) return; @@ -149,13 +174,50 @@ nmdm_clone(void *arg, struct ucred *cred if ((end[0] != 'A' && end[0] != 'B') || end[1] != '\0') return; - /* XXX: pass privileges? */ - ns = nmdm_alloc(unit); + ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK | M_ZERO); + mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); + + /* Hook the pairs together. */ + ns->ns_part1.np_pair = ns; + ns->ns_part1.np_other = &ns->ns_part2; + TASK_INIT(&ns->ns_part1.np_task, 0, nmdm_task_tty, &ns->ns_part1); + callout_init_mtx(&ns->ns_part1.np_callout, &ns->ns_mtx, 0); + + ns->ns_part2.np_pair = ns; + ns->ns_part2.np_other = &ns->ns_part1; + TASK_INIT(&ns->ns_part2.np_task, 0, nmdm_task_tty, &ns->ns_part2); + callout_init_mtx(&ns->ns_part2.np_callout, &ns->ns_mtx, 0); + + /* Create device nodes. */ + tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1, + &ns->ns_mtx); + error = tty_makedevf(tp, NULL, end[0] == 'A' ? TTYMK_CLONING : 0, + "nmdm%luA", unit); + if (error) { + 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); + error = tty_makedevf(tp, NULL, end[0] == 'B' ? TTYMK_CLONING : 0, + "nmdm%luB", unit); + if (error) { + 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; + } if (end[0] == 'A') *dev = ns->ns_part1.np_tty->t_dev; else *dev = ns->ns_part2.np_tty->t_dev; + + atomic_add_int(&nmdm_count, 1); } static void @@ -187,6 +249,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 +269,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-all@FreeBSD.ORG Wed Dec 18 13:27:24 2013 Return-Path: Delivered-To: svn-src-all@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 52393CF6; Wed, 18 Dec 2013 13:27:24 +0000 (UTC) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCDF41EEB; Wed, 18 Dec 2013 13:27:23 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0834F4000F; Wed, 18 Dec 2013 14:27:21 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id F15644000B; Wed, 18 Dec 2013 14:27:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 676F940009; Wed, 18 Dec 2013 14:27:19 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3dkxpb1Pdpz8jLB; Wed, 18 Dec 2013 14:27:19 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id AvcBSofTW5WN; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 3dkxpX5780z8jL9; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from tifa.daemonic.se (tifa.daemonic.se [10.32.0.6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3dkxpX4ZwXz9CwV; Wed, 18 Dec 2013 14:27:16 +0100 (CET) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 4DE552281D; Wed, 18 Dec 2013 14:27:14 +0100 (CET) Message-ID: <52B1A2B2.6010102@daemonic.se> Date: Wed, 18 Dec 2013 14:27:14 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> <20131218002415.GQ99753@ithaqua.etoilebsd.net> In-Reply-To: <20131218002415.GQ99753@ithaqua.etoilebsd.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Aleksandr Rybalko , Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 13:27:24 -0000 On 12/18/13 01:24, Baptiste Daroussin wrote: > On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: >> On Tue, 10 Dec 2013 23:49:38 +0100 >> Andreas Tobler wrote: >> >>> On 10.12.13 14:43, Tijl Coosemans wrote: >>>> On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: >>>>> That keyboards have no Shift key for that? :) >>>>> I will be glad to apply your changes, but I have to know how it >>>>> should be controlled. >>>>> >>>>> RU and UA PC keyboards have same 3 symbols '2', '"', '@' >>>>> To get '2' i have to press only '2' >>>>> To get '@' I have to press Shift+'2' >>>>> To get '"' I have to switch to UA or RU and press Shift+'2' >>>>> >>>>> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary >>>>> lang switch. Which commonly mapped to one of Alt. Right? >>>>> So R-Alt+Shift+'2'? >>>> >>>> https://en.wikipedia.org/wiki/AltGr >>> >>> Thanks Tijl! >>> >>> To get the @ I have to press AltGr + '2'. >>> There are combinations where I have to press AltGr+Shift. e.g to get >>> the 'broken bar, ¦', AltGr+Shift+'7'. >>> >>> Andreas >>> >> >> Hello Andreas and Tijl! >> >> Since I think not a whole world have AltGr key (read as "not most >> keyboards on the Earth") :) >> Think it is OK to use R.Alt as an Alt by default, and enable AltGr with >> sysctl kern.vt.enable_altgr. >> > I tend to disagree with you, lots of keyboards mapping are concerned here. > alt-gr is there on most, if not all, western european keyboard layouts, and probably more layouts than that. Have a look at http://en.wikipedia.org/wiki/AltGr_key for instance. Regards! -- Niclas From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 14:53:38 2013 Return-Path: Delivered-To: svn-src-all@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 BF2B530B; Wed, 18 Dec 2013 14:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA31B14E7; Wed, 18 Dec 2013 14:53:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIErcT3037474; Wed, 18 Dec 2013 14:53:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIEranx037463; Wed, 18 Dec 2013 14:53:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312181453.rBIEranx037463@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 14:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 14:53:38 -0000 Author: pfg Date: Wed Dec 18 14:53:36 2013 New Revision: 259555 URL: http://svnweb.freebsd.org/changeset/base/259555 Log: gcc: add Apple compatible -Wnewline-eof GCC 4.2 and previous have always warned about "No newline at end of file". Upstream GCC removed the warning completely but Apple made it an optional warning. Adopt it for compatibility with older GCC and clang. While here, add comment to complement r258712. Obtained from: Apple Inc. (Apple GCC 4.2 - 5531) MFC after: 1 week Added: head/contrib/gcclibs/libcpp/ChangeLog.apple Modified: head/contrib/gcc/c-opts.c head/contrib/gcc/c.opt head/contrib/gcc/doc/invoke.texi head/contrib/gcclibs/libcpp/charset.c head/contrib/gcclibs/libcpp/include/cpplib.h head/contrib/gcclibs/libcpp/init.c head/contrib/gcclibs/libcpp/lex.c Modified: head/contrib/gcc/c-opts.c ============================================================================== --- head/contrib/gcc/c-opts.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/c-opts.c Wed Dec 18 14:53:36 2013 (r259555) @@ -487,6 +487,12 @@ c_common_handle_option (size_t scode, co cpp_opts->warn_multichar = value; break; + /* APPLE LOCAL begin -Wnewline-eof */ + case OPT_Wnewline_eof: + cpp_opts->warn_newline_at_eof = value; + break; + /* APPLE LOCAL end -Wnewline-eof */ + case OPT_Wnormalized_: if (!value || (arg && strcasecmp (arg, "none") == 0)) cpp_opts->warn_normalize = normalized_none; Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/c.opt Wed Dec 18 14:53:36 2013 (r259555) @@ -292,6 +292,12 @@ Wnested-externs C ObjC Var(warn_nested_externs) Warn about \"extern\" declarations not at file scope +; APPLE LOCAL begin -Wnewline-eof +Wnewline-eof +C ObjC C++ ObjC++ +Warn about files missing a newline at the end of the file +; APPLE LOCAL end -Wnewline-eof + Wnon-template-friend C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warn when non-templatized friend functions are declared within a template Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcc/doc/invoke.texi Wed Dec 18 14:53:36 2013 (r259555) @@ -169,6 +169,8 @@ in the following sections. -trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol -fallow-single-precision -fcond-mismatch -flax-vector-conversions @gol -fsigned-bitfields -fsigned-char @gol +@c APPLE LOCAL -Wnewline-eof 2001-08-23 --sts ** +-Wnewline-eof (Apple compatible) @gol -funsigned-bitfields -funsigned-char} @item C++ Language Options @@ -2082,6 +2084,12 @@ Inhibit all warning messages. @opindex Wno-import Inhibit warning messages about the use of @samp{#import}. +@c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts ** +@item -Wnewline-eof +@opindex Wnewline-eof +Warn about files missing a newline at the end of the file. (FreeBSD ONLY) +@c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts ** + @item -Wchar-subscripts @opindex Wchar-subscripts Warn if an array subscript has type @code{char}. This is a common cause Added: head/contrib/gcclibs/libcpp/ChangeLog.apple ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcclibs/libcpp/ChangeLog.apple Wed Dec 18 14:53:36 2013 (r259555) @@ -0,0 +1,9 @@ +2008-08-04 Bill Wendling + + Radar 6121572 + * charset.c (_cpp_convert_input): Don't read to.text[-1]. + +2005-02-17 Devang Patel + + Radar 3958387 + * libcpp/lex.c (_cpp_get_fresh_line): Check warn_newline_at_eof. Modified: head/contrib/gcclibs/libcpp/charset.c ============================================================================== --- head/contrib/gcclibs/libcpp/charset.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/charset.c Wed Dec 18 14:53:36 2013 (r259555) @@ -1628,6 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ + /* APPLE LOCAL don't access to.text[-1] radar 6121572 */ if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else Modified: head/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- head/contrib/gcclibs/libcpp/include/cpplib.h Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/include/cpplib.h Wed Dec 18 14:53:36 2013 (r259555) @@ -320,6 +320,11 @@ struct cpp_options /* Nonzero means warn if there are any trigraphs. */ unsigned char warn_trigraphs; + /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */ + /* Nonzero means warn if no newline at end of file. */ + unsigned char warn_newline_at_eof; + /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */ + /* Nonzero means warn about multicharacter charconsts. */ unsigned char warn_multichar; Modified: head/contrib/gcclibs/libcpp/init.c ============================================================================== --- head/contrib/gcclibs/libcpp/init.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/init.c Wed Dec 18 14:53:36 2013 (r259555) @@ -146,6 +146,10 @@ cpp_create_reader (enum c_lang lang, has pfile = XCNEW (cpp_reader); cpp_set_lang (pfile, lang); + /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */ + /* Suppress warnings about missing newlines at ends of files. */ + CPP_OPTION (pfile, warn_newline_at_eof) = 0; + /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */ CPP_OPTION (pfile, warn_multichar) = 1; CPP_OPTION (pfile, discard_comments) = 1; CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1; Modified: head/contrib/gcclibs/libcpp/lex.c ============================================================================== --- head/contrib/gcclibs/libcpp/lex.c Wed Dec 18 14:46:13 2013 (r259554) +++ head/contrib/gcclibs/libcpp/lex.c Wed Dec 18 14:53:36 2013 (r259555) @@ -854,6 +854,14 @@ _cpp_get_fresh_line (cpp_reader *pfile) { /* Clip to buffer size. */ buffer->next_line = buffer->rlimit; + /* APPLE LOCAL begin suppress no newline warning. */ + if ( CPP_OPTION (pfile, warn_newline_at_eof)) + { + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, + CPP_BUF_COLUMN (buffer, buffer->cur), + "no newline at end of file"); + } + /* APPLE LOCAL end suppress no newline warning. */ } return_at_eof = buffer->return_at_eof; From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 15:27:49 2013 Return-Path: Delivered-To: svn-src-all@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 6B999D9F; Wed, 18 Dec 2013 15:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57A531760; Wed, 18 Dec 2013 15:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIFRncP049266; Wed, 18 Dec 2013 15:27:49 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIFRn7u049265; Wed, 18 Dec 2013 15:27:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312181527.rBIFRn7u049265@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 15:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259558 - head/contrib/gcc/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 15:27:49 -0000 Author: pfg Date: Wed Dec 18 15:27:48 2013 New Revision: 259558 URL: http://svnweb.freebsd.org/changeset/base/259558 Log: gcc: add Apple compatible -Wnewline-eof Fix document: "Apple compatible" suits better the origin. MFC after: 1 week Modified: head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Wed Dec 18 15:13:30 2013 (r259557) +++ head/contrib/gcc/doc/invoke.texi Wed Dec 18 15:27:48 2013 (r259558) @@ -2087,7 +2087,7 @@ Inhibit warning messages about the use o @c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts ** @item -Wnewline-eof @opindex Wnewline-eof -Warn about files missing a newline at the end of the file. (FreeBSD ONLY) +Warn about files missing a newline at the end of the file. (Apple compatible) @c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts ** @item -Wchar-subscripts From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 15:42:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 83B2F3FE; Wed, 18 Dec 2013 15:42:53 +0000 (UTC) Date: Wed, 18 Dec 2013 15:42:53 +0000 From: Alexey Dokuchaev To: "Pedro F. Giffuni" Subject: Re: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/include Message-ID: <20131218154253.GA18580@FreeBSD.org> References: <201312181453.rBIEranx037463@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181453.rBIEranx037463@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 15:42:53 -0000 On Wed, Dec 18, 2013 at 02:53:36PM +0000, Pedro F. Giffuni wrote: > New Revision: 259555 > URL: http://svnweb.freebsd.org/changeset/base/259555 > > Log: > gcc: add Apple compatible -Wnewline-eof > > GCC 4.2 and previous have always warned about > "No newline at end of file". > > Upstream GCC removed the warning completely but > Apple made it an optional warning. Adopt it for > compatibility with older GCC and clang. As someone who hates files that lack newline at EOF, I could never understand why they (upstream) removed this warning. ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 17:03:44 2013 Return-Path: Delivered-To: svn-src-all@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 59611443; Wed, 18 Dec 2013 17:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B7D71FD9; Wed, 18 Dec 2013 17:03:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIH3i6Z085124; Wed, 18 Dec 2013 17:03:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIH3iEb085123; Wed, 18 Dec 2013 17:03:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312181703.rBIH3iEb085123@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 18 Dec 2013 17:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259561 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 17:03:44 -0000 Author: marcel Date: Wed Dec 18 17:03:43 2013 New Revision: 259561 URL: http://svnweb.freebsd.org/changeset/base/259561 Log: Fix an inappropriate free of a non-dynamic value. While here, make the code more naive and robust: 1. When setting ev_value, also always set ev_flags appropriately 2. Always check ev_value and ev_flags before calling free. Both the value and the EV_DYNAMIC property can come directly from the consumers of the environment functionality, so it's good to be careful. And since this code is typically not looked at for long periods of time, it's good to have it be a little "dumb-looking". Trigger case for the bug: env_setenv("foo", 0, "1", NULL, NULL); env_setenv("foo", 0, "2", NULL, NULL); Obtained from: Juniper Networks, Inc. Modified: head/lib/libstand/environment.c Modified: head/lib/libstand/environment.c ============================================================================== --- head/lib/libstand/environment.c Wed Dec 18 16:14:35 2013 (r259560) +++ head/lib/libstand/environment.c Wed Dec 18 17:03:43 2013 (r259561) @@ -75,7 +75,14 @@ env_setenv(const char *name, int flags, * for one already. */ if ((ev->ev_sethook != NULL) && !(flags & EV_NOHOOK)) - return(ev->ev_sethook(ev, flags, value)); + return (ev->ev_sethook(ev, flags, value)); + + /* If there is data in the variable, discard it. */ + if (ev->ev_value != NULL && (ev->ev_flags & EV_DYNAMIC) != 0) + free(ev->ev_value); + ev->ev_value = NULL; + ev->ev_flags &= ~EV_DYNAMIC; + } else { /* @@ -84,6 +91,7 @@ env_setenv(const char *name, int flags, ev = malloc(sizeof(struct env_var)); ev->ev_name = strdup(name); ev->ev_value = NULL; + ev->ev_flags = 0; /* hooks can only be set when the variable is instantiated */ ev->ev_sethook = sethook; ev->ev_unsethook = unsethook; @@ -117,21 +125,16 @@ env_setenv(const char *name, int flags, } } } - - /* If there is data in the variable, discard it */ - if (ev->ev_value != NULL) - free(ev->ev_value); /* If we have a new value, use it */ if (flags & EV_VOLATILE) { ev->ev_value = strdup(value); + ev->ev_flags |= EV_DYNAMIC; } else { ev->ev_value = (char *)value; + ev->ev_flags |= flags & EV_DYNAMIC; } - /* Keep the flag components that are relevant */ - ev->ev_flags = flags & (EV_DYNAMIC); - return(0); } @@ -201,7 +204,7 @@ env_discard(struct env_var *ev) if (environ == ev) environ = ev->ev_next; free(ev->ev_name); - if (ev->ev_flags & EV_DYNAMIC) + if (ev->ev_value != NULL && (ev->ev_flags & EV_DYNAMIC) != 0) free(ev->ev_value); free(ev); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 18:25:27 2013 Return-Path: Delivered-To: svn-src-all@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 DABC07D5; Wed, 18 Dec 2013 18:25:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAAF516A8; Wed, 18 Dec 2013 18:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIIPRqd014516; Wed, 18 Dec 2013 18:25:27 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIIPR25014515; Wed, 18 Dec 2013 18:25:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312181825.rBIIPR25014515@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 18:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259562 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 18:25:27 -0000 Author: melifaro Date: Wed Dec 18 18:25:27 2013 New Revision: 259562 URL: http://svnweb.freebsd.org/changeset/base/259562 Log: Switch netstat -rn to use standard API for retrieving list of routes instead of peeking inside in-kernel radix via kget. This permits us to change kernel structures without breaking userland. Additionally, this change provide more reliable and faster output. `Refs` and `Use` fields available in IPv4 by default (and via -W for other families) were removed. `Refs` is radix-specific thing which is not informative for users. `Use` field value is handy sometimes, but a) current API does not support it and b) I'm not sure we will support per-rte pcpu counters in near future. Old method of retrieving data is still supported (either by defining NewTree=0 or running netstat with -A). However, Refs/Use fields are hidden. Sponsored by: Yandex LLC MFC after: 4 weeks PR: kern/167204 Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Dec 18 17:03:43 2013 (r259561) +++ head/usr.bin/netstat/route.c Wed Dec 18 18:25:27 2013 (r259562) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -113,13 +114,20 @@ typedef union { static sa_u pt_u; +struct ifmap_entry { + char ifname[IFNAMSIZ]; +}; + +static struct ifmap_entry *ifmap; +static int ifmap_size; + int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; struct radix_node_head **rt_tables; -int NewTree = 0; +int NewTree = 1; struct timespec uptime; @@ -129,7 +137,7 @@ static void size_cols_tree(struct radix_ static void size_cols_rtentry(struct rtentry *rt); static void p_tree(struct radix_node *); static void p_rtnode(void); -static void ntreestuff(void); +static void ntreestuff(int fibnum, int af); static void np_rtentry(struct rt_msghdr *); static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, @@ -175,7 +183,7 @@ routepr(u_long rtree, int fibnum) printf("\n"); if (Aflag == 0 && NewTree) - ntreestuff(); + ntreestuff(fibnum, af); else { if (rtree == 0) { printf("rt_tables: symbol not in namelist\n"); @@ -288,7 +296,7 @@ static int wid_if; static int wid_expire; static void -size_cols(int ef __unused, struct radix_node *rn) +size_cols(int ef, struct radix_node *rn) { wid_dst = WID_DST_DEFAULT(ef); wid_gw = WID_GW_DEFAULT(ef); @@ -299,7 +307,7 @@ size_cols(int ef __unused, struct radix_ wid_if = WID_IF_DEFAULT(ef); wid_expire = 6; - if (Wflag) + if (Wflag && rn != NULL) size_cols_tree(rn); } @@ -397,27 +405,14 @@ pr_rthdr(int af1) if (Aflag) printf("%-8.8s ","Address"); - if (af1 == AF_INET || Wflag) { - if (Wflag) { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_mtu, wid_mtu, "Mtu", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } else { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n", - wid_dst, wid_dst, "Destination", - wid_gw, wid_gw, "Gateway", - wid_flags, wid_flags, "Flags", - wid_refs, wid_refs, "Refs", - wid_use, wid_use, "Use", - wid_if, wid_if, "Netif", - wid_expire, "Expire"); - } + if (Wflag) { + printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*s\n", + wid_dst, wid_dst, "Destination", + wid_gw, wid_gw, "Gateway", + wid_flags, wid_flags, "Flags", + wid_mtu, wid_mtu, "Mtu", + wid_if, wid_if, "Netif", + wid_expire, "Expire"); } else { printf("%-*.*s %-*.*s %-*.*s %*.*s %*s\n", wid_dst, wid_dst, "Destination", @@ -522,20 +517,61 @@ p_rtnode(void) } static void -ntreestuff(void) +ntreestuff(int fibnum, int af) { size_t needed; - int mib[6]; + int mib[7]; char *buf, *next, *lim; struct rt_msghdr *rtm; + struct sockaddr *sa; + int fam = 0, ifindex = 0, size; + + struct ifaddrs *ifap, *ifa; + struct sockaddr_dl *sdl; + + /* + * Retrieve interface list at first + * since we need #ifindex -> if_xname match + */ + if (getifaddrs(&ifap) != 0) + err(EX_OSERR, "getifaddrs"); + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + ifindex = sdl->sdl_index; + + if (ifindex >= ifmap_size) { + size = roundup(ifindex + 1, 32) * + sizeof(struct ifmap_entry); + if ((ifmap = realloc(ifmap, size)) == NULL) + errx(2, "realloc(%d) failed", size); + memset(&ifmap[ifmap_size], 0, + size - ifmap_size * + sizeof(struct ifmap_entry)); + + ifmap_size = roundup(ifindex + 1, 32); + } + + if (*ifmap[ifindex].ifname != '\0') + continue; + + strlcpy(ifmap[ifindex].ifname, ifa->ifa_name, IFNAMSIZ); + } + + freeifaddrs(ifap); mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; - mib[3] = 0; + mib[3] = af; mib[4] = NET_RT_DUMP; mib[5] = 0; - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { + mib[6] = fibnum; + if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { err(1, "sysctl: net.route.0.0.dump estimate"); } @@ -548,6 +584,16 @@ ntreestuff(void) lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; + /* + * Peek inside header to determine AF + */ + sa = (struct sockaddr *)(rtm + 1); + if (fam != sa->sa_family) { + fam = sa->sa_family; + size_cols(fam, NULL); + pr_family(fam); + pr_rthdr(fam); + } np_rtentry(rtm); } } @@ -556,38 +602,52 @@ static void np_rtentry(struct rt_msghdr *rtm) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); -#ifdef notdef - static int masks_done, banner_printed; -#endif - static int old_af; - int af1 = 0, interesting = RTF_UP | RTF_GATEWAY | RTF_HOST; + char buffer[128]; + char prettyname[128]; + sa_u addr, mask, gw; + unsigned int l; + +#define GETSA(_s, _f) { \ + bzero(&(_s), sizeof(_s)); \ + if (rtm->rtm_addrs & _f) { \ + l = roundup(sa->sa_len, sizeof(long)); \ + memcpy(&(_s), sa, (l > sizeof(_s)) ? sizeof(_s) : l); \ + sa = (struct sockaddr *)((char *)sa + l); \ + } \ +} + + GETSA(addr, RTA_DST); + GETSA(gw, RTA_GATEWAY); + GETSA(mask, RTA_NETMASK); + p_sockaddr(&addr.u_sa, &mask.u_sa, rtm->rtm_flags, wid_dst); + p_sockaddr(&gw.u_sa, NULL, RTF_HOST, wid_gw); -#ifdef notdef - /* for the moment, netmasks are skipped over */ - if (!banner_printed) { - printf("Netmasks:\n"); - banner_printed = 1; - } - if (masks_done == 0) { - if (rtm->rtm_addrs != RTA_DST ) { - masks_done = 1; - af1 = sa->sa_family; - } - } else -#endif - af1 = sa->sa_family; - if (af1 != old_af) { - pr_family(af1); - old_af = af1; + snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); + p_flags(rtm->rtm_flags, buffer); + if (Wflag) { + if (rtm->rtm_rmx.rmx_mtu != 0) + printf("%*lu ", wid_mtu, rtm->rtm_rmx.rmx_mtu); + else + printf("%*s ", wid_mtu, ""); } - if (rtm->rtm_addrs == RTA_DST) - p_sockaddr(sa, NULL, 0, 36); - else { - p_sockaddr(sa, NULL, rtm->rtm_flags, 16); - sa = (struct sockaddr *)(SA_SIZE(sa) + (char *)sa); - p_sockaddr(sa, NULL, 0, 18); + + memset(prettyname, 0, sizeof(prettyname)); + if (rtm->rtm_index < ifmap_size) { + strlcpy(prettyname, ifmap[rtm->rtm_index].ifname, + sizeof(prettyname)); + if (*prettyname == '\0') + strlcpy(prettyname, "---", sizeof(prettyname)); } - p_flags(rtm->rtm_flags & interesting, "%-6.6s "); + + printf("%*.*s", wid_if, wid_if, prettyname); + if (rtm->rtm_rmx.rmx_expire) { + time_t expire_time; + + if ((expire_time = + rtm->rtm_rmx.rmx_expire - uptime.tv_sec) > 0) + printf(" %*d", wid_expire, (int)expire_time); + } + putchar('\n'); } @@ -775,8 +835,10 @@ p_rtentry(struct rtentry *rt) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); if (addr.u_sa.sa_family == AF_INET || Wflag) { +#if 0 printf("%*d %*lu ", wid_refs, rt->rt_refcnt, wid_use, rt->rt_use); +#endif if (Wflag) { if (rt->rt_rmx.rmx_mtu != 0) printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu); From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 18:45:14 2013 Return-Path: Delivered-To: svn-src-all@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 83B85D10; Wed, 18 Dec 2013 18:45:14 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42ABC181B; Wed, 18 Dec 2013 18:45:13 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBIIjCYO024231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Dec 2013 10:45:13 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBIIjCST024230; Wed, 18 Dec 2013 10:45:12 -0800 (PST) (envelope-from jmg) Date: Wed, 18 Dec 2013 10:45:12 -0800 From: John-Mark Gurney To: "Alexander V. Chernikov" Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131218184512.GM99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181825.rBIIPR25014515@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 18 Dec 2013 10:45:13 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 18:45:14 -0000 Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > Author: melifaro > Date: Wed Dec 18 18:25:27 2013 > New Revision: 259562 > URL: http://svnweb.freebsd.org/changeset/base/259562 > > Log: > Switch netstat -rn to use standard API for retrieving list of routes > instead of peeking inside in-kernel radix via kget. > This permits us to change kernel structures without breaking userland. > Additionally, this change provide more reliable and faster output. > > `Refs` and `Use` fields available in IPv4 by default (and via -W > for other families) were removed. `Refs` is radix-specific thing > which is not informative for users. `Use` field value is handy sometimes, > but a) current API does not support it and b) I'm not sure we will > support per-rte pcpu counters in near future. > > Old method of retrieving data is still supported (either by defining > NewTree=0 or running netstat with -A). However, Refs/Use fields are > hidden. > > Sponsored by: Yandex LLC > MFC after: 4 weeks > PR: kern/167204 How will this impact the use of netstat -rn -M vmcore -N kernel ? Will this change make it not usable, or will you still automatically use it when they are specified? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 18:56:50 2013 Return-Path: Delivered-To: svn-src-all@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 511F9407 for ; Wed, 18 Dec 2013 18:56:50 +0000 (UTC) Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com [98.139.212.165]) by mx1.freebsd.org (Postfix) with SMTP id E50A518DB for ; Wed, 18 Dec 2013 18:56:49 +0000 (UTC) Received: from [98.139.212.151] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:11 -0000 Received: from [98.139.211.203] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:10 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 18 Dec 2013 18:51:10 -0000 X-Yahoo-Newman-Id: 964958.65046.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Im98BsAVM1l4k1Fv4aZZcI7Uyu1V3v0mgRzHi58CxzGEZtC 9PTOiy6g3U4_4NdiFFxIIP1di88VHpjtQFEIrWBn5ncnCvYgT28Pcp4XSUJV TcBtSzp9IABJw16I6SAkKglcJ5KJKCeb_hY6BIhRwMUEm4X1qVrBD1dgJS1a nAVc92WmSq_tZ_32gOIyMMJKHs4rNGCKpmy2cWznFyJMYRvCME1BJXho2zMq AV91JCKzyEURKoL_TN.SycCWV.DweTJvu9a_.FM02mDY6bLLQ6yoLUMSinn8 PJ98ps.rx.EDmKYXHriZbHcdOHpgKnB5YDwlo48g8e3zwgAwIGKQgjViqYkP Rq5EkfISMTcM7eInQVLuTT33Si6PrpeRs10ijQRyAqrFoL5zvq2aRgoxMkO3 wWbuxNm8uDje15DBWJs2dk8TFUs4AqG0LKuF29zuapEQZEthzSDJ32L9HtRe lqlqH2lMyr9VvSevFDvk2CdxRLLC6W9NOxhhVTLCcbPiaB3mOGKGRSDXzSpm MRex4zgFRtiAWkd1jD4E3bzC0kgGVoC8JENyyhRREBa8aPwMcWKJnHtkF6ni c5_IhMnmkMiM0aCJGQ6tBhgYeCudGITuFT7MXOPkRNo1hdyhKnQEmyjE50_n nwmL1_wPlnMTAt8DKO14Yqs.Mdlz0mKQe8BLNHlz6JRPLpF8szxRZDojrwIp H4ZO3ZPoXvgE2T00iSmFkS4F.r6hV9_QZ90D2gpdnItjg X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp212.mail.bf1.yahoo.com with SMTP; 18 Dec 2013 10:51:05 -0800 PST Message-ID: <52B1EE95.3030104@FreeBSD.org> Date: Wed, 18 Dec 2013 13:51:01 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r259555 - in head/contrib: gcc gcc/doc gcclibs/libcpp gcclibs/libcpp/include References: <201312181453.rBIEranx037463@svn.freebsd.org> <20131218154253.GA18580@FreeBSD.org> In-Reply-To: <20131218154253.GA18580@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 18:56:50 -0000 On 18.12.2013 10:42, Alexey Dokuchaev wrote: > On Wed, Dec 18, 2013 at 02:53:36PM +0000, Pedro F. Giffuni wrote: >> New Revision: 259555 >> URL: http://svnweb.freebsd.org/changeset/base/259555 >> >> Log: >> gcc: add Apple compatible -Wnewline-eof >> >> GCC 4.2 and previous have always warned about >> "No newline at end of file". >> >> Upstream GCC removed the warning completely but >> Apple made it an optional warning. Adopt it for >> compatibility with older GCC and clang. > As someone who hates files that lack newline at EOF, I could never understand > why they (upstream) removed this warning. > > ./danfe The main discussion took place here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14331 FWIW, I like the warning too. Cheers, Pedro. From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 19:07:32 2013 Return-Path: Delivered-To: svn-src-all@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 C368887E; Wed, 18 Dec 2013 19:07:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB12419D0; Wed, 18 Dec 2013 19:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIJ7WT1029409; Wed, 18 Dec 2013 19:07:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIJ7ULB029390; Wed, 18 Dec 2013 19:07:30 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312181907.rBIJ7ULB029390@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 18 Dec 2013 19:07: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: r259563 - in stable/10: contrib/gcc contrib/gcc/config contrib/gcc/config/i386 contrib/gcc/config/rs6000 contrib/gcc/cp contrib/gcc/doc gnu/usr.bin/cc gnu/usr.bin/cc/cc_tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 19:07:32 -0000 Author: pfg Date: Wed Dec 18 19:07:29 2013 New Revision: 259563 URL: http://svnweb.freebsd.org/changeset/base/259563 Log: MFC r258428, r258445 gcc: another round of merges from the gcc pre-43 branch. Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Fix crosscompilation (r258445 by andreast) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks Added: stable/10/contrib/gcc/cp/ChangeLog.gcc43 - copied unchanged from r258428, head/contrib/gcc/cp/ChangeLog.gcc43 Modified: stable/10/contrib/gcc/ChangeLog.gcc43 stable/10/contrib/gcc/Makefile.in stable/10/contrib/gcc/builtin-types.def stable/10/contrib/gcc/builtins.c stable/10/contrib/gcc/builtins.def stable/10/contrib/gcc/cgraphunit.c stable/10/contrib/gcc/collect2.c stable/10/contrib/gcc/config/i386/beos-elf.h stable/10/contrib/gcc/config/i386/cygwin.h stable/10/contrib/gcc/config/i386/i386.c stable/10/contrib/gcc/config/i386/i386.h stable/10/contrib/gcc/config/i386/i386.md stable/10/contrib/gcc/config/i386/nto.h stable/10/contrib/gcc/config/rs6000/aix.h stable/10/contrib/gcc/config/rs6000/sysv4.h stable/10/contrib/gcc/config/svr4.h stable/10/contrib/gcc/configure stable/10/contrib/gcc/configure.ac stable/10/contrib/gcc/coverage.c stable/10/contrib/gcc/cp/decl2.c stable/10/contrib/gcc/cp/name-lookup.c stable/10/contrib/gcc/cppdefault.c stable/10/contrib/gcc/doc/extend.texi stable/10/contrib/gcc/doc/libgcc.texi stable/10/contrib/gcc/doc/rtl.texi stable/10/contrib/gcc/dwarf2out.c stable/10/contrib/gcc/expr.c stable/10/contrib/gcc/fold-const.c stable/10/contrib/gcc/gcc.c stable/10/contrib/gcc/genattrtab.c stable/10/contrib/gcc/genopinit.c stable/10/contrib/gcc/libgcc-std.ver stable/10/contrib/gcc/libgcc2.c stable/10/contrib/gcc/libgcc2.h stable/10/contrib/gcc/mips-tdump.c stable/10/contrib/gcc/mips-tfile.c stable/10/contrib/gcc/mklibgcc.in stable/10/contrib/gcc/optabs.c stable/10/contrib/gcc/optabs.h stable/10/contrib/gcc/reload1.c stable/10/contrib/gcc/rtl.def stable/10/contrib/gcc/simplify-rtx.c stable/10/contrib/gcc/tree-ssa-propagate.c stable/10/contrib/gcc/tree.c stable/10/contrib/gcc/tree.h stable/10/gnu/usr.bin/cc/Makefile.inc stable/10/gnu/usr.bin/cc/cc_tools/freebsd-native.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/ChangeLog.gcc43 Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/ChangeLog.gcc43 Wed Dec 18 19:07:29 2013 (r259563) @@ -10,6 +10,12 @@ * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-31 Eric Christopher + + * expr.c (convert_move): Assert that we don't have a BLKmode + operand. + (store_expr): Handle BLKmode moves by calling emit_block_move. + 2007-05-24 Richard Sandiford (r125037) * postreload-gcse.c (reg_changed_after_insn_p): New function. @@ -99,6 +105,12 @@ (dwarf2out_imported_module_or_decl): Suppress struct debug information using should_emit_struct_debug when appropriate. +2007-04-16 Ian Lance Taylor (r123906) + + * tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer + predecessors at head rather than tail. + + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -333,6 +345,28 @@ * doc/invoke.texi (Warning Options): Update -Wparentheses description. +2006-12-12 Geoffrey Keating (r119820) + + * mips-tdump.c: Replace CROSS_COMPILE with + CROSS_DIRECTORY_STRUCTURE. + * mips-tfile.c: Likewise. + * gcc.c: Likewise. + * configure.ac: Likewise. + * cppdefault.c: Likewise. + * Makefile.in: Likewise. + * config/alpha/osf.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/beos-elf.h: Likewise. + * config/i386/nto.h: Likewise. + * config/svr4.h: Likewise. + * config/rs6000/aix.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * collect2.c: Likewise. + * configure: Regenerate. + + * doc/tm.texi (Alignment Output): Document that ASM_OUTPUT_SKIP + actually takes an unsigned HOST_WIDE_INT for its second parameter. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -371,6 +405,30 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-11-07 Eric Christopher (r118576) + + * libgcc2.c (__bswapdi2): Rename from bswapDI2. + (__bswapsi2): Ditto. + * libgcc2.h: Remove transformation of bswap routines. + * config/i386/i386.md (bswapsi2): New. + (bswapdi2): Ditto. + +2006-10-31 Geoffrey Keating (r118360) + + * coverage.c (coverage_checksum_string): Update comment. + * dwarf2out.c (switch_to_eh_frame_section): Update for removal + of get_file_function_name. + * cgraphunit.c (cgraph_build_static_cdtor): Update for rename + of get_file_function_name_long. + * tree.c (get_file_function_name): Rename from + get_file_function_name_long; improve comment; handle 'I' and 'D' + specially when the target has ctor/dtor support; remove special + handling for 'F'. + (get_file_function_name): Remove. + * tree.h (get_file_function_name): Rename from + get_file_function_name_long. + (get_file_function_name): Remove prototype. + 2006-10-31 Geoffrey Keating (r118356) * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on @@ -521,3 +579,51 @@ * builtins.c (fold_builtin_classify): Fix typo. +2006-09-07 Eric Christopher (r118361) + Falk Hueffner + + * doc/extend.texi (__builtin_bswap32): Document. + (__builtin_bswap64): Ditto. + * doc/libgcc.texi (bswapsi2): Document. + (bswapdi2): Ditto. + * doc/rtl.texi (bswap): Document. + * optabs.c (expand_unop): Don't widen a bswap. + (init_optabs): Init bswap. Set libfuncs explicitly + for bswapsi2 and bswapdi2. + * optabs.h (OTI_bswap): New. + (bswap_optab): Ditto. + * genopinit.c (optabs): Handle bswap_optab. + * tree.h (tree_index): Add TI_UINT32_TYPE and + TI_UINT64_TYPE. + (uint32_type_node): New. + (uint64_type_node): Ditto. + * tree.c (build_common_tree_nodes_2): Initialize + uint32_type_node and uint64_type_node. + * builtins.c (expand_builtin_bswap): New. + (expand_builtin): Call. + (fold_builtin_bswap): New. + (fold_builtin_1): Call. + * fold-const.c (tree_expr_nonnegative_p): Return true + for bswap. + * builtin-types.def (BT_UINT32): New. + (BT_UINT64): Ditto. + (BT_FN_UINT32_UINT32): Ditto. + (BT_FN_UINT64_UINT64): Ditto. + * builtins.def (BUILT_IN_BSWAP32): New. + (BUILT_IN_BSWAP64): Ditto. + * rtl.def (BSWAP): New. + * genattrtab.c (check_attr_value): New. + * libgcc2.c (__bswapSI2): New. + (__bswapDI2): Ditto. + * libgcc2.h (__bswapSI2): Declare. + (__bswapDI2): Ditto. + * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. + * simplify-rtx.c (simplify_const_unary_operation): Return + 0 for BSWAP. + * libgcc-std.ver (__bwapsi2): Add. + (__bswapdi2): Ditto. + * reload1.c (eliminate_regs_1): Add bswap. + (elimination_effects): Ditto. + * config/i386/i386.h (x86_bswap): New. + (TARGET_BSWAP): Use. + * config/i386/i386.c (x86_bswap): Set. Modified: stable/10/contrib/gcc/Makefile.in ============================================================================== --- stable/10/contrib/gcc/Makefile.in Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/Makefile.in Wed Dec 18 19:07:29 2013 (r259563) @@ -822,7 +822,8 @@ REAL_H = real.h $(MACHMODE_H) # IN_GCC distinguishes between code compiled into GCC itself and other # programs built during a bootstrap. -# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler. +# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a +# cross compiler which does not use the native headers and libraries. INTERNAL_CFLAGS = -DIN_GCC @CROSS@ # This is the variable actually used when we compile. If you change this, Modified: stable/10/contrib/gcc/builtin-types.def ============================================================================== --- stable/10/contrib/gcc/builtin-types.def Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/builtin-types.def Wed Dec 18 19:07:29 2013 (r259563) @@ -75,6 +75,8 @@ DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_lo DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node) DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0)) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node) @@ -204,6 +206,10 @@ DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFL DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONGLONG_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) @@ -435,4 +441,3 @@ DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRIN DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE) - Modified: stable/10/contrib/gcc/builtins.c ============================================================================== --- stable/10/contrib/gcc/builtins.c Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/builtins.c Wed Dec 18 19:07:29 2013 (r259563) @@ -4589,6 +4589,30 @@ expand_builtin_alloca (tree arglist, rtx return result; } +/* Expand a call to a bswap builtin. The arguments are in ARGLIST. MODE + is the mode to expand with. */ + +static rtx +expand_builtin_bswap (tree arglist, rtx target, rtx subtarget) +{ + enum machine_mode mode; + tree arg; + rtx op0; + + if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + mode = TYPE_MODE (TREE_TYPE (arg)); + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + target = expand_unop (mode, bswap_optab, op0, target, 1); + + gcc_assert (target); + + return convert_to_mode (mode, target, 0); +} + /* Expand a call to a unary builtin. The arguments are in ARGLIST. Return 0 if a normal call should be emitted rather than expanding the function in-line. If convenient, the result should be placed in TARGET. @@ -5877,6 +5901,14 @@ expand_builtin (tree exp, rtx target, rt expand_stack_restore (TREE_VALUE (arglist)); return const0_rtx; + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + target = expand_builtin_bswap (arglist, target, subtarget); + + if (target) + return target; + break; + CASE_INT_FN (BUILT_IN_FFS): case BUILT_IN_FFSIMAX: target = expand_builtin_unop (target_mode, arglist, target, @@ -7539,6 +7571,67 @@ fold_builtin_bitop (tree fndecl, tree ar return NULL_TREE; } +/* Fold function call to builtin_bswap and the long and long long + variants. Return NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_bswap (tree fndecl, tree arglist) +{ + tree arg; + + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + /* Optimize constant value. */ + arg = TREE_VALUE (arglist); + if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg)) + { + HOST_WIDE_INT hi, width, r_hi = 0; + unsigned HOST_WIDE_INT lo, r_lo = 0; + tree type; + + type = TREE_TYPE (arg); + width = TYPE_PRECISION (type); + lo = TREE_INT_CST_LOW (arg); + hi = TREE_INT_CST_HIGH (arg); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + { + int s; + + for (s = 0; s < width; s += 8) + { + int d = width - s - 8; + unsigned HOST_WIDE_INT byte; + + if (s < HOST_BITS_PER_WIDE_INT) + byte = (lo >> s) & 0xff; + else + byte = (hi >> (s - HOST_BITS_PER_WIDE_INT)) & 0xff; + + if (d < HOST_BITS_PER_WIDE_INT) + r_lo |= byte << d; + else + r_hi |= byte << (d - HOST_BITS_PER_WIDE_INT); + } + } + + break; + + default: + gcc_unreachable (); + } + + if (width < HOST_BITS_PER_WIDE_INT) + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), r_lo); + else + return build_int_cst_wide (TREE_TYPE (TREE_TYPE (fndecl)), r_lo, r_hi); + } + + return NULL_TREE; +} /* Return true if EXPR is the real constant contained in VALUE. */ static bool @@ -9053,6 +9146,10 @@ fold_builtin_1 (tree fndecl, tree arglis CASE_FLT_FN (BUILT_IN_LLRINT): return fold_fixed_mathfn (fndecl, arglist); + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + return fold_builtin_bswap (fndecl, arglist); + CASE_INT_FN (BUILT_IN_FFS): CASE_INT_FN (BUILT_IN_CLZ): CASE_INT_FN (BUILT_IN_CTZ): Modified: stable/10/contrib/gcc/builtins.def ============================================================================== --- stable/10/contrib/gcc/builtins.def Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/builtins.def Wed Dec 18 19:07:29 2013 (r259563) @@ -594,6 +594,8 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) Modified: stable/10/contrib/gcc/cgraphunit.c ============================================================================== --- stable/10/contrib/gcc/cgraphunit.c Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/cgraphunit.c Wed Dec 18 19:07:29 2013 (r259563) @@ -1676,7 +1676,7 @@ cgraph_build_static_cdtor (char which, t tree decl, name, resdecl; sprintf (which_buf, "%c_%d", which, counter++); - name = get_file_function_name_long (which_buf); + name = get_file_function_name (which_buf); decl = build_decl (FUNCTION_DECL, name, build_function_type (void_type_node, void_list_node)); Modified: stable/10/contrib/gcc/collect2.c ============================================================================== --- stable/10/contrib/gcc/collect2.c Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/collect2.c Wed Dec 18 19:07:29 2013 (r259563) @@ -53,7 +53,7 @@ Software Foundation, 51 Franklin Street, the utilities are not correct for a cross-compiler; we have to hope that cross-versions are in the proper directories. */ -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #undef OBJECT_FORMAT_COFF #undef MD_EXEC_PREFIX #undef REAL_LD_FILE_NAME @@ -553,7 +553,7 @@ is_ctor_dtor (const char *s) static struct path_prefix cpath, path; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* This is the name of the target machine. We use it to form the name of the files to execute. */ @@ -746,7 +746,7 @@ main (int argc, char **argv) static const char *const strip_suffix = "strip"; static const char *const gstrip_suffix = "gstrip"; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* If we look for a program in the compiler directories, we just use the short name, since these directories are already system-specific. But it we look for a program in the system directories, we need to @@ -775,7 +775,7 @@ main (int argc, char **argv) #endif const char *const full_strip_suffix = strip_suffix; const char *const full_gstrip_suffix = gstrip_suffix; -#endif /* CROSS_COMPILE */ +#endif /* CROSS_DIRECTORY_STRUCTURE */ const char *arg; FILE *outf; @@ -957,7 +957,7 @@ main (int argc, char **argv) c_file_name = getenv ("COLLECT_GCC"); if (c_file_name == 0) { -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE c_file_name = concat (target_machine, "-gcc", NULL); #else c_file_name = "gcc"; Modified: stable/10/contrib/gcc/config/i386/beos-elf.h ============================================================================== --- stable/10/contrib/gcc/config/i386/beos-elf.h Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/config/i386/beos-elf.h Wed Dec 18 19:07:29 2013 (r259563) @@ -135,7 +135,7 @@ Boston, MA 02110-1301, USA. */ for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we use ANSI string concatenation here (FIXME) */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ @@ -177,7 +177,7 @@ Boston, MA 02110-1301, USA. */ { "/boot/develop/headers", 0, 0, 0 }, \ { 0, 0, 0, 0 } \ } -#else /* CROSS_COMPILE */ +#else /* CROSS_DIRECTORY_STRUCTURE */ #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ Modified: stable/10/contrib/gcc/config/i386/cygwin.h ============================================================================== --- stable/10/contrib/gcc/config/i386/cygwin.h Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/config/i386/cygwin.h Wed Dec 18 19:07:29 2013 (r259563) @@ -146,7 +146,7 @@ char cygwin_tool_include_dir[sizeof (TOO #undef TOOL_INCLUDE_DIR #define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir) -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/usr/include" char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1 Modified: stable/10/contrib/gcc/config/i386/i386.c ============================================================================== --- stable/10/contrib/gcc/config/i386/i386.c Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/config/i386/i386.c Wed Dec 18 19:07:29 2013 (r259563) @@ -1089,6 +1089,8 @@ const int x86_cmpxchg = ~m_386; const int x86_cmpxchg8b = ~(m_386 | m_486); /* Exchange and add was added for 80486. */ const int x86_xadd = ~m_386; +/* Byteswap was added for 80486. */ +const int x86_bswap = ~m_386; const int x86_pad_returns = m_ATHLON_K8_AMDFAM10 | m_CORE2 | m_GENERIC; /* In case the average insn count for single function invocation is Modified: stable/10/contrib/gcc/config/i386/i386.h ============================================================================== --- stable/10/contrib/gcc/config/i386/i386.h Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/config/i386/i386.h Wed Dec 18 19:07:29 2013 (r259563) @@ -168,6 +168,7 @@ extern const int x86_use_bt; extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd; extern const int x86_use_incdec; extern const int x86_pad_returns; +extern const int x86_bswap; extern const int x86_partial_flag_reg_stall; extern int x86_prefetch_sse, x86_cmpxchg16b; @@ -243,6 +244,7 @@ extern int x86_prefetch_sse, x86_cmpxchg #define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch)) #define TARGET_CMPXCHG16B (x86_cmpxchg16b) #define TARGET_XADD (x86_xadd & (1 << ix86_arch)) +#define TARGET_BSWAP (x86_bswap & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 Modified: stable/10/contrib/gcc/config/i386/i386.md ============================================================================== --- stable/10/contrib/gcc/config/i386/i386.md Wed Dec 18 18:25:27 2013 (r259562) +++ stable/10/contrib/gcc/config/i386/i386.md Wed Dec 18 19:07:29 2013 (r259563) @@ -284,14 +284,14 @@ (const_int 0))) ;; Set when string REP prefix is used. -(define_attr "prefix_rep" "" +(define_attr "prefix_rep" "" (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF")) (const_int 1) (const_int 0))) ;; Set when 0f opcode prefix is used. (define_attr "prefix_0f" "" - (if_then_else + (if_then_else (ior (eq_attr "type" "imovx,setcc,icmov,bitmanip") (eq_attr "unit" "sse,mmx")) (const_int 1) @@ -466,7 +466,7 @@ ;; All x87 floating point modes (define_mode_macro X87MODEF [SF DF XF]) - + ;; All integer modes handled by x87 fisttp operator. (define_mode_macro X87MODEI [HI SI DI]) @@ -475,7 +475,7 @@ ;; All SSE floating point modes (define_mode_macro SSEMODEF [SF DF]) - + ;; All integer modes handled by SSE cvtts?2si* operators. (define_mode_macro SSEMODEI24 [SI DI]) @@ -1098,7 +1098,7 @@ ;; Push/pop instructions. They are separate since autoinc/dec is not a ;; general_operand. ;; -;; %%% We don't use a post-inc memory reference because x86 is not a +;; %%% We don't use a post-inc memory reference because x86 is not a ;; general AUTO_INC_DEC host, which impacts how it is treated in flow. ;; Changing this impacts compiler performance on other non-AUTO_INC_DEC ;; targets without our curiosities, and it is just as easy to represent @@ -1160,7 +1160,7 @@ [(set_attr "type" "alu1") (set_attr "mode" "SI") (set_attr "length_immediate" "0")]) - + (define_insn "*movsi_or" [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "immediate_operand" "i")) @@ -2308,7 +2308,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], SFmode))" + || memory_operand (operands[0], SFmode))" { switch (which_alternative) { @@ -2368,7 +2368,7 @@ (const_string "V4SF")) /* For architectures resolving dependencies on whole SSE registers use APS move to break dependency - chains, otherwise use short move to avoid extra work. + chains, otherwise use short move to avoid extra work. Do the same for architectures resolving dependencies on the parts. While in DF mode it is better to always handle @@ -2476,7 +2476,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2596,7 +2596,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2712,10 +2712,10 @@ (match_operand:DF 1 "general_operand" ""))] "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -2807,7 +2807,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2841,7 +2841,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2875,10 +2875,10 @@ "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && GET_MODE (operands[0]) == XFmode - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -3073,7 +3073,7 @@ [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_operand:HI 0 "register_operand" "") @@ -3143,7 +3143,7 @@ [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_dup 0) @@ -3220,7 +3220,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3229,7 +3229,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3308,7 +3308,7 @@ (set_attr "mode" "DI")]) ;; Extend to memory case when source register does die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3323,7 +3323,7 @@ "split_di (&operands[0], 1, &operands[3], &operands[4]);") ;; Extend to memory case when source register does not die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3353,7 +3353,7 @@ ;; Extend to register case. Optimize case where source and destination ;; registers match and cases where we can use cltd. -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3482,7 +3482,7 @@ ;; These are all no-ops in the model used for the 80387. So just ;; emit moves. -;; %%% Kill these when call knows how to work out a DFmode push earlier. +;; %%% Kill these when call knows how to work out a DFmode push earlier. (define_insn "*dummy_extendsfdf2" [(set (match_operand:DF 0 "push_operand" "=<") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fY")))] @@ -4365,7 +4365,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4380,7 +4380,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4421,7 +4421,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4434,7 +4434,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4913,7 +4913,7 @@ (define_insn "*addsi3_carry_zext" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI + (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0")) (match_operand:SI 2 "general_operand" "rim")))) @@ -5222,7 +5222,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rme,re")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=r,rm") (plus:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5369,7 +5369,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rme")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:DI 0 "=r"))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5568,7 +5568,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm") (plus:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -5616,7 +5616,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5794,7 +5794,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM) @@ -5934,7 +5934,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm") (plus:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -6054,7 +6054,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:HI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" @@ -7483,7 +7483,7 @@ (match_operand:DF 2 "nonimmediate_operand" "")))] "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" "") - + (define_expand "divsf3" [(set (match_operand:SF 0 "register_operand" "") (div:SF (match_operand:SF 1 "register_operand" "") @@ -8161,7 +8161,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bq|x}\t{%1,%0|%0, %1}"; @@ -8226,7 +8226,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bl|x}\t{%1,%0|%0, %1}"; @@ -8270,7 +8270,7 @@ [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) @@ -8458,7 +8458,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8487,7 +8487,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_dup 1) (const_int 8) @@ -8503,7 +8503,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8521,7 +8521,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8864,7 +8864,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8881,7 +8881,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8900,7 +8900,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8919,7 +8919,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9202,7 +9202,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9219,7 +9219,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9238,7 +9238,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9257,7 +9257,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9325,7 +9325,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "!TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9346,7 +9346,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9368,7 +9368,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))])] "" @@ -9867,7 +9867,7 @@ enum machine_mode mode = GET_MODE (operands[0]); enum machine_mode vmode = GET_MODE (operands[2]); rtx tmp; - + operands[0] = simplify_gen_subreg (vmode, operands[0], mode, 0); operands[1] = simplify_gen_subreg (vmode, operands[1], mode, 0); if (operands_match_p (operands[0], operands[2])) @@ -9891,7 +9891,7 @@ "reload_completed" [(parallel [(set (match_dup 0) (match_dup 1)) (clobber (reg:CC FLAGS_REG))])] -{ +{ rtx tmp; operands[0] = gen_lowpart (SImode, operands[0]); if (GET_CODE (operands[1]) == ABS) @@ -9998,7 +9998,7 @@ operands[1] = tmp; }) -;; Conditionalize these after reload. If they match before reload, we +;; Conditionalize these after reload. If they match before reload, we ;; lose the clobber and ability to use integer instructions. (define_insn "*negsf2_1" @@ -11415,8 +11415,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11448,8 +11448,8 @@ && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11628,8 +11628,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11684,8 +11684,8 @@ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11785,8 +11785,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 19:23:06 2013 Return-Path: Delivered-To: svn-src-all@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 BDCB6E2F; Wed, 18 Dec 2013 19:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F57F1B3B; Wed, 18 Dec 2013 19:23:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIJN6QW036156; Wed, 18 Dec 2013 19:23:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIJN5v0036152; Wed, 18 Dec 2013 19:23:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312181923.rBIJN5v0036152@svn.freebsd.org> From: Xin LI Date: Wed, 18 Dec 2013 19:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259564 - in head: share/man/man4 sys/dev/arcmsr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 19:23:06 -0000 Author: delphij Date: Wed Dec 18 19:23:05 2013 New Revision: 259564 URL: http://svnweb.freebsd.org/changeset/base/259564 Log: Commit 1/2: update arcmsr(4) to 1.20.00.29 in order to add support of ARC-1883 SAS 12Gb/s RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Wed Dec 18 19:07:29 2013 (r259563) +++ head/share/man/man4/arcmsr.4 Wed Dec 18 19:23:05 2013 (r259564) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2013 +.Dd December 18, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -143,6 +143,8 @@ ARC-1681 ARC-1880 .It ARC-1882 +.It +ARC-1883 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:07:29 2013 (r259563) +++ head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:23:05 2013 (r259564) @@ -75,6 +75,7 @@ ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs +** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ****************************************************************************************** */ @@ -146,7 +147,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.29 2013-12-18" #include /* ************************************************************************** @@ -1438,7 +1439,7 @@ static u_int32_t arcmsr_Read_iop_rqbuffe u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1533,7 +1534,7 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *iop_data; int32_t allxfer_len=0; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1785,7 +1786,7 @@ static void arcmsr_hbd_message_isr(struc */ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1794,14 +1795,12 @@ static void arcmsr_hba_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_doorbell); - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_doorbell, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } } @@ -1811,7 +1810,7 @@ static void arcmsr_hba_doorbell_isr(stru */ static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1820,15 +1819,15 @@ static void arcmsr_hbc_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell); - CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { + if(doorbell_status & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } } @@ -1838,7 +1837,7 @@ static void arcmsr_hbc_doorbell_isr(stru */ static void arcmsr_hbd_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_Doorbell; + u_int32_t doorbell_status; /* ******************************************************************* @@ -1847,22 +1846,22 @@ static void arcmsr_hbd_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_Doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; - if(outbound_Doorbell) - CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_Doorbell); /* clear doorbell interrupt */ - while( outbound_Doorbell & ARCMSR_HBDMU_F0_DOORBELL_CAUSE ) { - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; + if(doorbell_status) + CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + while( doorbell_status & ARCMSR_HBDMU_F0_DOORBELL_CAUSE ) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - if(outbound_Doorbell & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { + if(doorbell_status & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbd_message_isr(acb); /* messenger of "driver to iop commands" */ } - outbound_Doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; - if(outbound_Doorbell) - CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_Doorbell); /* clear doorbell interrupt */ + doorbell_status = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_F0_DOORBELL_CAUSE; + if(doorbell_status) + CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ } } /* @@ -1932,9 +1931,7 @@ static void arcmsr_hbc_postqueue_isr(str ***************************************************************************** */ bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); - - while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { - + do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; @@ -1944,7 +1941,7 @@ static void arcmsr_hbc_postqueue_isr(str CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; } - } /*drain reply FIFO*/ + } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); } /* ********************************************************************** @@ -2082,11 +2079,14 @@ static void arcmsr_handle_hbc_isr( struc ** check outbound intstatus ********************************************* */ - host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); + host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & + (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR); if(!host_interrupt_status) { /*it must be share irq*/ return; } + do { /* MU doorbell interrupts*/ if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { arcmsr_hbc_doorbell_isr(acb); @@ -2095,6 +2095,8 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } + host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); } /* ********************************************************************** @@ -2882,7 +2884,9 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + if(acb->adapter_bus_speed == ACB_BUS_SPEED_12G) + cpi->base_transfer_speed = 1200000; + else if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) cpi->base_transfer_speed = 600000; else cpi->base_transfer_speed = 300000; @@ -2980,7 +2984,9 @@ static void arcmsr_action(struct cam_sim cts->transport = XPORT_SAS; sas = &cts->xport_specific.sas; sas->valid = CTS_SAS_VALID_SPEED; - if((acb->vendor_device_id == PCIDevVenIDARC1880) || + if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + sas->bitrate = 1200000; + else if((acb->vendor_device_id == PCIDevVenIDARC1880) || (acb->vendor_device_id == PCIDevVenIDARC1214)) sas->bitrate = 600000; else if(acb->vendor_device_id == PCIDevVenIDARC1680) @@ -3948,12 +3954,16 @@ static u_int32_t arcmsr_initialize(devic vendor_dev_id = pci_get_devid(dev); acb->vendor_device_id = vendor_dev_id; + acb->sub_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); switch (vendor_dev_id) { case PCIDevVenIDARC1880: case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: { acb->adapter_type = ACB_ADAPTER_TYPE_C; + if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + acb->adapter_bus_speed = ACB_BUS_SPEED_12G; + else acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } @@ -4286,7 +4296,7 @@ static int arcmsr_attach(device_t dev) * Create device queue of SIM(s) * (MAX_START_JOB - 1) : * max_sim_transactions */ - devq = cam_simq_alloc(ARCMSR_MAX_START_JOB); + devq = cam_simq_alloc(acb->maxOutstanding); if(devq == NULL) { arcmsr_free_resource(acb); bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres); @@ -4360,6 +4370,7 @@ static int arcmsr_attach(device_t dev) static int arcmsr_probe(device_t dev) { u_int32_t id; + u_int16_t sub_device_id; static char buf[256]; char x_type[]={"unknown"}; char *type; @@ -4368,6 +4379,7 @@ static int arcmsr_probe(device_t dev) if (pci_get_vendor(dev) != PCI_VENDOR_ID_ARECA) { return (ENXIO); } + sub_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); switch(id = pci_get_devid(dev)) { case PCIDevVenIDARC1110: case PCIDevVenIDARC1200: @@ -4400,6 +4412,9 @@ static int arcmsr_probe(device_t dev) case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: + if (sub_device_id == ARECA_SUB_DEV_ID_1883) + type = "SAS 12G"; + else type = "SAS 6G"; break; case PCIDevVenIDARC1214: Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:07:29 2013 (r259563) +++ head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:23:05 2013 (r259564) @@ -118,6 +118,7 @@ #define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1883 0x1883 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ @@ -1136,16 +1137,16 @@ struct AdapterControlBlock { u_int32_t phyadd_low; u_int32_t phyadd_high; }B; - } srb_phyaddr; + }srb_phyaddr; // unsigned long srb_phyaddr; /* Offset is used in making arc cdb physical to virtual calculations */ u_int32_t outbound_int_enable; struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ - u_int8_t adapter_index; /* */ + u_int8_t adapter_index; u_int8_t irq; - u_int16_t acb_flags; /* */ + u_int16_t acb_flags; struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ @@ -1183,6 +1184,7 @@ struct AdapterControlBlock { u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; u_int32_t maxOutstanding; + u_int16_t sub_device_id; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 19:25:41 2013 Return-Path: Delivered-To: svn-src-all@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 158A6FB5; Wed, 18 Dec 2013 19:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 012D81B6A; Wed, 18 Dec 2013 19:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIJPerI036471; Wed, 18 Dec 2013 19:25:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIJPeN3036469; Wed, 18 Dec 2013 19:25:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312181925.rBIJPeN3036469@svn.freebsd.org> From: Xin LI Date: Wed, 18 Dec 2013 19:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259565 - head/sys/dev/arcmsr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 19:25:41 -0000 Author: delphij Date: Wed Dec 18 19:25:40 2013 New Revision: 259565 URL: http://svnweb.freebsd.org/changeset/base/259565 Log: Commit 2/2: vendor whitespace changes to the driver. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:23:05 2013 (r259564) +++ head/sys/dev/arcmsr/arcmsr.c Wed Dec 18 19:25:40 2013 (r259565) @@ -1934,13 +1934,13 @@ static void arcmsr_hbc_postqueue_isr(str do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); - throttling++; - if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + throttling++; + if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; - } + } } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); } /* @@ -2087,14 +2087,14 @@ static void arcmsr_handle_hbc_isr( struc return; } do { - /* MU doorbell interrupts*/ - if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { - arcmsr_hbc_doorbell_isr(acb); - } - /* MU post queue interrupts*/ - if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { - arcmsr_hbc_postqueue_isr(acb); - } + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbc_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbc_postqueue_isr(acb); + } host_interrupt_status = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status); } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); } @@ -3964,7 +3964,7 @@ static u_int32_t arcmsr_initialize(devic if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) acb->adapter_bus_speed = ACB_BUS_SPEED_12G; else - acb->adapter_bus_speed = ACB_BUS_SPEED_6G; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } break; @@ -4415,7 +4415,7 @@ static int arcmsr_probe(device_t dev) if (sub_device_id == ARECA_SUB_DEV_ID_1883) type = "SAS 12G"; else - type = "SAS 6G"; + type = "SAS 6G"; break; case PCIDevVenIDARC1214: type = "SATA 6G"; Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:23:05 2013 (r259564) +++ head/sys/dev/arcmsr/arcmsr.h Wed Dec 18 19:25:40 2013 (r259565) @@ -34,23 +34,23 @@ ************************************************************************** * $FreeBSD$ */ -#define ARCMSR_SCSI_INITIATOR_ID 255 -#define ARCMSR_DEV_SECTOR_SIZE 512 -#define ARCMSR_MAX_XFER_SECTORS 4096 -#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ -#define ARCMSR_MAX_TARGETLUN 8 /*8*/ -#define ARCMSR_MAX_CHIPTYPE_NUM 4 -#define ARCMSR_MAX_OUTSTANDING_CMD 256 -#define ARCMSR_MAX_START_JOB 256 -#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 384 -#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ -#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ -#define ARCMSR_MAX_ADAPTER 4 -#define ARCMSR_RELEASE_SIMQ_LEVEL 230 -#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ -#define ARCMSR_MAX_HBD_POSTQUEUE 256 -#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ +#define ARCMSR_SCSI_INITIATOR_ID 255 +#define ARCMSR_DEV_SECTOR_SIZE 512 +#define ARCMSR_MAX_XFER_SECTORS 4096 +#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ +#define ARCMSR_MAX_TARGETLUN 8 /*8*/ +#define ARCMSR_MAX_CHIPTYPE_NUM 4 +#define ARCMSR_MAX_OUTSTANDING_CMD 256 +#define ARCMSR_MAX_START_JOB 256 +#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD +#define ARCMSR_MAX_FREESRB_NUM 384 +#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ +#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ +#define ARCMSR_MAX_ADAPTER 4 +#define ARCMSR_RELEASE_SIMQ_LEVEL 230 +#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_MAX_HBD_POSTQUEUE 256 +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -75,7 +75,7 @@ #define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l) #define ARCMSR_LOCK_TRY(l) mtx_trylock(l) #define arcmsr_htole32(x) htole32(x) - typedef struct mtx arcmsr_lock_t; + typedef struct mtx arcmsr_lock_t; #else #define ARCMSR_LOCK_INIT(l, s) simple_lock_init(l) #define ARCMSR_LOCK_DESTROY(l) @@ -91,7 +91,7 @@ ** ********************************************************************************** */ -#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ +#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ #define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ @@ -133,11 +133,11 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -149,7 +149,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -176,17 +176,17 @@ ** ********************************************************************************** */ -#define arcmsr_ccbsrb_ptr spriv_ptr0 -#define arcmsr_ccbacb_ptr spriv_ptr1 -#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) -#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) -#define get_min(x,y) ((x) < (y) ? (x) : (y)) -#define get_max(x,y) ((x) < (y) ? (y) : (x)) +#define arcmsr_ccbsrb_ptr spriv_ptr0 +#define arcmsr_ccbacb_ptr spriv_ptr1 +#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) +#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) +#define get_min(x,y) ((x) < (y) ? (x) : (y)) +#define get_max(x,y) ((x) < (y) ? (y) : (x)) /* ************************************************************************** ************************************************************************** */ -#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) +#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) #define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d) /* ********************************************************************************** @@ -210,17 +210,17 @@ struct CMD_MESSAGE_FIELD { /************************************************************************/ /************************************************************************/ -#define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001 -#define ARCMSR_IOP_ERROR_VENDORID 0x0002 -#define ARCMSR_IOP_ERROR_DEVICEID 0x0002 -#define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003 -#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004 -#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005 -#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006 -#define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007 -#define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008 -#define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009 -#define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A +#define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001 +#define ARCMSR_IOP_ERROR_VENDORID 0x0002 +#define ARCMSR_IOP_ERROR_DEVICEID 0x0002 +#define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003 +#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004 +#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005 +#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006 +#define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007 +#define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008 +#define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009 +#define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A /*DeviceType*/ #define ARECA_SATA_RAID 0x90000000 @@ -252,44 +252,44 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD) /* ARECA IOCTL ReturnCode */ -#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 -#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 -#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F -#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 +#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 +#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 +#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F +#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 /* ************************************************************************ ** SPEC. for Areca HBA adapter ************************************************************************ */ /* signature of set and get firmware config */ -#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 -#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 +#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 +#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 /* message code of inbound message register */ -#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 -#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 -#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 -#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 -#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 -#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 -#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 -#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 -#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 +#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 +#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 +#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 +#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 +#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 +#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 +#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 +#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 +#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 /* doorbell interrupt generator */ -#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 -#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 -#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 -#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 +#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 +#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 +#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 +#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 /* srb areca cdb flag */ -#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 -#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 +#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 +#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 /* outbound firmware ok */ -#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 +#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 -#define ARCMSR_ARC1680_BUS_RESET 0x00000003 +#define ARCMSR_ARC1680_BUS_RESET 0x00000003 /* ************************************************************************ ** SPEC. for Areca HBB adapter @@ -307,20 +307,20 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_IOP2DRV_CDB_DONE 0x00000004 #define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE 0x00000008 -#define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F +#define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F #define ARCMSR_DOORBELL_INT_CLEAR_PATTERN 0xFF00FFF0 #define ARCMSR_MESSAGE_INT_CLEAR_PATTERN 0xFF00FFF7 -#define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ #define ARCMSR_MESSAGE_FLUSH_CACHE 0x00050008 /* (ARCMSR_INBOUND_MESG0_FLUSH_CACHE<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ -#define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008 -#define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008 -#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008 -#define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */ +#define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ +#define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008 +#define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008 +#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008 +#define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */ #define ARCMSR_DRV2IOP_DATA_WRITE_OK 0x00000001 /* ioctl transfer */ #define ARCMSR_DRV2IOP_DATA_READ_OK 0x00000002 /* ioctl transfer */ @@ -329,13 +329,13 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_DRV2IOP_END_OF_INTERRUPT 0x00000010 /* */ /* data tunnel buffer between user space program and its firmware */ -#define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */ -#define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */ -#define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */ -#define ARCMSR_HBB_BASE0_OFFSET 0x00000010 -#define ARCMSR_HBB_BASE1_OFFSET 0x00000018 -#define ARCMSR_HBB_BASE0_LEN 0x00021000 -#define ARCMSR_HBB_BASE1_LEN 0x00010000 +#define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */ +#define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */ +#define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */ +#define ARCMSR_HBB_BASE0_OFFSET 0x00000010 +#define ARCMSR_HBB_BASE1_OFFSET 0x00000018 +#define ARCMSR_HBB_BASE0_LEN 0x00021000 +#define ARCMSR_HBB_BASE1_LEN 0x00010000 /* ************************************************************************ ** SPEC. for Areca HBC adapter @@ -383,64 +383,64 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR 0x00000004/*outbound DATA READ isr door bell clear*/ #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008/*outbound message 0 ready*/ #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR 0x00000008/*outbound message cmd isr door bell clear*/ -#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/ +#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/ #define ARCMSR_HBCMU_RESET_ADAPTER 0x00000024 -#define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080 +#define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080 /* ************************************************************************ ** SPEC. for Areca HBD adapter ************************************************************************ */ -#define ARCMSR_HBDMU_CHIP_ID 0x00004 +#define ARCMSR_HBDMU_CHIP_ID 0x00004 #define ARCMSR_HBDMU_CPU_MEMORY_CONFIGURATION 0x00008 -#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034 -#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200 +#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034 +#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200 #define ARCMSR_HBDMU_PCIE_F0_INTERRUPT_ENABLE 0x0020C -#define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400 -#define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404 -#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420 -#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424 -#define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460 -#define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480 +#define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400 +#define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404 +#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420 +#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424 +#define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460 +#define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480 #define ARCMSR_HBDMU_OUTBOUND_DOORBELL_ENABLE 0x00484 -#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000 -#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004 +#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000 +#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004 #define ARCMSR_HBDMU_INBOUND_LIST_WRITE_POINTER 0x01018 -#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060 +#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060 #define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_HIGH 0x01064 #define ARCMSR_HBDMU_OUTBOUND_LIST_COPY_POINTER 0x0106C #define ARCMSR_HBDMU_OUTBOUND_LIST_READ_POINTER 0x01070 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_CAUSE 0x01088 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_ENABLE 0x0108C -#define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000 -#define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100 -#define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200 +#define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000 +#define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100 +#define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200 -#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16 -#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20 +#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16 +#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20 /* Host Interrupt Mask */ -#define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */ -#define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */ +#define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */ +#define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */ /* Host Interrupt Status */ -#define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010 -#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000 -#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010 +#define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010 +#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000 +#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010 /* DoorBell*/ -#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001 -#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002 +#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001 +#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002 -#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001 -#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002 +#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001 +#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002 /*outbound message 0 ready*/ #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE 0x02000000 -#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003 +#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003 /*outbound message cmd isr door bell clear*/ #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR 0x02000000 @@ -450,7 +450,7 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001 /*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/ -#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 +#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 /* ********************************************************************* ** Message Unit structure @@ -458,28 +458,28 @@ struct CMD_MESSAGE_FIELD { */ struct HBA_MessageUnit { - u_int32_t resrved0[4]; /*0000 000F*/ - u_int32_t inbound_msgaddr0; /*0010 0013*/ - u_int32_t inbound_msgaddr1; /*0014 0017*/ - u_int32_t outbound_msgaddr0; /*0018 001B*/ - u_int32_t outbound_msgaddr1; /*001C 001F*/ - u_int32_t inbound_doorbell; /*0020 0023*/ - u_int32_t inbound_intstatus; /*0024 0027*/ - u_int32_t inbound_intmask; /*0028 002B*/ - u_int32_t outbound_doorbell; /*002C 002F*/ - u_int32_t outbound_intstatus; /*0030 0033*/ - u_int32_t outbound_intmask; /*0034 0037*/ - u_int32_t reserved1[2]; /*0038 003F*/ - u_int32_t inbound_queueport; /*0040 0043*/ - u_int32_t outbound_queueport; /*0044 0047*/ - u_int32_t reserved2[2]; /*0048 004F*/ - u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/ - u_int32_t reserved4[128]; /*0800 09FF 128*/ - u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/ - u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/ - u_int32_t reserved5[32]; /*0E80 0EFF 32*/ - u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/ - u_int32_t reserved6[32]; /*0F80 0FFF 32*/ + u_int32_t resrved0[4]; /*0000 000F*/ + u_int32_t inbound_msgaddr0; /*0010 0013*/ + u_int32_t inbound_msgaddr1; /*0014 0017*/ + u_int32_t outbound_msgaddr0; /*0018 001B*/ + u_int32_t outbound_msgaddr1; /*001C 001F*/ + u_int32_t inbound_doorbell; /*0020 0023*/ + u_int32_t inbound_intstatus; /*0024 0027*/ + u_int32_t inbound_intmask; /*0028 002B*/ + u_int32_t outbound_doorbell; /*002C 002F*/ + u_int32_t outbound_intstatus; /*0030 0033*/ + u_int32_t outbound_intmask; /*0034 0037*/ + u_int32_t reserved1[2]; /*0038 003F*/ + u_int32_t inbound_queueport; /*0040 0043*/ + u_int32_t outbound_queueport; /*0044 0047*/ + u_int32_t reserved2[2]; /*0048 004F*/ + u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/ + u_int32_t reserved4[128]; /*0800 09FF 128*/ + u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/ + u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/ + u_int32_t reserved5[32]; /*0E80 0EFF 32*/ + u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/ + u_int32_t reserved6[32]; /*0F80 0FFF 32*/ }; /* ********************************************************************* @@ -488,11 +488,11 @@ struct HBA_MessageUnit */ struct HBB_DOORBELL { - u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */ - u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */ - u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */ - u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */ - u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */ + u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */ + u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */ + u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */ + u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */ + u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */ }; /* ********************************************************************* @@ -501,11 +501,11 @@ struct HBB_DOORBELL */ struct HBB_RWBUFFER { - u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */ - u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */ - u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */ - u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/ - u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */ + u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */ + u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */ + u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */ + u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/ + u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */ }; /* ********************************************************************* @@ -514,10 +514,10 @@ struct HBB_RWBUFFER */ struct HBB_MessageUnit { - u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */ - u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */ - int32_t postq_index; /* post queue index */ - int32_t doneq_index; /* done queue index */ + u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */ + u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */ + int32_t postq_index; /* post queue index */ + int32_t doneq_index; /* done queue index */ struct HBB_DOORBELL *hbb_doorbell; struct HBB_RWBUFFER *hbb_rwbuffer; }; @@ -531,71 +531,71 @@ struct HBC_MessageUnit { u_int32_t message_unit_status; /*0000 0003*/ u_int32_t slave_error_attribute; /*0004 0007*/ u_int32_t slave_error_address; /*0008 000B*/ - u_int32_t posted_outbound_doorbell; /*000C 000F*/ + u_int32_t posted_outbound_doorbell; /*000C 000F*/ u_int32_t master_error_attribute; /*0010 0013*/ - u_int32_t master_error_address_low; /*0014 0017*/ - u_int32_t master_error_address_high; /*0018 001B*/ + u_int32_t master_error_address_low; /*0014 0017*/ + u_int32_t master_error_address_high; /*0018 001B*/ u_int32_t hcb_size; /*001C 001F size of the PCIe window used for HCB_Mode accesses*/ - u_int32_t inbound_doorbell; /*0020 0023*/ - u_int32_t diagnostic_rw_data; /*0024 0027*/ - u_int32_t diagnostic_rw_address_low; /*0028 002B*/ - u_int32_t diagnostic_rw_address_high; /*002C 002F*/ - u_int32_t host_int_status; /*0030 0033 host interrupt status*/ - u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ - u_int32_t dcr_data; /*0038 003B*/ - u_int32_t dcr_address; /*003C 003F*/ - u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ - u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ - u_int32_t hcb_pci_address_low; /*0048 004B*/ - u_int32_t hcb_pci_address_high; /*004C 004F*/ - u_int32_t iop_int_status; /*0050 0053*/ - u_int32_t iop_int_mask; /*0054 0057*/ - u_int32_t iop_inbound_queue_port; /*0058 005B*/ - u_int32_t iop_outbound_queue_port; /*005C 005F*/ - u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/ - u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/ - u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/ - u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/ - u_int32_t inbound_doorbell_clear; /*0070 0073*/ - u_int32_t i2o_message_unit_control; /*0074 0077*/ - u_int32_t last_used_message_source_address_low; /*0078 007B*/ - u_int32_t last_used_message_source_address_high; /*007C 007F*/ - u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/ - u_int32_t message_dest_address_index; /*0090 0093*/ - u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ - u_int32_t utility_A_int_counter_timer; /*0098 009B*/ - u_int32_t outbound_doorbell; /*009C 009F*/ - u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ - u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/ - u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/ - u_int32_t reserved0; /*00AC 00AF*/ - u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ - u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ - u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ - u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ - u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ - u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ - u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ - u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ - u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ - u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ - u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ - u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ - u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/ - u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/ - u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/ - u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/ - u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/ - u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/ - u_int32_t host_diagnostic; /*00F8 00FB*/ - u_int32_t write_sequence; /*00FC 00FF*/ - u_int32_t reserved1[34]; /*0100 0187*/ - u_int32_t reserved2[1950]; /*0188 1FFF*/ - u_int32_t message_wbuffer[32]; /*2000 207F*/ - u_int32_t reserved3[32]; /*2080 20FF*/ - u_int32_t message_rbuffer[32]; /*2100 217F*/ - u_int32_t reserved4[32]; /*2180 21FF*/ - u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ + u_int32_t inbound_doorbell; /*0020 0023*/ + u_int32_t diagnostic_rw_data; /*0024 0027*/ + u_int32_t diagnostic_rw_address_low; /*0028 002B*/ + u_int32_t diagnostic_rw_address_high; /*002C 002F*/ + u_int32_t host_int_status; /*0030 0033 host interrupt status*/ + u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ + u_int32_t dcr_data; /*0038 003B*/ + u_int32_t dcr_address; /*003C 003F*/ + u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ + u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ + u_int32_t hcb_pci_address_low; /*0048 004B*/ + u_int32_t hcb_pci_address_high; /*004C 004F*/ + u_int32_t iop_int_status; /*0050 0053*/ + u_int32_t iop_int_mask; /*0054 0057*/ + u_int32_t iop_inbound_queue_port; /*0058 005B*/ + u_int32_t iop_outbound_queue_port; /*005C 005F*/ + u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/ + u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/ + u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/ + u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/ + u_int32_t inbound_doorbell_clear; /*0070 0073*/ + u_int32_t i2o_message_unit_control; /*0074 0077*/ + u_int32_t last_used_message_source_address_low; /*0078 007B*/ + u_int32_t last_used_message_source_address_high; /*007C 007F*/ + u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/ + u_int32_t message_dest_address_index; /*0090 0093*/ + u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ + u_int32_t utility_A_int_counter_timer; /*0098 009B*/ + u_int32_t outbound_doorbell; /*009C 009F*/ + u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ + u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/ + u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/ + u_int32_t reserved0; /*00AC 00AF*/ + u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ + u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ + u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ + u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ + u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ + u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ + u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ + u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ + u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ + u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ + u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ + u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ + u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/ + u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/ + u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/ + u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/ + u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/ + u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/ + u_int32_t host_diagnostic; /*00F8 00FB*/ + u_int32_t write_sequence; /*00FC 00FF*/ + u_int32_t reserved1[34]; /*0100 0187*/ + u_int32_t reserved2[1950]; /*0188 1FFF*/ + u_int32_t message_wbuffer[32]; /*2000 207F*/ + u_int32_t reserved3[32]; /*2080 20FF*/ + u_int32_t message_rbuffer[32]; /*2100 217F*/ + u_int32_t reserved4[32]; /*2180 21FF*/ + u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ }; /* ********************************************************************* @@ -617,46 +617,46 @@ struct OutBound_SRB { struct HBD_MessageUnit { uint32_t reserved0; uint32_t chip_id; //0x0004 - uint32_t cpu_mem_config; //0x0008 - uint32_t reserved1[10]; //0x000C + uint32_t cpu_mem_config; //0x0008 + uint32_t reserved1[10]; //0x000C uint32_t i2o_host_interrupt_mask; //0x0034 - uint32_t reserved2[114]; //0x0038 - uint32_t host_int_status; //0x0200 - uint32_t host_int_enable; //0x0204 - uint32_t reserved3[1]; //0x0208 - uint32_t pcief0_int_enable; //0x020C - uint32_t reserved4[124]; //0x0210 - uint32_t inbound_msgaddr0; //0x0400 - uint32_t inbound_msgaddr1; //0x0404 - uint32_t reserved5[6]; //0x0408 - uint32_t outbound_msgaddr0; //0x0420 - uint32_t outbound_msgaddr1; //0x0424 - uint32_t reserved6[14]; //0x0428 - uint32_t inbound_doorbell; //0x0460 - uint32_t reserved7[7]; //0x0464 - uint32_t outbound_doorbell; //0x0480 + uint32_t reserved2[114]; //0x0038 + uint32_t host_int_status; //0x0200 + uint32_t host_int_enable; //0x0204 + uint32_t reserved3[1]; //0x0208 + uint32_t pcief0_int_enable; //0x020C + uint32_t reserved4[124]; //0x0210 + uint32_t inbound_msgaddr0; //0x0400 + uint32_t inbound_msgaddr1; //0x0404 + uint32_t reserved5[6]; //0x0408 + uint32_t outbound_msgaddr0; //0x0420 + uint32_t outbound_msgaddr1; //0x0424 + uint32_t reserved6[14]; //0x0428 + uint32_t inbound_doorbell; //0x0460 + uint32_t reserved7[7]; //0x0464 + uint32_t outbound_doorbell; //0x0480 uint32_t outbound_doorbell_enable; //0x0484 uint32_t reserved8[734]; //0x0488 - uint32_t inboundlist_base_low; //0x1000 - uint32_t inboundlist_base_high; //0x1004 - uint32_t reserved9[4]; //0x1008 + uint32_t inboundlist_base_low; //0x1000 + uint32_t inboundlist_base_high; //0x1004 + uint32_t reserved9[4]; //0x1008 uint32_t inboundlist_write_pointer; //0x1018 uint32_t inboundlist_read_pointer; //0x101C uint32_t reserved10[16]; //0x1020 - uint32_t outboundlist_base_low; //0x1060 + uint32_t outboundlist_base_low; //0x1060 uint32_t outboundlist_base_high; //0x1064 - uint32_t reserved11; //0x1068 + uint32_t reserved11; //0x1068 uint32_t outboundlist_copy_pointer; //0x106C uint32_t outboundlist_read_pointer; //0x1070 0x1072 - uint32_t reserved12[5]; //0x1074 + uint32_t reserved12[5]; //0x1074 uint32_t outboundlist_interrupt_cause; //0x1088 uint32_t outboundlist_interrupt_enable; //0x108C uint32_t reserved13[988]; //0x1090 - uint32_t message_wbuffer[32]; //0x2000 + uint32_t message_wbuffer[32]; //0x2000 uint32_t reserved14[32]; //0x2080 - uint32_t message_rbuffer[32]; //0x2100 + uint32_t message_rbuffer[32]; //0x2100 uint32_t reserved15[32]; //0x2180 - uint32_t msgcode_rwbuffer[256]; //0x2200 + uint32_t msgcode_rwbuffer[256]; //0x2200 }; struct HBD_MessageUnit0 { @@ -675,10 +675,10 @@ struct HBD_MessageUnit0 { struct MessageUnit_UNION { union { - struct HBA_MessageUnit hbamu; - struct HBB_MessageUnit hbbmu; - struct HBC_MessageUnit hbcmu; - struct HBD_MessageUnit0 hbdmu; + struct HBA_MessageUnit hbamu; + struct HBB_MessageUnit hbbmu; + struct HBC_MessageUnit hbcmu; + struct HBD_MessageUnit0 hbdmu; } muu; }; /* @@ -686,7 +686,7 @@ struct MessageUnit_UNION ** structure for holding DMA address data ************************************************************* */ -#define IS_SG64_ADDR 0x01000000 /* bit24 */ +#define IS_SG64_ADDR 0x01000000 /* bit24 */ /* ************************************************************************************************ ** ARECA FIRMWARE SPEC @@ -695,10 +695,10 @@ struct MessageUnit_UNION ** (All In/Out is in IOP331's view) ** 1. Message 0 --> InitThread message and retrun code ** 2. Doorbell is used for RS-232 emulation -** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK) -** bit1 -- data out has been read (DRIVER DATA READ OK) -** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK) -** bit1 -- data in has been read (IOP331 DATA READ OK) +** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK) +** bit1 -- data out has been read (DRIVER DATA READ OK) +** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK) +** bit1 -- data in has been read (IOP331 DATA READ OK) ** 3. Index Memory Usage ** offset 0xf00 : for RS232 out (request buffer) ** offset 0xe00 : for RS232 in (scratch buffer) @@ -711,66 +711,66 @@ struct MessageUnit_UNION ** 5. PostQ ** All SCSI Command must be sent through postQ: ** (inbound queue port) Request frame must be 32 bytes aligned -** # bit27--bit31 => flag for post ccb -** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb -** bit31 : 0 : 256 bytes frame -** 1 : 512 bytes frame -** bit30 : 0 : normal request -** 1 : BIOS request -** bit29 : reserved -** bit28 : reserved -** bit27 : reserved +** # bit27--bit31 => flag for post ccb +** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb +** bit31 : 0 : 256 bytes frame +** 1 : 512 bytes frame +** bit30 : 0 : normal request +** 1 : BIOS request +** bit29 : reserved +** bit28 : reserved +** bit27 : reserved ** ------------------------------------------------------------------------------- ** (outbount queue port) Request reply -** # bit27--bit31 => flag for reply -** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb -** bit31 : must be 0 (for this type of reply) -** bit30 : reserved for BIOS handshake -** bit29 : reserved -** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData -** 1 : Error, error code in AdapStatus/DevStatus/SenseData -** bit27 : reserved +** # bit27--bit31 => flag for reply +** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb +** bit31 : must be 0 (for this type of reply) +** bit30 : reserved for BIOS handshake +** bit29 : reserved +** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData +** 1 : Error, error code in AdapStatus/DevStatus/SenseData +** bit27 : reserved ** 6. BIOS request ** All BIOS request is the same with request from PostQ ** Except : ** Request frame is sent from configuration space -** offset: 0x78 : Request Frame (bit30 == 1) -** offset: 0x18 : writeonly to generate IRQ to IOP331 +** offset: 0x78 : Request Frame (bit30 == 1) +** offset: 0x18 : writeonly to generate IRQ to IOP331 ** Completion of request: -** (bit30 == 0, bit28==err flag) +** (bit30 == 0, bit28==err flag) ** 7. Definition of SGL entry (structure) ** 8. Message1 Out - Diag Status Code (????) ** 9. Message0 message code : ** 0x00 : NOP ** 0x01 : Get Config ->offset 0xa00 :for outbound message code msgcode_rwbuffer (IOP331 send to driver) -** Signature 0x87974060(4) -** Request len 0x00000200(4) -** numbers of queue 0x00000100(4) -** SDRAM Size 0x00000100(4)-->256 MB -** IDE Channels 0x00000008(4) -** vendor 40 bytes char -** model 8 bytes char -** FirmVer 16 bytes char -** Device Map 16 bytes char +** Signature 0x87974060(4) +** Request len 0x00000200(4) +** numbers of queue 0x00000100(4) +** SDRAM Size 0x00000100(4)-->256 MB +** IDE Channels 0x00000008(4) +** vendor 40 bytes char +** model 8 bytes char +** FirmVer 16 bytes char +** Device Map 16 bytes char ** ** FirmwareVersion DWORD <== Added for checking of new firmware capability ** 0x02 : Set Config ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331) -** Signature 0x87974063(4) -** UPPER32 of Request Frame (4)-->Driver Only +** Signature 0x87974063(4) +** UPPER32 of Request Frame (4)-->Driver Only ** 0x03 : Reset (Abort all queued Command) ** 0x04 : Stop Background Activity ** 0x05 : Flush Cache ** 0x06 : Start Background Activity (re-start if background is halted) ** 0x07 : Check If Host Command Pending (Novell May Need This Function) ** 0x08 : Set controller time ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver to IOP331) -** byte 0 : 0xaa <-- signature -** byte 1 : 0x55 <-- signature -** byte 2 : year (04) -** byte 3 : month (1..12) -** byte 4 : date (1..31) -** byte 5 : hour (0..23) -** byte 6 : minute (0..59) -** byte 7 : second (0..59) +** byte 0 : 0xaa <-- signature +** byte 1 : 0x55 <-- signature +** byte 2 : year (04) +** byte 3 : month (1..12) +** byte 4 : date (1..31) +** byte 5 : hour (0..23) +** byte 6 : minute (0..59) +** byte 7 : second (0..59) ** ********************************************************************************* ** Porting Of LSI2108/2116 Based PCIE SAS/6G host raid adapter ** ==> Difference from IOP348 @@ -789,33 +789,33 @@ struct MessageUnit_UNION ** b. Message0: message code ** 0x00 : NOP ** 0x01 : Get Config ->offset 0xB8 :for outbound message code msgcode_rwbuffer (IOP send to driver) -** Signature 0x87974060(4) -** Request len 0x00000200(4) -** numbers of queue 0x00000100(4) -** SDRAM Size 0x00000100(4)-->256 MB -** IDE Channels 0x00000008(4) -** vendor 40 bytes char -** model 8 bytes char -** FirmVer 16 bytes char -** Device Map 16 bytes char -** cfgVersion ULONG <== Added for checking of new firmware capability +** Signature 0x87974060(4) +** Request len 0x00000200(4) +** numbers of queue 0x00000100(4) +** SDRAM Size 0x00000100(4)-->256 MB +** IDE Channels 0x00000008(4) +** vendor 40 bytes char +** model 8 bytes char +** FirmVer 16 bytes char +** Device Map 16 bytes char +** cfgVersion ULONG <== Added for checking of new firmware capability ** 0x02 : Set Config ->offset 0xB0 :for inbound message code msgcode_rwbuffer (driver send to IOP) -** Signature 0x87974063(4) -** UPPER32 of Request Frame (4)-->Driver Only +** Signature 0x87974063(4) +** UPPER32 of Request Frame (4)-->Driver Only ** 0x03 : Reset (Abort all queued Command) ** 0x04 : Stop Background Activity ** 0x05 : Flush Cache ** 0x06 : Start Background Activity (re-start if background is halted) ** 0x07 : Check If Host Command Pending (Novell May Need This Function) ** 0x08 : Set controller time ->offset 0xB0 : for inbound message code msgcode_rwbuffer (driver to IOP) -** byte 0 : 0xaa <-- signature -** byte 1 : 0x55 <-- signature -** byte 2 : year (04) -** byte 3 : month (1..12) -** byte 4 : date (1..31) -** byte 5 : hour (0..23) -** byte 6 : minute (0..59) -** byte 7 : second (0..59) +** byte 0 : 0xaa <-- signature +** byte 1 : 0x55 <-- signature +** byte 2 : year (04) +** byte 3 : month (1..12) +** byte 4 : date (1..31) +** byte 5 : hour (0..23) +** byte 6 : minute (0..59) +** byte 7 : second (0..59) ** ** <2> Doorbell Register is used for RS-232 emulation ** different clear register @@ -908,21 +908,21 @@ struct MessageUnit_UNION */ /* size 8 bytes */ /* 32bit Scatter-Gather list */ -struct SG32ENTRY { /* length bit 24 == 0 */ - u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ - u_int32_t address; +struct SG32ENTRY { /* length bit 24 == 0 */ + u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ + u_int32_t address; }; /* size 12 bytes */ /* 64bit Scatter-Gather list */ -struct SG64ENTRY { /* length bit 24 == 1 */ - u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ - u_int32_t address; - u_int32_t addresshigh; +struct SG64ENTRY { /* length bit 24 == 1 */ + u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ + u_int32_t address; + u_int32_t addresshigh; }; struct SGENTRY_UNION { union { - struct SG32ENTRY sg32entry; /* 30h Scatter gather address */ - struct SG64ENTRY sg64entry; /* 30h */ + struct SG32ENTRY sg32entry; /* 30h Scatter gather address */ + struct SG64ENTRY sg64entry; /* 30h */ }u; }; /* @@ -932,14 +932,14 @@ struct SGENTRY_UNION { */ struct QBUFFER { u_int32_t data_len; - u_int8_t data[124]; + u_int8_t data[124]; }; /* ********************************** */ typedef struct PHYS_ADDR64 { - u_int32_t phyadd_low; - u_int32_t phyadd_high; + u_int32_t phyadd_low; + u_int32_t phyadd_high; }PHYSADDR64; /* ************************************************************************************************ @@ -959,11 +959,11 @@ struct FIRMWARE_INFO { u_int32_t ide_channels; /*4,16-19*/ char vendor[40]; /*5,20-59*/ char model[8]; /*15,60-67*/ - char firmware_ver[16]; /*17,68-83*/ + char firmware_ver[16]; /*17,68-83*/ char device_map[16]; /*21,84-99*/ - u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ - char cfgSerial[16]; /*26,104-119*/ - u_int32_t cfgPicStatus; /*30,120-123*/ + u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ + char cfgSerial[16]; /*26,104-119*/ + u_int32_t cfgPicStatus; /*30,120-123*/ }; /* (A) For cfgVersion in FIRMWARE_INFO ** if low BYTE (byte#0) >= 3 (version 3) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 19:56:00 2013 Return-Path: Delivered-To: svn-src-all@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 17A0E712; Wed, 18 Dec 2013 19:56:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E10B21E98; Wed, 18 Dec 2013 19:55:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DC7E7B94A; Wed, 18 Dec 2013 14:55:57 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu Date: Wed, 18 Dec 2013 12:00:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312171220.47075.jhb@freebsd.org> <86eh5agw1n.fsf@nine.des.no> In-Reply-To: <86eh5agw1n.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201312181200.04327.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Dec 2013 14:55:58 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 19:56:00 -0000 On Wednesday, December 18, 2013 7:53:24 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > 1) 'make tinderbox' Just Works as a single command from an existing sou= rce > > tree checkout. [...] > > > > 2) 'make tinderbox' provides a summary of what failed. 'make universe' > > does not. [...] >=20 > So remove all the .if !defined(DOING_TINDERBOX) code the tinderbox > target, and 'make universe' will do what you want without confusing > people. At this point 'make tinderbox' is hardcoded into my muscle memory, but there may be someone who wants 'make universe' to do what it does still (phk added it in its current form on purpose). I'm hesitant to change 'make universe', but am fine with having the two variants of the same thing live side by sid= e. > > Ah, I thought at one point it only built GENERIC and LINT type configs, > > but presumably that has changed? >=20 > That changed a long time ago. Ok, I'm happy then. I agree that we should revisit how LINT is done and probably move it to OBJDIR instead of its current location. It should probably also depend on makeLINT explicitly. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 20:04:06 2013 Return-Path: Delivered-To: svn-src-all@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 1C9EBB35; Wed, 18 Dec 2013 20:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E247E1F50; Wed, 18 Dec 2013 20:04:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIK45DR050482; Wed, 18 Dec 2013 20:04:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIK45fb050478; Wed, 18 Dec 2013 20:04:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312182004.rBIK45fb050478@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 20:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259566 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 20:04:06 -0000 Author: melifaro Date: Wed Dec 18 20:04:04 2013 New Revision: 259566 URL: http://svnweb.freebsd.org/changeset/base/259566 Log: Restore corefiles handling via kvm(3). Found by: John-Mark Gurney MFC after: 4 weeks Modified: head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/main.c Wed Dec 18 20:04:04 2013 (r259566) @@ -319,6 +319,7 @@ int gflag; /* show group (multicast) ro int hflag; /* show counters in human readable format */ int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ +int Mflag; /* read statistics from core */ int mflag; /* show memory stats */ int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ @@ -424,6 +425,7 @@ main(int argc, char *argv[]) Lflag = 1; break; case 'M': + Mflag = 1; memf = optarg; break; case 'm': Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/netstat.h Wed Dec 18 20:04:04 2013 (r259566) @@ -40,6 +40,7 @@ extern int gflag; /* show group (multica extern int hflag; /* show counters in human readable format */ extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ +extern int Mflag; /* read statistics from core */ extern int mflag; /* show memory stats */ extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Dec 18 19:25:40 2013 (r259565) +++ head/usr.bin/netstat/route.c Wed Dec 18 20:04:04 2013 (r259566) @@ -182,7 +182,7 @@ routepr(u_long rtree, int fibnum) printf(" (fib: %d)", fibnum); printf("\n"); - if (Aflag == 0 && NewTree) + if (Aflag == 0 && Mflag == 0 && NewTree) ntreestuff(fibnum, af); else { if (rtree == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 20:08:18 2013 Return-Path: Delivered-To: svn-src-all@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 705FCE19; Wed, 18 Dec 2013 20:08:18 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 316801F94; Wed, 18 Dec 2013 20:08:18 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1VtJb0-000Dh6-Jp; Wed, 18 Dec 2013 20:03:38 +0400 Message-ID: <52B2009E.1060905@FreeBSD.org> Date: Thu, 19 Dec 2013 00:07:58 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130728 Thunderbird/17.0.7 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r259562 - head/usr.bin/netstat References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> In-Reply-To: <20131218184512.GM99167@funkthat.com> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 20:08:18 -0000 On 18.12.2013 22:45, John-Mark Gurney wrote: > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: >> Author: melifaro >> Date: Wed Dec 18 18:25:27 2013 >> New Revision: 259562 >> URL: http://svnweb.freebsd.org/changeset/base/259562 >> >> Log: >> Switch netstat -rn to use standard API for retrieving list of routes >> instead of peeking inside in-kernel radix via kget. >> This permits us to change kernel structures without breaking userland. >> Additionally, this change provide more reliable and faster output. >> >> `Refs` and `Use` fields available in IPv4 by default (and via -W >> for other families) were removed. `Refs` is radix-specific thing >> which is not informative for users. `Use` field value is handy sometimes, >> but a) current API does not support it and b) I'm not sure we will >> support per-rte pcpu counters in near future. >> >> Old method of retrieving data is still supported (either by defining >> NewTree=0 or running netstat with -A). However, Refs/Use fields are >> hidden. >> >> Sponsored by: Yandex LLC >> MFC after: 4 weeks >> PR: kern/167204 > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > this change make it not usable, or will you still automatically use Well. It will probably break in (maybe, near) future. > it when they are specified? However, it should work now (fixed in r259566). > From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 20:17:06 2013 Return-Path: Delivered-To: svn-src-all@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 EADC818A; Wed, 18 Dec 2013 20:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D66211025; Wed, 18 Dec 2013 20:17:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIKH5dP054860; Wed, 18 Dec 2013 20:17:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIKH5v2054858; Wed, 18 Dec 2013 20:17:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312182017.rBIKH5v2054858@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2013 20:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259568 - in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 20:17:06 -0000 Author: melifaro Date: Wed Dec 18 20:17:05 2013 New Revision: 259568 URL: http://svnweb.freebsd.org/changeset/base/259568 Log: Add net.inet.ip.fw.dyn_keep_states sysctl which re-links dynamic states to default rule instead of flushing on rule deletion. This can be useful while performing ruleset reload (think about `atomic` reload via changing sets). Currently it is turned off by default. MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Dec 18 20:11:01 2013 (r259567) +++ head/sbin/ipfw/ipfw.8 Wed Dec 18 20:17:05 2013 (r259568) @@ -2933,6 +2933,11 @@ and must be strictly lower than 5 seconds, the period of repetition of keepalives. The firewall enforces that. +.It Va net.inet.ip.fw.dyn_keep_states: No 0 +Keep dynamic states on rule/set deletion. +States are relinked to default rule (65535). +This can be handly for ruleset reload. +Turned off by default. .It Va net.inet.ip.fw.enable : No 1 Enables the firewall. Setting this variable to 0 lets you run your machine without Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Dec 18 20:11:01 2013 (r259567) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Dec 18 20:17:05 2013 (r259568) @@ -106,7 +106,8 @@ __FBSDID("$FreeBSD$"); * * Each dynamic rule holds a pointer to the parent ipfw rule so * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. XXX we should make them survive. + * the parent rule is deleted. This can be changed by dyn_keep_states + * sysctl. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple @@ -141,6 +142,10 @@ static VNET_DEFINE(uma_zone_t, ipfw_dyn_ #define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) #define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) + +static VNET_DEFINE(int, dyn_keep_states); +#define V_dyn_keep_states VNET(dyn_keep_states) + /* * Timeouts for various events in handing dynamic rules. */ @@ -234,6 +239,9 @@ SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AU SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, "Enable keepalives for dyn. rules"); +SYSCTL_VNET_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, + CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, + "Do not flush dynamic states on rule deletion"); SYSEND @@ -307,6 +315,7 @@ print_dyn_rule_flags(struct ipfw_flow_id print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) /* * Lookup a dynamic rule, locked version. @@ -1100,6 +1109,20 @@ check_dyn_rules(struct ip_fw_chain *chai if ((TIME_LEQ(q->expire, time_uptime)) || ((rule != NULL) && (q->rule == rule)) || ((set != RESVD_SET) && (q->rule->set == set))) { + if (TIME_LE(time_uptime, q->expire) && + q->dyn_type == O_KEEP_STATE && + V_dyn_keep_states != 0) { + /* + * Do not delete state if + * it is not expired and + * dyn_keep_states is ON. + * However we need to re-link it + * to any other stable rule + */ + q->rule = chain->default_rule; + NEXT_RULE(); + } + /* Unlink q from current list */ q_next = q->next; if (q == V_ipfw_dyn_v[i].head) From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 20:37:50 2013 Return-Path: Delivered-To: svn-src-all@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 A0F9C6EA; Wed, 18 Dec 2013 20:37:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 815791174; Wed, 18 Dec 2013 20:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBIKbohM061913; Wed, 18 Dec 2013 20:37:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBIKboeV061912; Wed, 18 Dec 2013 20:37:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312182037.rBIKboeV061912@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 18 Dec 2013 20:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259569 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 20:37:50 -0000 Author: np Date: Wed Dec 18 20:37:49 2013 New Revision: 259569 URL: http://svnweb.freebsd.org/changeset/base/259569 Log: cxgbe.4: Belated update to the man page to reflect T5 support. MFC after: 1 day Modified: head/share/man/man4/cxgbe.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Wed Dec 18 20:17:05 2013 (r259568) +++ head/share/man/man4/cxgbe.4 Wed Dec 18 20:37:49 2013 (r259569) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012, Chelsio Inc +.\" Copyright (c) 2011-2013, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd December 18, 2013 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,13 +50,14 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent t4fw_cfg_load="YES" +t5fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 (T4) ASIC. +the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,11 +66,50 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp +Note that ports of T5 cards are named cxl and attach to a t5nex parent device +(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). +Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. +The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and +dev.cxgbe for T4 cards. + +.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC +(ports will be named cxl): +.Pp +.Bl -bullet -compact +.It +Chelsio T580-CR +.It +Chelsio T580-LP-CR +.It +Chelsio T580-LP-SO-CR +.It +Chelsio T560-CR +.It +Chelsio T540-CR +.It +Chelsio T540-LP-CR +.It +Chelsio T522-CR +.It +Chelsio T520-LL-CR +.It +Chelsio T520-CR +.It +Chelsio T520-SO +.It +Chelsio T520-BT +.It +Chelsio T504-BT +.El +.Pp +The +.Nm driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: .Pp .Bl -bullet -compact @@ -139,8 +179,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. -Different cxgbe interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx sysctl. +Different interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -149,8 +189,8 @@ and the index selects a value from this The default value is -1 for both 10Gb and 1Gb ports, which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -161,16 +201,16 @@ software queuing. See .Xr ifnet 9 . The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -231,6 +271,10 @@ The .Nm device driver first appeared in .Fx 9.0 . +Support for T5 cards first appeared in +.Fx 9.2 +and +.Fx 10.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:14:43 2013 Return-Path: Delivered-To: svn-src-all@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 D713FCF5; Wed, 18 Dec 2013 21:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C209B153F; Wed, 18 Dec 2013 21:14:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILEhSa076165; Wed, 18 Dec 2013 21:14:43 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILEhOW076164; Wed, 18 Dec 2013 21:14:43 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182114.rBILEhOW076164@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259571 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:14:43 -0000 Author: rodrigc Date: Wed Dec 18 21:14:43 2013 New Revision: 259571 URL: http://svnweb.freebsd.org/changeset/base/259571 Log: Add SVN revision numbers for Mellanox updates. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:13:50 2013 (r259570) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:14:43 2013 (r259571) @@ -254,10 +254,10 @@ The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. - The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been updated to the same version as supplied by Linux version 3.7 - The Mellanox Infiniband driver has been updated to firmware + The Mellanox Infiniband driver has been updated to firmware version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added for dynamically loading kernel modules for Infiniband core (ibcore) and From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:13:51 2013 Return-Path: Delivered-To: svn-src-all@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 525E7BA1; Wed, 18 Dec 2013 21:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6BD1530; Wed, 18 Dec 2013 21:13:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILDpYZ075973; Wed, 18 Dec 2013 21:13:51 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILDpeM075972; Wed, 18 Dec 2013 21:13:51 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312182113.rBILDpeM075972@svn.freebsd.org> From: Devin Teske Date: Wed, 18 Dec 2013 21:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259570 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:13:51 -0000 Author: dteske Date: Wed Dec 18 21:13:50 2013 New Revision: 259570 URL: http://svnweb.freebsd.org/changeset/base/259570 Log: Fix "[: -eq: argument expected" error introduced by SVN r256343. The code should not have used DIALOG_CANCEL because dialog.subr wasn't included to define it. The effect of the error was that you could not cancel the partition dialog. Discovered by checking bsdinstall_log for something else. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 20:37:49 2013 (r259569) +++ head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:13:50 2013 (r259570) @@ -124,8 +124,7 @@ exec 3>&1 PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ --title "Partitioning" \ --menu "How would you like to partition your disk?" \ - 0 0 0 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + 0 0 0 2>&1 1>&3` || exit 1 exec 3>&- case "$PARTMODE" in From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:16:58 2013 Return-Path: Delivered-To: svn-src-all@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 1AEE5E8F; Wed, 18 Dec 2013 21:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06B7C1589; Wed, 18 Dec 2013 21:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILGvR0076499; Wed, 18 Dec 2013 21:16:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILGvSV076498; Wed, 18 Dec 2013 21:16:57 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312182116.rBILGvSV076498@svn.freebsd.org> From: Devin Teske Date: Wed, 18 Dec 2013 21:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259572 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:16:58 -0000 Author: dteske Date: Wed Dec 18 21:16:57 2013 New Revision: 259572 URL: http://svnweb.freebsd.org/changeset/base/259572 Log: In bsdinstall_log, it's rather confusing to see the following sequence: DEBUG: Running installation step: hostname rm: /tmp/bsdinstall_etc/fstab: No such file or directory The two lines are unrelated, and the rm is spurious. Let's add `-f' to that rm(1) so it doesn't confuse us when debugging an install. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:14:43 2013 (r259571) +++ head/usr.sbin/bsdinstall/scripts/auto Wed Dec 18 21:16:57 2013 (r259572) @@ -103,7 +103,7 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then export BSDINSTALL_DISTSITE fi -rm $PATH_FSTAB +rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:23:16 2013 Return-Path: Delivered-To: svn-src-all@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 C6647323; Wed, 18 Dec 2013 21:23:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B21B01628; Wed, 18 Dec 2013 21:23:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILNG40079645; Wed, 18 Dec 2013 21:23:16 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILNGC6079644; Wed, 18 Dec 2013 21:23:16 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182123.rBILNGC6079644@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259574 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:23:16 -0000 Author: rodrigc Date: Wed Dec 18 21:23:16 2013 New Revision: 259574 URL: http://svnweb.freebsd.org/changeset/base/259574 Log: Indent. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:22:16 2013 (r259573) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:23:16 2013 (r259574) @@ -255,7 +255,8 @@ experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. - The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + The Open Fabrics Enterprise Distribution (OFED) and + OFED Infiniband core has been updated to the same version as supplied by Linux version 3.7 The Mellanox Infiniband driver has been updated to firmware From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:22:17 2013 Return-Path: Delivered-To: svn-src-all@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 44FBE1FE; Wed, 18 Dec 2013 21:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30FA51619; Wed, 18 Dec 2013 21:22:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILMHiA079507; Wed, 18 Dec 2013 21:22:17 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILMHlU079506; Wed, 18 Dec 2013 21:22:17 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182122.rBILMHlU079506@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259573 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:22:17 -0000 Author: rodrigc Date: Wed Dec 18 21:22:16 2013 New Revision: 259573 URL: http://svnweb.freebsd.org/changeset/base/259573 Log: Add SVN revision numbers for Chelsio updates. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:16:57 2013 (r259572) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:22:16 2013 (r259573) @@ -248,10 +248,11 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. - The &man.cxgbe.4; driver has been updated to support + The &man.cxgbe.4; driver has been updated to support 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. - The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + The iw_cxgbe driver has been added. This is an + experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:49:18 2013 Return-Path: Delivered-To: svn-src-all@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 A42F5169; Wed, 18 Dec 2013 21:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7549F18AB; Wed, 18 Dec 2013 21:49:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILnIbd087377; Wed, 18 Dec 2013 21:49:18 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILnILo087376; Wed, 18 Dec 2013 21:49:18 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312182149.rBILnILo087376@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 18 Dec 2013 21:49: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: r259577 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:49:18 -0000 Author: rodrigc Date: Wed Dec 18 21:49:17 2013 New Revision: 259577 URL: http://svnweb.freebsd.org/changeset/base/259577 Log: MFC r259571: Add SVN revision numbers for Mellanox updates. MFC r259573: Add SVN revision numbers for Chelsio updates. MFC r259574: Indent. Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:45:46 2013 (r259576) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Dec 18 21:49:17 2013 (r259577) @@ -248,16 +248,18 @@ The &man.wpi.4; driver has been updated to include a number of stability fixes. - The &man.cxgbe.4; driver has been updated to support + The &man.cxgbe.4; driver has been updated to support 40G/10G Ethernet NICs based on Chelsio's Terminator 5 (T5) ASIC. - The iw_cxgbe driver has been added. This is an experimental iWARP/RDMA driver + The iw_cxgbe driver has been added. This is an + experimental iWARP/RDMA driver (kernel verbs only) for Chelsio's T4 and T5 based cards. - The Open Fabrics Enterprise Distribution (OFED) and OFED Infiniband core has been + The Open Fabrics Enterprise Distribution (OFED) and + OFED Infiniband core has been updated to the same version as supplied by Linux version 3.7 - The Mellanox Infiniband driver has been updated to firmware + The Mellanox Infiniband driver has been updated to firmware version 2.30.3200 for ConnectX3 NICs. Support has been added for ConnectX3 VPI NICs, where each port can be used as Infiniband 56 GB/s or Ethernet 40 GB/s. Support has been added for dynamically loading kernel modules for Infiniband core (ibcore) and From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 21:45:46 2013 Return-Path: Delivered-To: svn-src-all@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 BD9F9E02; Wed, 18 Dec 2013 21:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8DD81857; Wed, 18 Dec 2013 21:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBILjk3K086954; Wed, 18 Dec 2013 21:45:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBILjkZH086953; Wed, 18 Dec 2013 21:45:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312182145.rBILjkZH086953@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 18 Dec 2013 21:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259576 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 21:45:46 -0000 Author: pjd Date: Wed Dec 18 21:45:46 2013 New Revision: 259576 URL: http://svnweb.freebsd.org/changeset/base/259576 Log: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 illumos/illumos-gate@bb411a08b05466bfe0c7095b6373bbc1587e259a MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Dec 18 21:29:23 2013 (r259575) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Dec 18 21:45:46 2013 (r259576) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 22:40:10 2013 Return-Path: Delivered-To: svn-src-all@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 6686D660; Wed, 18 Dec 2013 22:40:10 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C51801E32; Wed, 18 Dec 2013 22:40:08 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBIMdotP004057; Wed, 18 Dec 2013 23:39:55 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B22436.2040401@FreeBSD.org> Date: Wed, 18 Dec 2013 23:39:50 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Baptiste Daroussin , Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> <52A79A82.7050801@FreeBSD.org> <20131218022156.ed5c6a17.ray@freebsd.org> <20131218002415.GQ99753@ithaqua.etoilebsd.net> In-Reply-To: <20131218002415.GQ99753@ithaqua.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andreas Tobler , svn-src-head@FreeBSD.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 22:40:10 -0000 On 18.12.13 01:24, Baptiste Daroussin wrote: > On Wed, Dec 18, 2013 at 02:21:56AM +0200, Aleksandr Rybalko wrote: >> On Tue, 10 Dec 2013 23:49:38 +0100 >> Andreas Tobler wrote: >> >>> On 10.12.13 14:43, Tijl Coosemans wrote: >>>> On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: >>>>> That keyboards have no Shift key for that? :) >>>>> I will be glad to apply your changes, but I have to know how it >>>>> should be controlled. >>>>> >>>>> RU and UA PC keyboards have same 3 symbols '2', '"', '@' >>>>> To get '2' i have to press only '2' >>>>> To get '@' I have to press Shift+'2' >>>>> To get '"' I have to switch to UA or RU and press Shift+'2' >>>>> >>>>> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary >>>>> lang switch. Which commonly mapped to one of Alt. Right? >>>>> So R-Alt+Shift+'2'? >>>> >>>> https://en.wikipedia.org/wiki/AltGr >>> >>> Thanks Tijl! >>> >>> To get the @ I have to press AltGr + '2'. >>> There are combinations where I have to press AltGr+Shift. e.g to get >>> the 'broken bar, ¦', AltGr+Shift+'7'. >>> >>> Andreas >>> >> >> Hello Andreas and Tijl! >> >> Since I think not a whole world have AltGr key (read as "not most >> keyboards on the Earth") :) >> Think it is OK to use R.Alt as an Alt by default, and enable AltGr with >> sysctl kern.vt.enable_altgr. >> > I tend to disagree with you, lots of keyboards mapping are concerned here. Hi Aleksandr, It is at least a step forward. But I do not like it. Don't get me wrong, I think we have to be very careful when it comes to keyboard mapping. A status quo should be kept, the one from syscons. Looking back the past 20 years of Linux and FreeBSD experience I always had to touch the keyboards section to make it fit my needs. A nasty hurdle, in the beginning it was ok, but after the sixth time adjusting the native language keyboard it gets boring. And I guess it is not only me. In the meantime I would not need a swiss keyboard anymore, I more or less know the native mapping out of my mind :) I do not yet understand the fine keyboard details from syscons but I think we have to keep and adapt them to vt. My two Rp. Thanks for your time! Andreas From owner-svn-src-all@FreeBSD.ORG Wed Dec 18 22:38:45 2013 Return-Path: Delivered-To: svn-src-all@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 8F416576; Wed, 18 Dec 2013 22:38:45 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64A011E25; Wed, 18 Dec 2013 22:38:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5F69CB980; Wed, 18 Dec 2013 17:38:44 -0500 (EST) From: John Baldwin To: "Alexander V. Chernikov" Subject: Re: svn commit: r259562 - head/usr.bin/netstat Date: Wed, 18 Dec 2013 16:40:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> In-Reply-To: <52B2009E.1060905@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312181640.52147.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Dec 2013 17:38:44 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 22:38:45 -0000 On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > On 18.12.2013 22:45, John-Mark Gurney wrote: > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > >> Author: melifaro > >> Date: Wed Dec 18 18:25:27 2013 > >> New Revision: 259562 > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > >> > >> Log: > >> Switch netstat -rn to use standard API for retrieving list of routes > >> instead of peeking inside in-kernel radix via kget. > >> This permits us to change kernel structures without breaking userland. > >> Additionally, this change provide more reliable and faster output. > >> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > >> for other families) were removed. `Refs` is radix-specific thing > >> which is not informative for users. `Use` field value is handy sometimes, > >> but a) current API does not support it and b) I'm not sure we will > >> support per-rte pcpu counters in near future. > >> > >> Old method of retrieving data is still supported (either by defining > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > >> hidden. > >> > >> Sponsored by: Yandex LLC > >> MFC after: 4 weeks > >> PR: kern/167204 > > > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > > this change make it not usable, or will you still automatically use > Well. It will probably break in (maybe, near) future. Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's fine if kvm mode is fragile and requires the binary to be in sync with the kernel and is only used for crash dumps, but it is very useful to extract all sorts of info out of a crash dump. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 00:28:32 2013 Return-Path: Delivered-To: svn-src-all@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 DDC88C18; Thu, 19 Dec 2013 00:28:31 +0000 (UTC) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3ECC1661; Thu, 19 Dec 2013 00:28:30 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id q58so381024wes.5 for ; Wed, 18 Dec 2013 16:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=W7wX8G0cPGr2JtsbOTuWciK8uBdy8YtcL3FrK+MsFgE=; b=Ei+5OaPvgxPski0rsgZkvGajstEi2k6Ll2kWWjR/meX7Q2bP8Gn65ody2KdvSEij60 jZNJ3whJ202PABvtqPc1wuGF9ZGalpSAulZAv9jIMVFQUeIbYR6bJOXrSbTucoF4p4ss BnFmAfVCKwkNCI4iY2Vsl6e9k0JOcZbVjNzF6+U6j4NDxAaPVAw5a1zqPTVEinvm6kLK bcSEe9uMrOjs9gsl1oWf4rU5eegqiP0jKVlpggzFjNzBIRS8U/li1/d2LT99Lh/sE3Dj ROGBCw6nxffPyJ5X/hyQEFolLGKnRJezfFsKtBRvJtFQ6pz8GE8rxGHnhhOXqscPd76C seFg== X-Received: by 10.180.188.141 with SMTP id ga13mr165787wic.55.1387412909265; Wed, 18 Dec 2013 16:28:29 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id el8sm7805995wic.8.2013.12.18.16.28.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 16:28:28 -0800 (PST) Date: Thu, 19 Dec 2013 01:28:24 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131219002824.GA5664@dft-labs.eu> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201312171434.01345.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 00:28:32 -0000 On Tue, Dec 17, 2013 at 02:34:01PM -0500, John Baldwin wrote: > On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: > > On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: > > > On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: > > > > Author: mjg > > > > Date: Sun Dec 15 04:11:43 2013 > > > > New Revision: 259407 > > > > URL: http://svnweb.freebsd.org/changeset/base/259407 > > > > > > > > Log: > > > > proc exit: don't take PROC_LOCK while freeing rlimits > > > > > > > > Code wishing to check rlimits of some process should check whether it > > > > is exiting first, which current consumers do. > > > > > > Does this measurably reduce contention? > > > > > > > No, this is just a cosmetic change I did while doing some other work > > with rlimits. > > > > It would use some more cosmetic work (e.g. no reason not to > > lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that > > later unless this kind of stuff is unwanted. > Sorry for late reply, was pondering moving this code to after the moment the process is removed from allproc. > I find it useful to leave the locking in place so it is clear that p_limit is > always written to with the lock held. If we ever got a static analyzer that > understood locking rules then leaving this locking in would reduce false > positives. When I first did locking for fields in struct proc I did it by > hand based on grepping the source tree for all uses of a field and ensuring > they were locked. I think it might be more confusing later on for another > reader to see unlocked access and then have to think about why that is safe. > I would argue such a tool should support marking given unlocled access as ok. Few lines earlier we already have code modifying proc without locks: if ((vtmp = p->p_textvp) != NULL) { p->p_textvp = NULL; vrele(vtmp); } Despite replacing the pointer with NULL first it still races with anything accessing the field as vref (if any) may be executed after vrele. As such, I would expect the reader to conclude that accessing these fields is not valid at this point. That being said, instead of reverting the change (which would leave other field with similar issue in place) I propose adding the following: --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -220,6 +220,12 @@ exit1(struct thread *td, int rv) p->p_xstat = rv; /* Let event handler change exit status */ PROC_UNLOCK(p); + + /* + * Some fields below are freed without having the proc locked, check + * for P_WEXIT before accessing to make sure it is safe. + */ + Which should make it clear. But again, this is a cosmetic change and I have no strong opinion either way. If you are still unconvinced I'm happy to revert it later. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 00:51:49 2013 Return-Path: Delivered-To: svn-src-all@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 30166638; Thu, 19 Dec 2013 00:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8221850; Thu, 19 Dec 2013 00:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ0pmKF055327; Thu, 19 Dec 2013 00:51:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ0pmFc055325; Thu, 19 Dec 2013 00:51:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312190051.rBJ0pmFc055325@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 19 Dec 2013 00:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259580 - in head: contrib/tcpdump usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 00:51:49 -0000 Author: pjd Date: Thu Dec 19 00:51:48 2013 New Revision: 259580 URL: http://svnweb.freebsd.org/changeset/base/259580 Log: If we cannot connect to casperd we don't enter sandbox, but if we can connect to casperd, but we cannot access the service we need we exit with an error. This should not happen and just indicates some configuration error which should be fixed, so we force the user to do it by failing. Discussed with: emaste Modified: head/contrib/tcpdump/tcpdump.c head/usr.bin/kdump/kdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Wed Dec 18 23:39:42 2013 (r259579) +++ head/contrib/tcpdump/tcpdump.c Thu Dec 19 00:51:48 2013 (r259580) @@ -710,24 +710,16 @@ capdns_setup(void) capdnsloc = cap_service_open(capcas, "system.dns"); /* Casper capability no longer needed. */ cap_close(capcas); - if (capdnsloc == NULL) { - warning("unable to open system.dns service"); - return (NULL); - } + if (capdnsloc == NULL) + error("unable to open system.dns service"); /* Limit system.dns to reverse DNS lookups. */ types[0] = "ADDR"; - if (cap_dns_type_limit(capdnsloc, types, 1) < 0) { - warning("unable to limit access to system.dns service"); - cap_close(capdnsloc); - return (NULL); - } + if (cap_dns_type_limit(capdnsloc, types, 1) < 0) + error("unable to limit access to system.dns service"); families[0] = AF_INET; families[1] = AF_INET6; - if (cap_dns_family_limit(capdnsloc, families, 2) < 0) { - warning("unable to limit access to system.dns service"); - cap_close(capdnsloc); - return (NULL); - } + if (cap_dns_family_limit(capdnsloc, families, 2) < 0) + error("unable to limit access to system.dns service"); return (capdnsloc); } Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Wed Dec 18 23:39:42 2013 (r259579) +++ head/usr.bin/kdump/kdump.c Thu Dec 19 00:51:48 2013 (r259580) @@ -215,7 +215,7 @@ cappwdgrp_setup(cap_channel_t **cappwdp, capcas = cap_init(); if (capcas == NULL) { warn("unable to contact casperd"); - return (NULL); + return (-1); } cappwdloc = cap_service_open(capcas, "system.pwd"); capgrploc = cap_service_open(capcas, "system.grp"); @@ -226,40 +226,26 @@ cappwdgrp_setup(cap_channel_t **cappwdp, warn("unable to open system.pwd service"); if (capgrploc == NULL) warn("unable to open system.grp service"); - goto fail; + exit(1); } /* Limit system.pwd to only getpwuid() function and pw_name field. */ cmds[0] = "getpwuid"; - if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) { - warn("unable to limit access to system.pwd service"); - goto fail; - } + if (cap_pwd_limit_cmds(cappwdloc, cmds, 1) < 0) + err(1, "unable to limit system.pwd service"); fields[0] = "pw_name"; - if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) { - warn("unable to limit access to system.pwd service"); - goto fail; - } + if (cap_pwd_limit_fields(cappwdloc, fields, 1) < 0) + err(1, "unable to limit system.pwd service"); /* Limit system.grp to only getgrgid() function and gr_name field. */ cmds[0] = "getgrgid"; - if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) { - warn("unable to limit access to system.grp service"); - goto fail; - } + if (cap_grp_limit_cmds(capgrploc, cmds, 1) < 0) + err(1, "unable to limit system.grp service"); fields[0] = "gr_name"; - if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) { - warn("unable to limit access to system.grp service"); - goto fail; - } + if (cap_grp_limit_fields(capgrploc, fields, 1) < 0) + err(1, "unable to limit system.grp service"); *cappwdp = cappwdloc; *capgrpp = capgrploc; return (0); -fail: - if (capgrploc == NULL) - cap_close(cappwdloc); - if (capgrploc == NULL) - cap_close(capgrploc); - return (-1); } #endif /* HAVE_LIBCAPSICUM */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 00:53:11 2013 Return-Path: Delivered-To: svn-src-all@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 DE56B788; Thu, 19 Dec 2013 00:53:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAC68185B; Thu, 19 Dec 2013 00:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ0rBLr055523; Thu, 19 Dec 2013 00:53:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ0rBRQ055522; Thu, 19 Dec 2013 00:53:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312190053.rBJ0rBRQ055522@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 19 Dec 2013 00:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259581 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 00:53:11 -0000 Author: pjd Date: Thu Dec 19 00:53:11 2013 New Revision: 259581 URL: http://svnweb.freebsd.org/changeset/base/259581 Log: Make the world a bit more secure place (hopefully) and turn the casperd on by default. Sponsored by: The FreeBSD Foundation Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 19 00:51:48 2013 (r259580) +++ head/etc/defaults/rc.conf Thu Dec 19 00:53:11 2013 (r259581) @@ -658,7 +658,7 @@ newsyslog_enable="YES" # Run newsyslog a newsyslog_flags="-CN" # Newsyslog flags to create marked files mixer_enable="YES" # Run the sound mixer. opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off -casperd_enable="NO" # casperd(8) daemon +casperd_enable="YES" # casperd(8) daemon ############################################################## ### Jail Configuration (see rc.conf(5) manual page) ########## From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 01:38:26 2013 Return-Path: Delivered-To: svn-src-all@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 A0F5BED2; Thu, 19 Dec 2013 01:38:26 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF121B18; Thu, 19 Dec 2013 01:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ1cQbt070527; Thu, 19 Dec 2013 01:38:26 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ1cQrb070525; Thu, 19 Dec 2013 01:38:26 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312190138.rBJ1cQrb070525@svn.freebsd.org> From: Glen Barber Date: Thu, 19 Dec 2013 01:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259582 - in releng/10.0/release: amd64 i386 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 01:38:26 -0000 Author: gjb Date: Thu Dec 19 01:38:25 2013 New Revision: 259582 URL: http://svnweb.freebsd.org/changeset/base/259582 Log: Set PACKAGESITE to 'release/0' for the pkg-stage target to pull the release set of packages. This is a direct commit to releng/10.0/. Approved by: re (rodrigc) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/release/amd64/pkg-stage.conf releng/10.0/release/i386/pkg-stage.conf Modified: releng/10.0/release/amd64/pkg-stage.conf ============================================================================== --- releng/10.0/release/amd64/pkg-stage.conf Thu Dec 19 00:53:11 2013 (r259581) +++ releng/10.0/release/amd64/pkg-stage.conf Thu Dec 19 01:38:25 2013 (r259582) @@ -6,7 +6,7 @@ export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:64" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" -export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" +export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/release/0" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" Modified: releng/10.0/release/i386/pkg-stage.conf ============================================================================== --- releng/10.0/release/i386/pkg-stage.conf Thu Dec 19 00:53:11 2013 (r259581) +++ releng/10.0/release/i386/pkg-stage.conf Thu Dec 19 01:38:25 2013 (r259582) @@ -6,7 +6,7 @@ export PKG_ABI="freebsd:${REVISION%.[0-9]*}:x86:32" export ASSUME_ALWAYS_YES=1 export __PKG_CONF="/etc/pkg/FreeBSD.conf" -export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/latest" +export PACKAGESITE="http://pkg.FreeBSD.org/${PKG_ABI}/release/0" export MIRROR_TYPE="SRV" export REPO_AUTOUPDATE="NO" export PKG_DBDIR="/tmp/pkg" From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 02:32:09 2013 Return-Path: Delivered-To: svn-src-all@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 5EF996B3; Thu, 19 Dec 2013 02:32: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EFBD1F53; Thu, 19 Dec 2013 02:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ2W8wk091456; Thu, 19 Dec 2013 02:32:08 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ2W8jn091454; Thu, 19 Dec 2013 02:32:08 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312190232.rBJ2W8jn091454@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Dec 2013 02:32:08 +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: r259583 - in stable/10/contrib/gcc: . config/rs6000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 02:32:09 -0000 Author: pfg Date: Thu Dec 19 02:32:07 2013 New Revision: 259583 URL: http://svnweb.freebsd.org/changeset/base/259583 Log: MFC r258651, r258943: gcc: Altivec register adjustments from Apple. gcc: On rs6000 update sp_offset depending only on size. Tested by: Justin Hibbits Obtained from: gcc pre-4.3 (rev. 124763, 125116; GPLv2) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 stable/10/contrib/gcc/config/rs6000/rs6000.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 01:38:25 2013 (r259582) +++ stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 02:32:07 2013 (r259583) @@ -10,12 +10,20 @@ * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. -2007-05-31 Eric Christopher +2007-05-31 Eric Christopher (r125246) * expr.c (convert_move): Assert that we don't have a BLKmode operand. (store_expr): Handle BLKmode moves by calling emit_block_move. +2007-05-27 Eric Christopher (r125116) + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Update + sp_offset depending on stack size. Save r12 depending + on registers we're saving later. + (rs6000_emit_epilogue): Update sp_offset depending only + on stack size. + 2007-05-24 Richard Sandiford (r125037) * postreload-gcse.c (reg_changed_after_insn_p): New function. @@ -31,6 +39,12 @@ regs_invalidated_by_call, rather than just checking the membership of REGNO (REG). +2007-05-16 Eric Christopher (r124763) + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register + saving after stack push. Set sp_offset whenever we push. + (rs6000_emit_epilogue): Move altivec register restore before stack push. + 2007-05-03 Ian Lance Taylor (r124381) * config/rs6000/rs6000.c (rs6000_override_options): Don't set Modified: stable/10/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- stable/10/contrib/gcc/config/rs6000/rs6000.c Thu Dec 19 01:38:25 2013 (r259582) +++ stable/10/contrib/gcc/config/rs6000/rs6000.c Thu Dec 19 02:32:07 2013 (r259583) @@ -14466,77 +14466,6 @@ rs6000_emit_prologue (void) sp_offset = info->total_size; } - /* Save AltiVec registers if needed. */ - if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0) - { - int i; - - /* There should be a non inline version of this, for when we - are saving lots of vector registers. */ - for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i) - if (info->vrsave_mask & ALTIVEC_REG_BIT (i)) - { - rtx areg, savereg, mem; - int offset; - - offset = info->altivec_save_offset + sp_offset - + 16 * (i - info->first_altivec_reg_save); - - savereg = gen_rtx_REG (V4SImode, i); - - areg = gen_rtx_REG (Pmode, 0); - emit_move_insn (areg, GEN_INT (offset)); - - /* AltiVec addressing mode is [reg+reg]. */ - mem = gen_frame_mem (V4SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, areg)); - - insn = emit_move_insn (mem, savereg); - - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, - areg, GEN_INT (offset)); - } - } - - /* VRSAVE is a bit vector representing which AltiVec registers - are used. The OS uses this to determine which vector - registers to save on a context switch. We need to save - VRSAVE on the stack frame, add whatever AltiVec registers we - used in this function, and do the corresponding magic in the - epilogue. */ - - if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE - && info->vrsave_mask != 0) - { - rtx reg, mem, vrsave; - int offset; - - /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12 - as frame_reg_rtx and r11 as the static chain pointer for - nested functions. */ - reg = gen_rtx_REG (SImode, 0); - vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO); - if (TARGET_MACHO) - emit_insn (gen_get_vrsave_internal (reg)); - else - emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave)); - - if (!WORLD_SAVE_P (info)) - { - /* Save VRSAVE. */ - offset = info->vrsave_save_offset + sp_offset; - mem = gen_frame_mem (SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (offset))); - insn = emit_move_insn (mem, reg); - } - - /* Include the registers in the mask. */ - emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask))); - - insn = emit_insn (generate_set_vrsave (reg, info, 0)); - } - /* If we use the link register, get it into r0. */ if (!WORLD_SAVE_P (info) && info->lr_save_p) { @@ -14774,7 +14703,19 @@ rs6000_emit_prologue (void) for which it was done previously. */ if (!WORLD_SAVE_P (info) && info->push_p && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)) - rs6000_emit_allocate_stack (info->total_size, FALSE); + { + if (info->total_size < 32767) + sp_offset = info->total_size; + else + frame_reg_rtx = frame_ptr_rtx; + rs6000_emit_allocate_stack (info->total_size, + (frame_reg_rtx != sp_reg_rtx + && ((info->altivec_size != 0) + || (info->vrsave_mask != 0) + ))); + if (frame_reg_rtx != sp_reg_rtx) + rs6000_emit_stack_tie (); + } /* Set frame pointer, if needed. */ if (frame_pointer_needed) @@ -14784,6 +14725,78 @@ rs6000_emit_prologue (void) RTX_FRAME_RELATED_P (insn) = 1; } + /* Save AltiVec registers if needed. Save here because the red zone does + not include AltiVec registers. */ + if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0) + { + int i; + + /* There should be a non inline version of this, for when we + are saving lots of vector registers. */ + for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i) + if (info->vrsave_mask & ALTIVEC_REG_BIT (i)) + { + rtx areg, savereg, mem; + int offset; + + offset = info->altivec_save_offset + sp_offset + + 16 * (i - info->first_altivec_reg_save); + + savereg = gen_rtx_REG (V4SImode, i); + + areg = gen_rtx_REG (Pmode, 0); + emit_move_insn (areg, GEN_INT (offset)); + + /* AltiVec addressing mode is [reg+reg]. */ + mem = gen_frame_mem (V4SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, areg)); + + insn = emit_move_insn (mem, savereg); + + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + areg, GEN_INT (offset)); + } + } + + /* VRSAVE is a bit vector representing which AltiVec registers + are used. The OS uses this to determine which vector + registers to save on a context switch. We need to save + VRSAVE on the stack frame, add whatever AltiVec registers we + used in this function, and do the corresponding magic in the + epilogue. */ + + if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE + && info->vrsave_mask != 0) + { + rtx reg, mem, vrsave; + int offset; + + /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12 + as frame_reg_rtx and r11 as the static chain pointer for + nested functions. */ + reg = gen_rtx_REG (SImode, 0); + vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO); + if (TARGET_MACHO) + emit_insn (gen_get_vrsave_internal (reg)); + else + emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave)); + + if (!WORLD_SAVE_P (info)) + { + /* Save VRSAVE. */ + offset = info->vrsave_save_offset + sp_offset; + mem = gen_frame_mem (SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (offset))); + insn = emit_move_insn (mem, reg); + } + + /* Include the registers in the mask. */ + emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask))); + + insn = emit_insn (generate_set_vrsave (reg, info, 0)); + } + /* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */ if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) || (DEFAULT_ABI == ABI_V4 @@ -15041,33 +15054,9 @@ rs6000_emit_epilogue (int sibcall) return; } - /* If we have a frame pointer, a call to alloca, or a large stack - frame, restore the old stack pointer using the backchain. Otherwise, - we know what size to update it with. */ - if (use_backchain_to_restore_sp) - { - /* Under V.4, don't reset the stack pointer until after we're done - loading the saved registers. */ - if (DEFAULT_ABI == ABI_V4) - frame_reg_rtx = gen_rtx_REG (Pmode, 11); - - emit_move_insn (frame_reg_rtx, - gen_rtx_MEM (Pmode, sp_reg_rtx)); - } - else if (info->push_p) - { - if (DEFAULT_ABI == ABI_V4 - || current_function_calls_eh_return) - sp_offset = info->total_size; - else - { - emit_insn (TARGET_32BIT - ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx, - GEN_INT (info->total_size)) - : gen_adddi3 (sp_reg_rtx, sp_reg_rtx, - GEN_INT (info->total_size))); - } - } + /* Set sp_offset based on the stack push from the prologue. */ + if (info->total_size < 32767) + sp_offset = info->total_size; /* Restore AltiVec registers if needed. */ if (TARGET_ALTIVEC_ABI && info->altivec_size != 0) @@ -15108,6 +15097,36 @@ rs6000_emit_epilogue (int sibcall) emit_insn (generate_set_vrsave (reg, info, 1)); } + sp_offset = 0; + + /* If we have a frame pointer, a call to alloca, or a large stack + frame, restore the old stack pointer using the backchain. Otherwise, + we know what size to update it with. */ + if (use_backchain_to_restore_sp) + { + /* Under V.4, don't reset the stack pointer until after we're done + loading the saved registers. */ + if (DEFAULT_ABI == ABI_V4) + frame_reg_rtx = gen_rtx_REG (Pmode, 11); + + emit_move_insn (frame_reg_rtx, + gen_rtx_MEM (Pmode, sp_reg_rtx)); + } + else if (info->push_p) + { + if (DEFAULT_ABI == ABI_V4 + || current_function_calls_eh_return) + sp_offset = info->total_size; + else + { + emit_insn (TARGET_32BIT + ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx, + GEN_INT (info->total_size)) + : gen_adddi3 (sp_reg_rtx, sp_reg_rtx, + GEN_INT (info->total_size))); + } + } + /* Get the old lr if we saved it. */ if (info->lr_save_p) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 02:39:13 2013 Return-Path: Delivered-To: svn-src-all@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 0E0DF85E; Thu, 19 Dec 2013 02:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED2961F86; Thu, 19 Dec 2013 02:39:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ2dCX0092316; Thu, 19 Dec 2013 02:39:12 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ2dBnN092307; Thu, 19 Dec 2013 02:39:11 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312190239.rBJ2dBnN092307@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Dec 2013 02:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259584 - in stable/10/contrib/gcc: . cp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 02:39:13 -0000 Author: pfg Date: Thu Dec 19 02:39:11 2013 New Revision: 259584 URL: http://svnweb.freebsd.org/changeset/base/259584 Log: MFC r258731: gcc: Make use of TREE_OVERFLOW_P. While it was brought in r258179 only to fix a build issue, bringing the rest of the change has the advantage of fixing GCC/19978. Obtained from: gcc 4.3 (rev. 120505; GPLv2) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 stable/10/contrib/gcc/c-common.c stable/10/contrib/gcc/c-typeck.c stable/10/contrib/gcc/cp/ChangeLog.gcc43 stable/10/contrib/gcc/cp/semantics.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 02:32:07 2013 (r259583) +++ stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 02:39:11 2013 (r259584) @@ -348,6 +348,16 @@ * config.gcc: Support core2 processor. +2007-01-05 Manuel Lopez-Ibanez + + PR c/19978 + * tree.h (TREE_OVERFLOW_P): New. + * c-typeck.c (parser_build_unary_op): Warn only if result + overflowed and operands did not. + (parser_build_binary_op): Likewise. + (convert_for_assignment): Remove redundant overflow_warning. + * c-common.c (overflow_warning): Don't check or set TREE_OVERFLOW. + 2006-12-13 Ian Lance Taylor (r119855) PR c++/19564 Modified: stable/10/contrib/gcc/c-common.c ============================================================================== --- stable/10/contrib/gcc/c-common.c Thu Dec 19 02:32:07 2013 (r259583) +++ stable/10/contrib/gcc/c-common.c Thu Dec 19 02:39:11 2013 (r259584) @@ -916,39 +916,45 @@ constant_expression_warning (tree value) pedwarn ("overflow in constant expression"); } -/* Print a warning if an expression had overflow in folding. +/* Print a warning if an expression had overflow in folding and its + operands hadn't. + Invoke this function on every expression that (1) appears in the source code, and - (2) might be a constant expression that overflowed, and + (2) is a constant expression that overflowed, and (3) is not already checked by convert_and_check; - however, do not invoke this function on operands of explicit casts. */ + however, do not invoke this function on operands of explicit casts + or when the expression is the result of an operator and any operand + already overflowed. */ void overflow_warning (tree value) { - if ((TREE_CODE (value) == INTEGER_CST - || (TREE_CODE (value) == COMPLEX_CST - && TREE_CODE (TREE_REALPART (value)) == INTEGER_CST)) - && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "integer overflow in expression"); - } - else if ((TREE_CODE (value) == REAL_CST - || (TREE_CODE (value) == COMPLEX_CST - && TREE_CODE (TREE_REALPART (value)) == REAL_CST)) - && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "floating point overflow in expression"); - } - else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "vector overflow in expression"); + if (skip_evaluation) return; + + switch (TREE_CODE (value)) + { + case INTEGER_CST: + warning (OPT_Woverflow, "integer overflow in expression"); + break; + + case REAL_CST: + warning (OPT_Woverflow, "floating point overflow in expression"); + break; + + case VECTOR_CST: + warning (OPT_Woverflow, "vector overflow in expression"); + break; + + case COMPLEX_CST: + if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST) + warning (OPT_Woverflow, "complex integer overflow in expression"); + else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST) + warning (OPT_Woverflow, "complex floating point overflow in expression"); + break; + + default: + break; } } Modified: stable/10/contrib/gcc/c-typeck.c ============================================================================== --- stable/10/contrib/gcc/c-typeck.c Thu Dec 19 02:32:07 2013 (r259583) +++ stable/10/contrib/gcc/c-typeck.c Thu Dec 19 02:39:11 2013 (r259584) @@ -2616,7 +2616,10 @@ parser_build_unary_op (enum tree_code co result.original_code = ERROR_MARK; result.value = build_unary_op (code, arg.value, 0); - overflow_warning (result.value); + + if (TREE_OVERFLOW_P (result.value) && !TREE_OVERFLOW_P (arg.value)) + overflow_warning (result.value); + return result; } @@ -2660,7 +2663,10 @@ parser_build_binary_op (enum tree_code c warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour"); - overflow_warning (result.value); + if (TREE_OVERFLOW_P (result.value) + && !TREE_OVERFLOW_P (arg1.value) + && !TREE_OVERFLOW_P (arg2.value)) + overflow_warning (result.value); return result; } @@ -3847,10 +3853,7 @@ convert_for_assignment (tree type, tree } if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype)) - { - overflow_warning (rhs); - return rhs; - } + return rhs; if (coder == VOID_TYPE) { Modified: stable/10/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 02:32:07 2013 (r259583) +++ stable/10/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 02:39:11 2013 (r259584) @@ -20,6 +20,12 @@ TREE_OVERFLOW_P is true for the result and not for any of the operands. +2007-01-05 Manuel Lopez-Ibanez + + PR c/19978 + * semantics.c (finish_unary_op_expr): Warn only if result + overflowed and operands did not. + 2006-10-31 Geoffrey Keating (r118360) * name-lookup.c (get_anonymous_namespace_name): New. Modified: stable/10/contrib/gcc/cp/semantics.c ============================================================================== --- stable/10/contrib/gcc/cp/semantics.c Thu Dec 19 02:32:07 2013 (r259583) +++ stable/10/contrib/gcc/cp/semantics.c Thu Dec 19 02:39:11 2013 (r259584) @@ -2012,7 +2012,9 @@ finish_unary_op_expr (enum tree_code cod result = copy_node (result); TREE_NEGATED_INT (result) = 1; } - overflow_warning (result); + if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr)) + overflow_warning (result); + return result; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 02:45:30 2013 Return-Path: Delivered-To: svn-src-all@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 CAC3CA01; Thu, 19 Dec 2013 02:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA9231FFF; Thu, 19 Dec 2013 02:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ2jUY1095494; Thu, 19 Dec 2013 02:45:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ2jTSB095488; Thu, 19 Dec 2013 02:45:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312190245.rBJ2jTSB095488@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Dec 2013 02:45:29 +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: r259585 - in stable/9/contrib/gcc: . cp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 02:45:30 -0000 Author: pfg Date: Thu Dec 19 02:45:29 2013 New Revision: 259585 URL: http://svnweb.freebsd.org/changeset/base/259585 Log: MFC r258731: gcc: Make use of TREE_OVERFLOW_P. While it was brought in r258179 only to fix a build issue, bringing the rest of the change has the advantage of fixing GCC/19978. Obtained from: gcc 4.3 (rev. 120505; GPLv2) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 stable/9/contrib/gcc/c-common.c stable/9/contrib/gcc/c-typeck.c stable/9/contrib/gcc/cp/semantics.c Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 02:39:11 2013 (r259584) +++ stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 02:45:29 2013 (r259585) @@ -322,6 +322,16 @@ * config.gcc: Support core2 processor. +2007-01-05 Manuel Lopez-Ibanez + + PR c/19978 + * tree.h (TREE_OVERFLOW_P): New. + * c-typeck.c (parser_build_unary_op): Warn only if result + overflowed and operands did not. + (parser_build_binary_op): Likewise. + (convert_for_assignment): Remove redundant overflow_warning. + * c-common.c (overflow_warning): Don't check or set TREE_OVERFLOW. + 2006-12-13 Ian Lance Taylor (r119855) PR c++/19564 Modified: stable/9/contrib/gcc/c-common.c ============================================================================== --- stable/9/contrib/gcc/c-common.c Thu Dec 19 02:39:11 2013 (r259584) +++ stable/9/contrib/gcc/c-common.c Thu Dec 19 02:45:29 2013 (r259585) @@ -916,39 +916,45 @@ constant_expression_warning (tree value) pedwarn ("overflow in constant expression"); } -/* Print a warning if an expression had overflow in folding. +/* Print a warning if an expression had overflow in folding and its + operands hadn't. + Invoke this function on every expression that (1) appears in the source code, and - (2) might be a constant expression that overflowed, and + (2) is a constant expression that overflowed, and (3) is not already checked by convert_and_check; - however, do not invoke this function on operands of explicit casts. */ + however, do not invoke this function on operands of explicit casts + or when the expression is the result of an operator and any operand + already overflowed. */ void overflow_warning (tree value) { - if ((TREE_CODE (value) == INTEGER_CST - || (TREE_CODE (value) == COMPLEX_CST - && TREE_CODE (TREE_REALPART (value)) == INTEGER_CST)) - && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "integer overflow in expression"); - } - else if ((TREE_CODE (value) == REAL_CST - || (TREE_CODE (value) == COMPLEX_CST - && TREE_CODE (TREE_REALPART (value)) == REAL_CST)) - && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "floating point overflow in expression"); - } - else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value)) - { - TREE_OVERFLOW (value) = 0; - if (skip_evaluation == 0) - warning (OPT_Woverflow, "vector overflow in expression"); + if (skip_evaluation) return; + + switch (TREE_CODE (value)) + { + case INTEGER_CST: + warning (OPT_Woverflow, "integer overflow in expression"); + break; + + case REAL_CST: + warning (OPT_Woverflow, "floating point overflow in expression"); + break; + + case VECTOR_CST: + warning (OPT_Woverflow, "vector overflow in expression"); + break; + + case COMPLEX_CST: + if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST) + warning (OPT_Woverflow, "complex integer overflow in expression"); + else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST) + warning (OPT_Woverflow, "complex floating point overflow in expression"); + break; + + default: + break; } } Modified: stable/9/contrib/gcc/c-typeck.c ============================================================================== --- stable/9/contrib/gcc/c-typeck.c Thu Dec 19 02:39:11 2013 (r259584) +++ stable/9/contrib/gcc/c-typeck.c Thu Dec 19 02:45:29 2013 (r259585) @@ -2616,7 +2616,10 @@ parser_build_unary_op (enum tree_code co result.original_code = ERROR_MARK; result.value = build_unary_op (code, arg.value, 0); - overflow_warning (result.value); + + if (TREE_OVERFLOW_P (result.value) && !TREE_OVERFLOW_P (arg.value)) + overflow_warning (result.value); + return result; } @@ -2660,7 +2663,10 @@ parser_build_binary_op (enum tree_code c warning (OPT_Waddress, "comparison with string literal results in unspecified behaviour"); - overflow_warning (result.value); + if (TREE_OVERFLOW_P (result.value) + && !TREE_OVERFLOW_P (arg1.value) + && !TREE_OVERFLOW_P (arg2.value)) + overflow_warning (result.value); return result; } @@ -3847,10 +3853,7 @@ convert_for_assignment (tree type, tree } if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype)) - { - overflow_warning (rhs); - return rhs; - } + return rhs; if (coder == VOID_TYPE) { Modified: stable/9/contrib/gcc/cp/semantics.c ============================================================================== --- stable/9/contrib/gcc/cp/semantics.c Thu Dec 19 02:39:11 2013 (r259584) +++ stable/9/contrib/gcc/cp/semantics.c Thu Dec 19 02:45:29 2013 (r259585) @@ -2012,7 +2012,9 @@ finish_unary_op_expr (enum tree_code cod result = copy_node (result); TREE_NEGATED_INT (result) = 1; } - overflow_warning (result); + if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr)) + overflow_warning (result); + return result; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 03:21:54 2013 Return-Path: Delivered-To: svn-src-all@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 4912F1C2; Thu, 19 Dec 2013 03:21:54 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD9012C6; Thu, 19 Dec 2013 03:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ3LsbK012482; Thu, 19 Dec 2013 03:21:54 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ3Lscd012481; Thu, 19 Dec 2013 03:21:54 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312190321.rBJ3Lscd012481@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 19 Dec 2013 03:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259586 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 03:21:54 -0000 Author: rodrigc Date: Thu Dec 19 03:21:53 2013 New Revision: 259586 URL: http://svnweb.freebsd.org/changeset/base/259586 Log: Add entry for bhyve. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 02:45:29 2013 (r259585) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 03:21:53 2013 (r259586) @@ -120,6 +120,11 @@ Kernel Changes + The BSD Hypervisor, &man.bhyve.8; is included + with &os;. &man.bhyve.8; requires Intel CPUs with VT-x and Extended Page Table (EPT) + support. These features are on all Nehalem models and beyond + (e.g. Nehalem and newer), but not on the lower-end Atom CPUs. + The maximum amount of memory the &os; kernel can address has been increased from 1TB to 4TB. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 03:48:37 2013 Return-Path: Delivered-To: svn-src-all@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 074A774C; Thu, 19 Dec 2013 03:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB9761491; Thu, 19 Dec 2013 03:48:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ3maei020351; Thu, 19 Dec 2013 03:48:36 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ3magP020349; Thu, 19 Dec 2013 03:48:36 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312190348.rBJ3magP020349@svn.freebsd.org> From: Mark Johnston Date: Thu, 19 Dec 2013 03:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259587 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 03:48:37 -0000 Author: markj Date: Thu Dec 19 03:48:36 2013 New Revision: 259587 URL: http://svnweb.freebsd.org/changeset/base/259587 Log: Invoke the kld_* event handlers from linker_load_file() and linker_unload_file() rather than kern_kldload() and kern_kldunload(). This ensures that the handlers are invoked for files that are loaded/unloaded automatically as dependencies. Previously, they were only invoked for files loaded by a user. As a side effect, the kld_load and kld_unload handlers are now invoked with the kernel linker lock exclusively held. Reported by: avg Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Dec 19 03:21:53 2013 (r259586) +++ head/sys/kern/kern_linker.c Thu Dec 19 03:48:36 2013 (r259587) @@ -434,6 +434,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -609,6 +610,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -690,6 +697,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1033,10 +1044,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; - - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_load, lf); - sx_sunlock(&kld_sx); + sx_xunlock(&kld_sx); done: CURVNET_RESTORE(); @@ -1066,9 +1074,6 @@ int kern_kldunload(struct thread *td, int fileid, int flags) { linker_file_t lf; - char *filename = NULL; - caddr_t address; - size_t size; int error = 0; if ((error = securelevel_gt(td->td_ucred, 0)) != 0) @@ -1083,10 +1088,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload_try, lf, &error); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1094,11 +1096,6 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { - /* Save data needed for the kld_unload callbacks. */ - filename = strdup(lf->filename, M_TEMP); - address = lf->address; - size = lf->size; - lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1106,14 +1103,7 @@ kern_kldunload(struct thread *td, int fi } } else error = ENOENT; - - if (error == 0) { - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_unload, filename, address, size); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); - free(filename, M_TEMP); + sx_xunlock(&kld_sx); CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 04:55:35 2013 Return-Path: Delivered-To: svn-src-all@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 ADC569B; Thu, 19 Dec 2013 04:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 995C21892; Thu, 19 Dec 2013 04:55:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ4tZjg045034; Thu, 19 Dec 2013 04:55:35 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ4tZlq045033; Thu, 19 Dec 2013 04:55:35 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312190455.rBJ4tZlq045033@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 19 Dec 2013 04:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259588 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 04:55:35 -0000 Author: rodrigc Date: Thu Dec 19 04:55:35 2013 New Revision: 259588 URL: http://svnweb.freebsd.org/changeset/base/259588 Log: Add item for pkg(8). Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 03:48:36 2013 (r259587) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 04:55:35 2013 (r259588) @@ -538,18 +538,10 @@ Ports/Packages Collection Infrastructure - The &man.pkg.create.1; utility now supports - . When this option is specified and a - package tarball exists, it will not be overwritten. This is - useful when multiple packages are saved with several consecutive - runs of &man.pkg.create.1; with the - options. - - The pkg_sign and pkg_check utilities for cryptographically - signing &os; packages have been removed. They were only useful - for packages compressed using &man.gzip.1;; however - &man.bzip2.1; compression has been the norm for some time - now. + The pkg_add, pkg_create, pkg_delete, pkg_info, + pkg_updating, and pkg_version utilities have been removed. + &man.pkg.8; must now be used to install binary packages. &man.pkg.8; + is the next generation &os; package manager, also referred to as "pkgng". From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:22:48 2013 Return-Path: Delivered-To: svn-src-all@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 E34E7585; Thu, 19 Dec 2013 05:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDF411A48; Thu, 19 Dec 2013 05:22:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5MmNT055770; Thu, 19 Dec 2013 05:22:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5Mmf7055769; Thu, 19 Dec 2013 05:22:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312190522.rBJ5Mmf7055769@svn.freebsd.org> From: Glen Barber Date: Thu, 19 Dec 2013 05:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259589 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:22:49 -0000 Author: gjb Date: Thu Dec 19 05:22:48 2013 New Revision: 259589 URL: http://svnweb.freebsd.org/changeset/base/259589 Log: Fix doc build. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 04:55:35 2013 (r259588) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 19 05:22:48 2013 (r259589) @@ -540,7 +540,7 @@ The pkg_add, pkg_create, pkg_delete, pkg_info, pkg_updating, and pkg_version utilities have been removed. - &man.pkg.8; must now be used to install binary packages. &man.pkg.8; + &man.pkg.7; must now be used to install binary packages. &man.pkg.7; is the next generation &os; package manager, also referred to as "pkgng". From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:23:11 2013 Return-Path: Delivered-To: svn-src-all@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 70E226CB; Thu, 19 Dec 2013 05:23:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4317C1A4F; Thu, 19 Dec 2013 05:23:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5NBT4055858; Thu, 19 Dec 2013 05:23:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5NA5f055856; Thu, 19 Dec 2013 05:23:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312190523.rBJ5NA5f055856@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 19 Dec 2013 05:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259590 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:23:11 -0000 Author: marcel Date: Thu Dec 19 05:23:10 2013 New Revision: 259590 URL: http://svnweb.freebsd.org/changeset/base/259590 Log: Fix readdir for the root directory on a FAT32 file system. The root directory is like any subdirectory and as such needs to use a real cluster number. To this end, keep a DE structure for the root in the DOS_FS structure and populate it accordingly. While here: o allow consecutive path separators by skipping them all. o add missing $FreeBSD$ keyword to dosfs.h. Modified: head/lib/libstand/dosfs.c head/lib/libstand/dosfs.h Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Thu Dec 19 05:22:48 2013 (r259589) +++ head/lib/libstand/dosfs.c Thu Dec 19 05:23:10 2013 (r259590) @@ -162,6 +162,14 @@ dos_mount(DOS_FS *fs, struct open_file * (void)dosunmount(fs); return(err); } + fs->root = dot[0]; + fs->root.name[0] = ' '; + if (fs->fatsz == 32) { + fs->root.clus[0] = fs->rdcl & 0xff; + fs->root.clus[1] = (fs->rdcl >> 8) & 0xff; + fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; + fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; + } return 0; } @@ -494,10 +502,12 @@ namede(DOS_FS *fs, const char *path, DOS int err; err = 0; - de = dot; - if (*path == '/') - path++; + de = &fs->root; while (*path) { + while (*path == '/') + path++; + if (*path == '\0') + break; if (!(s = strchr(path, '/'))) s = strchr(path, 0); if ((n = s - path) > 255) @@ -509,8 +519,6 @@ namede(DOS_FS *fs, const char *path, DOS return ENOTDIR; if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) return err; - if (*path == '/') - path++; } *dep = de; return 0; Modified: head/lib/libstand/dosfs.h ============================================================================== --- head/lib/libstand/dosfs.h Thu Dec 19 05:22:48 2013 (r259589) +++ head/lib/libstand/dosfs.h Thu Dec 19 05:23:10 2013 (r259590) @@ -23,6 +23,8 @@ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef DOSIO_H @@ -108,6 +110,7 @@ typedef struct { u_int lsndta; /* start of data area */ u_int fatsz; /* FAT entry size */ u_int xclus; /* maximum cluster number */ + DOS_DE root; } DOS_FS; typedef struct { From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:28:43 2013 Return-Path: Delivered-To: svn-src-all@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 ADA3F869; Thu, 19 Dec 2013 05:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99A0D1A78; Thu, 19 Dec 2013 05:28:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5Shjp056451; Thu, 19 Dec 2013 05:28:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5Shm0056450; Thu, 19 Dec 2013 05:28:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312190528.rBJ5Shm0056450@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 19 Dec 2013 05:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259591 - head/sys/boot/ia64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:28:43 -0000 Author: marcel Date: Thu Dec 19 05:28:43 2013 New Revision: 259591 URL: http://svnweb.freebsd.org/changeset/base/259591 Log: Bump the loader version to 3.2 after various dosfs fixes (in particular). Modified: head/sys/boot/ia64/efi/version Modified: head/sys/boot/ia64/efi/version ============================================================================== --- head/sys/boot/ia64/efi/version Thu Dec 19 05:23:10 2013 (r259590) +++ head/sys/boot/ia64/efi/version Thu Dec 19 05:28:43 2013 (r259591) @@ -3,6 +3,7 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +3.2: Various fixes to libstand, in particular dosfs. 3.1: Add the about, reboot and pbvm commands. I-cache coherency is maintained. 3.0: Add support for PBVM. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:36:07 2013 Return-Path: Delivered-To: svn-src-all@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 A7E50A42; Thu, 19 Dec 2013 05:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 941AC1AF5; Thu, 19 Dec 2013 05:36:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5a7q5059738; Thu, 19 Dec 2013 05:36:07 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5a708059733; Thu, 19 Dec 2013 05:36:07 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190536.rBJ5a708059733@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 05:36: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: r259592 - in 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:36:07 -0000 Author: truckman Date: Thu Dec 19 05:36:06 2013 New Revision: 259592 URL: http://svnweb.freebsd.org/changeset/base/259592 Log: MFC r258363: Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my Virgin Mobile branded device. It needs the U3GINIT_SCSIEJECT quirk. Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Thu Dec 19 05:28:43 2013 (r259591) +++ stable/10/sys/dev/usb/serial/u3g.c Thu Dec 19 05:36:06 2013 (r259592) @@ -345,6 +345,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Dec 19 05:28:43 2013 (r259591) +++ stable/10/sys/dev/usb/usbdevs Thu Dec 19 05:36:06 2013 (r259592) @@ -3147,6 +3147,7 @@ product NOVATEL EU870D 0x2420 Expedite product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD product NOVATEL MIFI2200 0x5041 Novatel MiFi 2200 CDMA product NOVATEL U727_2 0x5100 Merlin U727 CDMA From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:36:41 2013 Return-Path: Delivered-To: svn-src-all@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 E4916B72; Thu, 19 Dec 2013 05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D063E1AF9; Thu, 19 Dec 2013 05:36:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5affv059824; Thu, 19 Dec 2013 05:36:41 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5af6S059822; Thu, 19 Dec 2013 05:36:41 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190536.rBJ5af6S059822@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 05:36: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: r259593 - in 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:36:42 -0000 Author: truckman Date: Thu Dec 19 05:36:41 2013 New Revision: 259593 URL: http://svnweb.freebsd.org/changeset/base/259593 Log: MFC r258363: Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my Virgin Mobile branded device. It needs the U3GINIT_SCSIEJECT quirk. Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs 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 Thu Dec 19 05:36:06 2013 (r259592) +++ stable/9/sys/dev/usb/serial/u3g.c Thu Dec 19 05:36:41 2013 (r259593) @@ -345,6 +345,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Thu Dec 19 05:36:06 2013 (r259592) +++ stable/9/sys/dev/usb/usbdevs Thu Dec 19 05:36:41 2013 (r259593) @@ -3173,6 +3173,7 @@ product NOVATEL EU870D 0x2420 Expedite product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD product NOVATEL MIFI2200 0x5041 Novatel MiFi 2200 CDMA product NOVATEL U727_2 0x5100 Merlin U727 CDMA From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:51:03 2013 Return-Path: Delivered-To: svn-src-all@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 6ADACDB7; Thu, 19 Dec 2013 05:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 530AA1CFB; Thu, 19 Dec 2013 05:51:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5p3Fr066129; Thu, 19 Dec 2013 05:51:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5p2jo066120; Thu, 19 Dec 2013 05:51:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201312190551.rBJ5p2jo066120@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 19 Dec 2013 05:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259594 - in vendor-sys/acpica/dist: . generate/release generate/unix source/common source/compiler source/components/debugger source/components/dispatcher source/components/events sour... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:51:03 -0000 Author: jkim Date: Thu Dec 19 05:51:01 2013 New Revision: 259594 URL: http://svnweb.freebsd.org/changeset/base/259594 Log: Import ACPICA 20131218. Added: vendor-sys/acpica/dist/source/tools/examples/examples.h (contents, props changed) vendor-sys/acpica/dist/source/tools/examples/exstubs.c (contents, props changed) vendor-sys/acpica/dist/source/tools/examples/extables.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/release/build.sh vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/source/common/adfile.c vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/asllookup.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslstubs.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/readme.txt vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/events/evgpeblk.c vendor-sys/acpica/dist/source/components/events/evgpeutil.c vendor-sys/acpica/dist/source/components/executer/exresnte.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/parser/psopinfo.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/utilities/utaddress.c vendor-sys/acpica/dist/source/components/utilities/utalloc.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utdebug.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acevents.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/os_specific/service_layers/osunixdir.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpibin/acpibin.h vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/acpisrc/asremove.c vendor-sys/acpica/dist/source/tools/examples/examples.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/changes.txt Thu Dec 19 05:51:01 2013 (r259594) @@ -1,4 +1,106 @@ ---------------------------------------- +18 December 2013. Summary of changes for version 20131218: + +Global note: The ACPI 5.0A specification was released this month. There +are no changes needed for ACPICA since this release of ACPI is an +errata/clarification release. The specification is available at +acpi.info. + + +1) ACPICA kernel-resident subsystem: + +Added validation of the XSDT root table if it is present. Some older +platforms contain an XSDT that is ill-formed or otherwise invalid (such +as containing some or all entries that are NULL pointers). This change +adds a new function to validate the XSDT before actually using it. If the +XSDT is found to be invalid, ACPICA will now automatically fall back to +using the RSDT instead. Original implementation by Zhao Yakui. Ported to +ACPICA and enhanced by Lv Zheng and Bob Moore. + +Added a runtime option to ignore the XSDT and force the use of the RSDT. +This change adds a runtime option that will force ACPICA to use the RSDT +instead of the XSDT (AcpiGbl_DoNotUseXsdt). Although the ACPI spec +requires that an XSDT be used instead of the RSDT, the XSDT has been +found to be corrupt or ill-formed on some machines. Lv Zheng. + +Added a runtime option to favor 32-bit FADT register addresses over the +64-bit addresses. This change adds an option to favor 32-bit FADT +addresses when there is a conflict between the 32-bit and 64-bit versions +of the same register. The default behavior is to use the 64-bit version +in accordance with the ACPI specification. This can now be overridden via +the AcpiGbl_Use32BitFadtAddresses flag. ACPICA BZ 885. Lv Zheng. + +During the change above, the internal "Convert FADT" and "Verify FADT" +functions have been merged to simplify the code, making it easier to +understand and maintain. ACPICA BZ 933. + +Improve exception reporting and handling for GPE block installation. +Return an actual status from AcpiEvGetGpeXruptBlock and don't clobber the +status when exiting AcpiEvInstallGpeBlock. ACPICA BZ 1019. + +Added helper macros to extract bus/segment numbers from the HEST table. +This change adds two macros to extract the encoded bus and segment +numbers from the HEST Bus field - ACPI_HEST_BUS and ACPI_HEST_SEGMENT. +Betty Dall + +Removed the unused ACPI_FREE_BUFFER macro. This macro is no longer used +by ACPICA. It is not a public macro, so it should have no effect on +existing OSV code. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total + Debug Version: 185.6K Code, 77.3K Data, 262.9K Total + Previous Release: + Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total + Debug Version: 185.1K Code, 77.2K Data, 262.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Improved pathname support for emitted External() +statements. This change adds full pathname support for external names +that have been resolved internally by the inclusion of additional ACPI +tables (via the iASL -e option). Without this change, the disassembler +can emit multiple externals for the same object, or it become confused +when the Scope() operator is used on an external object. Overall, greatly +improves the ability to actually recompile the emitted ASL code when +objects a referenced across multiple ACPI tables. Reported by Michael +Tsirkin (mst@redhat.com). + +Tests/ASLTS: Updated functional control suite to execute with no errors. +David Box. Fixed several errors related to the testing of the interpreter +slack mode. Lv Zheng. + +iASL: Added support to detect names that are declared within a control +method, but are unused (these are temporary names that are only valid +during the time the method is executing). A remark is issued for these +cases. ACPICA BZ 1022. + +iASL: Added full support for the DBG2 table. Adds full disassembler, +table compiler, and template generator support for the DBG2 table (Debug +Port 2 table). + +iASL: Added full support for the PCCT table, update the table definition. +Updates the PCCT table definition in the actbl3.h header and adds table +compiler and template generator support. + +iASL: Added an option to emit only error messages (no warnings/remarks). +The -ve option will enable only error messages, warnings and remarks are +suppressed. This can simplify debugging when only the errors are +important, such as when an ACPI table is disassembled and there are many +warnings and remarks -- but only the actual errors are of real interest. + +Example ACPICA code (source/tools/examples): Updated the example code so +that it builds to an actual working program, not just example code. Added +ACPI tables and execution of an example control method in the DSDT. Added +makefile support for Unix generation. + +---------------------------------------- 15 November 2013. Summary of changes for version 20131115: This release is available at https://acpica.org/downloads Modified: vendor-sys/acpica/dist/generate/release/build.sh ============================================================================== --- vendor-sys/acpica/dist/generate/release/build.sh Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/generate/release/build.sh Thu Dec 19 05:51:01 2013 (r259594) @@ -95,9 +95,9 @@ convert_to_unix_line_terminators() # Convert all CR/LF pairs to Unix format (LF only) # cd $TEMP_DIR - echo Starting CR/LF to LF Conversion - find . -name "*" | xargs $DOS2UNIX - echo Completed CR/LF to LF Conversion + echo "Starting CR/LF to LF (UNIX) full source conversion" + find . -name "*" | xargs $DOS2UNIX -q + echo "Completed CR/LF to LF (UNIX) full source conversion" cd .. } @@ -108,9 +108,9 @@ convert_to_dos_line_terminators() # Note: Checks shell scripts only (*.sh) # cd $TEMP_DIR - echo Starting LF to CR/LF Conversion - find . -name "*.sh" | xargs $UNIX2DOS - echo Completed LF to CR/LF Conversion + echo "Starting LF to CR/LF (DOS) script conversion" + find . -name "*.sh" | xargs $UNIX2DOS -q + echo "Completed LF to CR/LF (DOS) script conversion" cd .. } @@ -158,7 +158,7 @@ build_windows_package() # cd $TEMP_DIR rm -r -f ../$TARGET_DIR/$PACKAGE_FILENAME - $ZIP_UTILITY -add -max -dir -sort=name ../$TARGET_DIR/$PACKAGE_FILENAME + $ZIP_UTILITY -silent -add -max -dir -sort=name ../$TARGET_DIR/$PACKAGE_FILENAME cd .. } Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Dec 19 05:51:01 2013 (r259594) @@ -33,7 +33,7 @@ # not be necessary to change it. # .SUFFIXES : -PROGS = acpibin acpidump acpiexec acpihelp acpinames acpisrc acpixtract iasl +PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl HOST ?= _CYGWIN CC = gcc @@ -102,6 +102,7 @@ ACPICA_UTILITIES = $(ACPICA_CORE)/u # ACPIBIN = $(ACPICA_TOOLS)/acpibin ACPIDUMP = $(ACPICA_TOOLS)/acpidump +ACPIEXAMPLES = $(ACPICA_TOOLS)/examples ACPIEXEC = $(ACPICA_TOOLS)/acpiexec ACPIHELP = $(ACPICA_TOOLS)/acpihelp ACPINAMES = $(ACPICA_TOOLS)/acpinames Modified: vendor-sys/acpica/dist/source/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adfile.c Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/source/common/adfile.c Thu Dec 19 05:51:01 2013 (r259594) @@ -199,6 +199,7 @@ FlGenerateFilename ( { char *Position; char *NewFilename; + char *DirectoryPosition; /* @@ -211,8 +212,10 @@ FlGenerateFilename ( /* Try to find the last dot in the filename */ + DirectoryPosition = strrchr (NewFilename, '/'); Position = strrchr (NewFilename, '.'); - if (Position) + + if (Position && (Position > DirectoryPosition)) { /* Tack on the new suffix */ Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/source/common/adwalk.c Thu Dec 19 05:51:01 2013 (r259594) @@ -469,8 +469,9 @@ AcpiDmFindOrphanDescending ( !ChildOp->Common.Node) { AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String, - NULL, &Path); - AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n", Op->Common.AmlOpName, Path); + NULL, &Path); + AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n", + Op->Common.AmlOpName, Path); ACPI_FREE (Path); NextOp = Op->Common.Next; @@ -478,22 +479,26 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0); return (AE_OK); } ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp); - AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op)); + AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", + ArgCount, AcpiDmCountChildren (Op)); if (ArgCount < 1) { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0); } break; #endif @@ -509,7 +514,8 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0); return (AE_OK); } @@ -518,11 +524,13 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddOpToExternalList (ChildOp, + ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0); } break; @@ -554,7 +562,8 @@ AcpiDmFindOrphanDescending ( /* And namepath is the first argument */ (ParentOp->Common.Value.Arg == Op)) { - AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddOpToExternalList (Op, + Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0); break; } } @@ -564,8 +573,8 @@ AcpiDmFindOrphanDescending ( * operator) - it *must* be a method invocation, nothing else is * grammatically possible. */ - AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); - + AcpiDmAddOpToExternalList (Op, + Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0); } break; @@ -741,6 +750,7 @@ AcpiDmXrefDescendingOp ( ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *Object; UINT32 ParamCount = 0; + char *Pathname; WalkState = Info->WalkState; @@ -808,11 +818,14 @@ AcpiDmXrefDescendingOp ( * The namespace is also used as a lookup table for references to resource * descriptors and the fields within them. */ + Node = NULL; Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState, &Node); if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL)) { + /* Node was created by an External() statement */ + Status = AE_NOT_FOUND; } @@ -830,16 +843,28 @@ AcpiDmXrefDescendingOp ( if (!(Op->Asl.Parent && (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP))) { - AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); + if (Node) + { + AcpiDmAddNodeToExternalList (Node, + (UINT8) ObjectType, 0, 0); + } + else + { + AcpiDmAddOpToExternalList (Op, Path, + (UINT8) ObjectType, 0, 0); + } } } } /* - * Found the node in external table, add it to external list - * Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc + * Found the node, but check if it came from an external table. + * Add it to external list. Note: Node->OwnerId == 0 indicates + * one of the built-in ACPI Names (_OS_ etc.) which can safely + * be ignored. */ - else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId) + else if (Node->OwnerId && + (WalkState->OwnerId != Node->OwnerId)) { ObjectType2 = ObjectType; @@ -853,7 +878,16 @@ AcpiDmXrefDescendingOp ( } } - AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80); + Pathname = AcpiNsGetExternalPathname (Node); + if (!Pathname) + { + return (AE_NO_MEMORY); + } + + AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2, + ParamCount, ACPI_EXT_RESOLVED_REFERENCE); + + ACPI_FREE (Pathname); Op->Common.Node = Node; } else Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Thu Dec 19 05:36:41 2013 (r259593) +++ vendor-sys/acpica/dist/source/common/dmextern.c Thu Dec 19 05:51:01 2013 (r259594) @@ -104,10 +104,19 @@ AcpiDmNormalizeParentPrefix ( char *Path); static void -AcpiDmAddToExternalListFromFile ( +AcpiDmAddPathToExternalList ( char *Path, UINT8 Type, - UINT32 Value); + UINT32 Value, + UINT16 Flags); + +static ACPI_STATUS +AcpiDmCreateNewExternal ( + char *ExternalPath, + char *InternalPath, + UINT8 Type, + UINT32 Value, + UINT16 Flags); /******************************************************************************* @@ -349,196 +358,6 @@ AcpiDmClearExternalFileList ( /******************************************************************************* * - * FUNCTION: AcpiDmAddToExternalList - * - * PARAMETERS: Op - Current parser Op - * Path - Internal (AML) path to the object - * Type - ACPI object type to be added - * Value - Arg count if adding a Method object - * - * RETURN: None - * - * DESCRIPTION: Insert a new name into the global list of Externals which - * will in turn be later emitted as an External() declaration - * in the disassembled output. - * - ******************************************************************************/ - -void -AcpiDmAddToExternalList ( - ACPI_PARSE_OBJECT *Op, - char *Path, - UINT8 Type, - UINT32 Value) -{ - char *ExternalPath; - char *Fullpath = NULL; - ACPI_EXTERNAL_LIST *NewExternal; - ACPI_EXTERNAL_LIST *NextExternal; - ACPI_EXTERNAL_LIST *PrevExternal = NULL; - ACPI_STATUS Status; - BOOLEAN Resolved = FALSE; - - - if (!Path) - { - return; - } - - if (Type == ACPI_TYPE_METHOD) - { - if (Value & 0x80) - { - Resolved = TRUE; - } - Value &= 0x07; - } - - /* - * We don't want External() statements to contain a leading '\'. - * This prevents duplicate external statements of the form: - * - * External (\ABCD) - * External (ABCD) - * - * This would cause a compile time error when the disassembled - * output file is recompiled. - */ - if ((*Path == AML_ROOT_PREFIX) && (Path[1])) - { - Path++; - } - - /* Externalize the ACPI pathname */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, - NULL, &ExternalPath); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* - * Get the full pathname from the root if "Path" has one or more - * parent prefixes (^). Note: path will not contain a leading '\'. - */ - if (*Path == (UINT8) AML_PARENT_PREFIX) - { - Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath); - if (Fullpath) - { - /* Set new external path */ - - ACPI_FREE (ExternalPath); - ExternalPath = Fullpath; - } - } - - /* Check all existing externals to ensure no duplicates */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) - { - /* Duplicate method, check that the Value (ArgCount) is the same */ - - if ((NextExternal->Type == ACPI_TYPE_METHOD) && - (NextExternal->Value != Value)) - { - ACPI_ERROR ((AE_INFO, - "External method arg count mismatch %s: Current %u, attempted %u", - NextExternal->Path, NextExternal->Value, Value)); - } - - /* Allow upgrade of type from ANY */ - - else if (NextExternal->Type == ACPI_TYPE_ANY) - { - NextExternal->Type = Type; - NextExternal->Value = Value; - } - - ACPI_FREE (ExternalPath); - return; - } - - NextExternal = NextExternal->Next; - } - - /* Allocate and init a new External() descriptor */ - - NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); - if (!NewExternal) - { - ACPI_FREE (ExternalPath); - return; - } - - NewExternal->Path = ExternalPath; - NewExternal->Type = Type; - NewExternal->Value = Value; - NewExternal->Resolved = Resolved; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); - - /* Was the external path with parent prefix normalized to a fullpath? */ - - if (Fullpath == ExternalPath) - { - /* Get new internal path */ - - Status = AcpiNsInternalizeName (ExternalPath, &Path); - if (ACPI_FAILURE (Status)) - { - ACPI_FREE (ExternalPath); - ACPI_FREE (NewExternal); - return; - } - - /* Set flag to indicate External->InternalPath need to be freed */ - - NewExternal->Flags |= ACPI_IPATH_ALLOCATED; - } - - NewExternal->InternalPath = Path; - - /* Link the new descriptor into the global list, alphabetically ordered */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) - { - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } - - NewExternal->Next = NextExternal; - return; - } - - PrevExternal = NextExternal; - NextExternal = NextExternal->Next; - } - - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } -} - - -/******************************************************************************* - * * FUNCTION: AcpiDmGetExternalsFromFile * * PARAMETERS: None @@ -619,7 +438,8 @@ AcpiDmGetExternalsFromFile ( AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n", Gbl_ExternalRefFilename, ArgCount, MethodName); - AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80); + AcpiDmAddPathToExternalList (MethodName, ACPI_TYPE_METHOD, + ArgCount, (ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_FILE)); ImportCount++; } @@ -644,11 +464,13 @@ AcpiDmGetExternalsFromFile ( /******************************************************************************* * - * FUNCTION: AcpiDmAddToExternalListFromFile + * FUNCTION: AcpiDmAddOpToExternalList * - * PARAMETERS: Path - Internal (AML) path to the object + * PARAMETERS: Op - Current parser Op + * Path - Internal (AML) path to the object * Type - ACPI object type to be added * Value - Arg count if adding a Method object + * Flags - To be passed to the external object * * RETURN: None * @@ -656,60 +478,315 @@ AcpiDmGetExternalsFromFile ( * will in turn be later emitted as an External() declaration * in the disassembled output. * + * This function handles the most common case where the referenced + * name is simply not found in the constructed namespace. + * ******************************************************************************/ -static void -AcpiDmAddToExternalListFromFile ( +void +AcpiDmAddOpToExternalList ( + ACPI_PARSE_OBJECT *Op, char *Path, UINT8 Type, - UINT32 Value) + UINT32 Value, + UINT16 Flags) { - char *InternalPath; char *ExternalPath; - ACPI_EXTERNAL_LIST *NewExternal; - ACPI_EXTERNAL_LIST *NextExternal; - ACPI_EXTERNAL_LIST *PrevExternal = NULL; + char *InternalPath = Path; + char *Temp; ACPI_STATUS Status; - BOOLEAN Resolved = FALSE; + + + ACPI_FUNCTION_TRACE (DmAddOpToExternalList); if (!Path) { - return; + return_VOID; } - /* TBD: Add a flags parameter */ + /* Remove a root backslash if present */ - if (Type == ACPI_TYPE_METHOD) + if ((*Path == AML_ROOT_PREFIX) && (Path[1])) { - if (Value & 0x80) - { - Resolved = TRUE; - } - Value &= 0x07; + Path++; + } + + /* Externalize the pathname */ + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + return_VOID; } /* - * We don't want External() statements to contain a leading '\'. - * This prevents duplicate external statements of the form: - * - * External (\ABCD) - * External (ABCD) - * - * This would cause a compile time error when the disassembled - * output file is recompiled. + * Get the full pathname from the root if "Path" has one or more + * parent prefixes (^). Note: path will not contain a leading '\'. */ + if (*Path == (UINT8) AML_PARENT_PREFIX) + { + Temp = AcpiDmNormalizeParentPrefix (Op, ExternalPath); + + /* Set new external path */ + + ACPI_FREE (ExternalPath); + ExternalPath = Temp; + if (!Temp) + { + return_VOID; + } + + /* Create the new internal pathname */ + + Flags |= ACPI_EXT_INTERNAL_PATH_ALLOCATED; + Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + return_VOID; + } + } + + /* Create the new External() declaration node */ + + Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, + Type, Value, Flags); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + if (Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED) + { + ACPI_FREE (InternalPath); + } + } + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddNodeToExternalList + * + * PARAMETERS: Node - Namespace node for object to be added + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * Flags - To be passed to the external object + * + * RETURN: None + * + * DESCRIPTION: Insert a new name into the global list of Externals which + * will in turn be later emitted as an External() declaration + * in the disassembled output. + * + * This function handles the case where the referenced name has + * been found in the namespace, but the name originated in a + * table other than the one that is being disassembled (such + * as a table that is added via the iASL -e option). + * + ******************************************************************************/ + +void +AcpiDmAddNodeToExternalList ( + ACPI_NAMESPACE_NODE *Node, + UINT8 Type, + UINT32 Value, + UINT16 Flags) +{ + char *ExternalPath; + char *InternalPath; + char *Temp; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (DmAddNodeToExternalList); + + + if (!Node) + { + return_VOID; + } + + /* Get the full external and internal pathnames to the node */ + + ExternalPath = AcpiNsGetExternalPathname (Node); + if (!ExternalPath) + { + return_VOID; + } + + Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + return_VOID; + } + + /* Remove the root backslash */ + + if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) + { + Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1); + if (!Temp) + { + return_VOID; + } + + ACPI_STRCPY (Temp, &ExternalPath[1]); + ACPI_FREE (ExternalPath); + ExternalPath = Temp; + } + + /* Create the new External() declaration node */ + + Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, Type, + Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED)); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + ACPI_FREE (InternalPath); + } + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddPathToExternalList + * + * PARAMETERS: Path - External name of the object to be added + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * Flags - To be passed to the external object + * + * RETURN: None + * + * DESCRIPTION: Insert a new name into the global list of Externals which + * will in turn be later emitted as an External() declaration + * in the disassembled output. + * + * This function currently is used to add externals via a + * reference file (via the -fe iASL option). + * + ******************************************************************************/ + +static void +AcpiDmAddPathToExternalList ( + char *Path, + UINT8 Type, + UINT32 Value, + UINT16 Flags) +{ + char *InternalPath; + char *ExternalPath; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (DmAddPathToExternalList); + + + if (!Path) + { + return_VOID; + } + + /* Remove a root backslash if present */ + if ((*Path == AML_ROOT_PREFIX) && (Path[1])) { Path++; } + /* Create the internal and external pathnames */ + + Status = AcpiNsInternalizeName (Path, &InternalPath); + if (ACPI_FAILURE (Status)) + { + return_VOID; + } + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (InternalPath); + return_VOID; + } + + /* Create the new External() declaration node */ + + Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, + Type, Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED)); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + ACPI_FREE (InternalPath); + } + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmCreateNewExternal + * + * PARAMETERS: ExternalPath - External path to the object + * InternalPath - Internal (AML) path to the object + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * Flags - To be passed to the external object + * + * RETURN: Status + * + * DESCRIPTION: Common low-level function to insert a new name into the global + * list of Externals which will in turn be later emitted as + * External() declarations in the disassembled output. + * + * Note: The external name should not include a root prefix + * (backslash). We do not want External() statements to contain + * a leading '\', as this prevents duplicate external statements + * of the form: + * + * External (\ABCD) + * External (ABCD) + * + * This would cause a compile time error when the disassembled + * output file is recompiled. + * + * There are two cases that are handled here. For both, we emit + * an External() statement: + * 1) The name was simply not found in the namespace. + * 2) The name was found, but it originated in a table other than + * the table that is being disassembled. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmCreateNewExternal ( + char *ExternalPath, + char *InternalPath, + UINT8 Type, + UINT32 Value, + UINT16 Flags) +{ + ACPI_EXTERNAL_LIST *NewExternal; + ACPI_EXTERNAL_LIST *NextExternal; + ACPI_EXTERNAL_LIST *PrevExternal = NULL; + + + ACPI_FUNCTION_TRACE (DmCreateNewExternal); + + /* Check all existing externals to ensure no duplicates */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!ACPI_STRCMP (Path, NextExternal->Path)) + if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ @@ -717,12 +794,8 @@ AcpiDmAddToExternalListFromFile ( (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, - "(File) External method arg count mismatch %s: Current %u, override to %u", + "External method arg count mismatch %s: Current %u, attempted %u", NextExternal->Path, NextExternal->Value, Value)); - - /* Override, since new value came from external reference file */ - - NextExternal->Value = Value; } /* Allow upgrade of type from ANY */ @@ -733,44 +806,31 @@ AcpiDmAddToExternalListFromFile ( NextExternal->Value = Value; } - return; + return_ACPI_STATUS (AE_ALREADY_EXISTS); } NextExternal = NextExternal->Next; } - /* Get the internal pathname (AML format) */ - - Status = AcpiNsInternalizeName (Path, &InternalPath); - if (ACPI_FAILURE (Status)) - { - return; - } - /* Allocate and init a new External() descriptor */ NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); if (!NewExternal) { - ACPI_FREE (InternalPath); - return; + return_ACPI_STATUS (AE_NO_MEMORY); } - /* Must copy and normalize the input path */ - - AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Adding external reference node (%s) type [%s]\n", + ExternalPath, AcpiUtGetTypeName (Type))); + NewExternal->Flags = Flags; + NewExternal->Value = Value; NewExternal->Path = ExternalPath; NewExternal->Type = Type; - NewExternal->Value = Value; - NewExternal->Resolved = Resolved; - NewExternal->Length = (UINT16) ACPI_STRLEN (Path); + NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); NewExternal->InternalPath = InternalPath; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 05:51:39 2013 Return-Path: Delivered-To: svn-src-all@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 C09E8F92; Thu, 19 Dec 2013 05:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 934B91D06; Thu, 19 Dec 2013 05:51:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ5pdfv066222; Thu, 19 Dec 2013 05:51:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ5pdM7066220; Thu, 19 Dec 2013 05:51:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201312190551.rBJ5pdM7066220@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 19 Dec 2013 05:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259595 - vendor-sys/acpica/20131218 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 05:51:39 -0000 Author: jkim Date: Thu Dec 19 05:51:39 2013 New Revision: 259595 URL: http://svnweb.freebsd.org/changeset/base/259595 Log: Tag ACPICA 20131218. Added: vendor-sys/acpica/20131218/ - copied from r259594, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 06:08:21 2013 Return-Path: Delivered-To: svn-src-all@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 C2E40476; Thu, 19 Dec 2013 06:08:21 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 834E61E1D; Thu, 19 Dec 2013 06:08:21 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id rBJ68KUJ019462 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 19 Dec 2013 00:08:20 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Thu, 19 Dec 2013 00:08:19 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7A== Date: Thu, 19 Dec 2013 06:08:18 +0000 Message-ID: <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> <52AF78B6.20706@freebsd.org> In-Reply-To: <52AF78B6.20706@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-19_03:2013-12-18,2013-12-19,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 06:08:21 -0000 On Dec 16, 2013, at 2:03 PM, Nathan Whitehorn wrote: > On 12/16/13 15:55, Teske, Devin wrote: >> On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: >>=20 >>> On 12/16/13 15:48, Teske, Devin wrote: >>>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>>>=20 >>>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>>>=20 >>>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>>> Author: dteske >>>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>>> New Revision: 259479 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/259479 >>>>>>>=20 >>>>>>> Log: >>>>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>>>> Discussed on: -current, -stable >>>>>>> MFC after: 3 days >>>>>>>=20 >>>>>>> Modified: >>>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>=20 >>>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >>>>>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 20= 13 (r259478) >>>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 20= 13 (r259479) >>>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE >>>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILU= RE >>>>>>> # We're all done unless we should go on for boot pool >>>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>>> Uh -- what is all of this? Why are we disabling kernel functions dep= ending on what the root filesystem is? Please don't MFC this. >>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org= /pipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILCq= %2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c= 5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.org= /pipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILCq= %2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e= 3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>>>=20 >>>>> NB: Happy to rip it out... but want something in-reply to those threa= ds (pretty please). >>>> Basically... the logic is... >>>>=20 >>>> The ZFS pool is built on vdevs of a specific name. The names that are = used >>>> should remain the same. Adding this to the loader.conf ensures that th= e names >>>> that the pool(s) was/were built upon do not change. >>>>=20 >>>> This goes beyond just a swap partition I imagine. For example... copyi= ng the >>>> data to a new drive using a duplicator. I'm sure there are other cases= too. >>> Thanks for the explanation! I wonder if we should just turn off the dis= k ident stuff by default globally -- it was causing problems for me as well= without ZFS root. >> As I was making the commit to zfsboot... the very thought had occurred t= o me. >>=20 >> I'm happy to rip this out in favor of a new global default. The end-resu= lt is that >> what Johan experienced won't be repeated. >>=20 >> I think there's an urgency to get something to solve this into 10. >=20 > Yeah, I can see that. Let me bring this up on -CURRENT, with a short time= out, and see what the options are. Any updates on this? --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 06:20:20 2013 Return-Path: Delivered-To: svn-src-all@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 37172671; Thu, 19 Dec 2013 06:20:20 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9ED61EB9; Thu, 19 Dec 2013 06:20:19 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBJ6K8R2059052; Thu, 19 Dec 2013 08:20:08 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBJ6K8R2059052 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBJ6K8F9059051; Thu, 19 Dec 2013 08:20:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 19 Dec 2013 08:20:08 +0200 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern Message-ID: <20131219062008.GK59496@kib.kiev.ua> References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> <20131219002824.GA5664@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bk/e7+bhc7oa9AZn" Content-Disposition: inline In-Reply-To: <20131219002824.GA5664@dft-labs.eu> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 06:20:20 -0000 --Bk/e7+bhc7oa9AZn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 19, 2013 at 01:28:24AM +0100, Mateusz Guzik wrote: > That being said, instead of reverting the change (which would leave other= field > with similar issue in place) I propose adding the following: > --- a/sys/kern/kern_exit.c > +++ b/sys/kern/kern_exit.c > @@ -220,6 +220,12 @@ exit1(struct thread *td, int rv) > =20 > p->p_xstat =3D rv; /* Let event handler change exit status= */ > PROC_UNLOCK(p); > + > + /* > + * Some fields below are freed without having the proc locked, ch= eck > + * for P_WEXIT before accessing to make sure it is safe. > + */ > + >=20 > Which should make it clear. >=20 > But again, this is a cosmetic change and I have no strong opinion either > way. If you are still unconvinced I'm happy to revert it later. I think adding a comment is fine, but besides the comment you propose for describing what does the code do in the exit path, it is more important to put the same comment into the struct proc description. In other words, fields should be annotated to indicate which accesses require gating on exiting state. I think something similar should be done for the execing state. The kern_proc.c sysctls are already full of this knowledge, and since you are making it explicit in one case, doing the full pass makes sense. --Bk/e7+bhc7oa9AZn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSspAXAAoJEJDCuSvBvK1BqegQAKXPuyActrnrqIkjsZeswJmx 8l3IifWy8jdi37fAoPHba43TsysQk0AMIAgeUyERmM4nMOYBNUd2GlOkXLP7ixF2 2JXFNbJpPq672WrF+RvfyHUx+JtcDAQ3e76gElDrJnXBOvw7hR+oHSqJcLBQP14V 7DkCjYRV70XQxYgCeqyLdv1H5oMke6skfcrgMATarmmqt0XCgnKzAVbgnLK8QbJe 8dY4HvlofvVZRaCg6JiiurbFxT8Treg5vgNpdRS0sBP0YwF55TpQKvynnHARRhsW 8GsFCDI8sz7INXLNnb3xSq3gcu9VUBnk9l8UlWa8PKxga/CqrQupdLPuN7whRRUE sET38I/1znKhWixuFdk/Cc1Jhc36gJGUXGfy7tfexisZ+7+PTQ7ceyTIXf9nSfUj 7kMV5RHU4oIH0nbmQjI3nyTQajYv2qmyRriWaHGoyuid/3UO1uj5B2WrHn3FBdRa HJ7okbFLDznEhwxU2So7AKZYBCPCrGRoekZj/2TiPa9OMBC4y01akSYXOrSFs7gQ tGF3V498D0rhZO+n9PFMx4YOmH2zMjivmqOB2IdLQOXA6Q8CWp4nzCpObSp3pn3A nqLy71lasdyWTxmIRyylPtsTUEHmaMhVhvKTjUgcTE5Te1SP1bsBkRJdCSHX+Rzc 4Q6iWJSMOA+7znVC+lEL =pjGQ -----END PGP SIGNATURE----- --Bk/e7+bhc7oa9AZn-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 06:39:48 2013 Return-Path: Delivered-To: svn-src-all@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 B2D69909; Thu, 19 Dec 2013 06:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8599D1FDF; Thu, 19 Dec 2013 06:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ6dmur081527; Thu, 19 Dec 2013 06:39:48 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ6dmKv081526; Thu, 19 Dec 2013 06:39:48 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190639.rBJ6dmKv081526@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 06:39: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: r259596 - stable/10/etc/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 06:39:48 -0000 Author: truckman Date: Thu Dec 19 06:39:48 2013 New Revision: 259596 URL: http://svnweb.freebsd.org/changeset/base/259596 Log: Regenerate after r255238, r257044, r259453 (if_run) r255128 (ng_ubt) r259592 (u3g) Modified: stable/10/etc/devd/usb.conf Modified: stable/10/etc/devd/usb.conf ============================================================================== --- stable/10/etc/devd/usb.conf Thu Dec 19 05:51:39 2013 (r259595) +++ stable/10/etc/devd/usb.conf Thu Dec 19 06:39:48 2013 (r259596) @@ -833,7 +833,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; - match "product" "0x935a"; + match "product" "(0x935a|0x935b)"; action "kldload -n if_run"; }; @@ -2289,7 +2289,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; - match "product" "0x17b5"; + match "product" "(0x17b5|0x17cb)"; action "kldload -n ng_ubt"; }; @@ -3665,7 +3665,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1410"; - match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5041|0x5100|0x6000|0x6002|0x7042)"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)"; action "kldload -n u3g"; }; @@ -3777,7 +3777,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x148f"; - match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x5370|0x5572|0x8070)"; action "kldload -n if_run"; }; @@ -4561,7 +4561,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b)"; action "kldload -n if_run"; }; @@ -5260,5 +5260,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2537 USB entries processed +# 2545 USB entries processed From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 06:41:31 2013 Return-Path: Delivered-To: svn-src-all@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 60351A3E; Thu, 19 Dec 2013 06:41:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3354C1031; Thu, 19 Dec 2013 06:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ6fVJE084190; Thu, 19 Dec 2013 06:41:31 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ6fVC4084189; Thu, 19 Dec 2013 06:41:31 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312190641.rBJ6fVC4084189@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Dec 2013 06:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259597 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 06:41:31 -0000 Author: dteske Date: Thu Dec 19 06:41:30 2013 New Revision: 259597 URL: http://svnweb.freebsd.org/changeset/base/259597 Log: Fix a regression that occurred with SVN revisions 259474 and 259476 where installation to 3-4+ (depending on vdev type) vdevs would result in odd error messages where the zpool `create' command appeared to repeat itself (an artifact of printf when you supply too many arguments -- caused by neglecting to properly quote the multi-word expansion of $*vdevs when creating the pool(s)). Example error below (taken from bsdinstall_log): DEBUG: zfs_create_boot: Creating root pool... DEBUG: zfs_create_boot: zpool create -o altroot=/mnt -m none -f "zroot" \ ada0p3.nop ada1p3.nopzpool create ada2p3.nop "ada3p3.nop" DEBUG: zfs_create_boot: retval=1 cannot open 'ada1p3.nopzpool': no such GEOM provider Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:39:48 2013 (r259596) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:41:30 2013 (r259597) @@ -979,7 +979,8 @@ zfs_create_boot() bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "$bootpool_options" "$bootpool_name" \ - $bootpool_vdevtype $boot_vdevs || return $FAILURE + "$bootpool_vdevtype" "$boot_vdevs" || + return $FAILURE f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE @@ -1048,7 +1049,8 @@ zfs_create_boot() f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ - "$zroot_name" $zroot_vdevtype $zroot_vdevs + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE # Customize the zroot a bit... local option From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 06:43:53 2013 Return-Path: Delivered-To: svn-src-all@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 2E547B9C; Thu, 19 Dec 2013 06:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3741044; Thu, 19 Dec 2013 06:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ6hqJa084466; Thu, 19 Dec 2013 06:43:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ6hqWH084465; Thu, 19 Dec 2013 06:43:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312190643.rBJ6hqWH084465@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Dec 2013 06:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259598 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 06:43:53 -0000 Author: dteske Date: Thu Dec 19 06:43:52 2013 New Revision: 259598 URL: http://svnweb.freebsd.org/changeset/base/259598 Log: When using a bootpool, set the cachefile property so that it gets imported automatically upon reboot to the newly installed system. MFC after: 1 day Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:41:30 2013 (r259597) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 06:43:52 2013 (r259598) @@ -1152,7 +1152,7 @@ zfs_create_boot() fi # While this is apparently not needed, it seems to help MBR - f_dprintf "$funcname: Configuring zpool.cache..." + f_dprintf "$funcname: Configuring zpool.cache for zroot..." f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ @@ -1174,6 +1174,12 @@ zfs_create_boot() # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS + # Set cachefile for boot pool so it auto-imports at system start + f_dprintf "$funcname: Configuring zpool.cache for boot pool..." + f_eval_catch $funcname zpool "$ZPOOL_SET" \ + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$bootpool_name" || return $FAILURE + # Some additional geli(8) requirements for loader.conf(5) for option in \ 'zpool_cache_load=\"YES\"' \ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:02:12 2013 Return-Path: Delivered-To: svn-src-all@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 549E8E76; Thu, 19 Dec 2013 07:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 260401156; Thu, 19 Dec 2013 07:02:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ72CPn091471; Thu, 19 Dec 2013 07:02:12 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ72BWj091470; Thu, 19 Dec 2013 07:02:12 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190702.rBJ72BWj091470@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 07:02:11 +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: r259599 - stable/9/etc/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:02:12 -0000 Author: truckman Date: Thu Dec 19 07:02:11 2013 New Revision: 259599 URL: http://svnweb.freebsd.org/changeset/base/259599 Log: Regenerate after r248085 (if_ipheth) r247474, r250288 (uftdi) r250842 (if_rum) r244956, r255345 (ng_ubt) r248085, r250847, r257042, r259457 (if_run) r245727, r250845, r253292, r259593 (u3g) r252444 (if_axe) Modified: stable/9/etc/devd/usb.conf Modified: stable/9/etc/devd/usb.conf ============================================================================== --- stable/9/etc/devd/usb.conf Thu Dec 19 06:43:52 2013 (r259598) +++ stable/9/etc/devd/usb.conf Thu Dec 19 07:02:11 2013 (r259599) @@ -53,6 +53,17 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; + match "product" "0x12a0"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload -n if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; match "product" "0x12a8"; match "intclass" "0xff"; match "intsubclass" "0xfd"; @@ -168,7 +179,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeee b|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeee a|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -280,7 +291,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0116|0x0119)"; + match "product" "(0x00f4|0x0116|0x0119)"; action "kldload -n if_rum"; }; @@ -335,6 +346,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x044e"; + match "product" "(0x3001|0x3002)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0456"; match "product" "(0xf000|0xf001)"; action "kldload -n uftdi"; @@ -423,6 +442,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0489"; + match "product" "0xe042"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0499"; match "product" "(0x1000|0x1001|0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012|0x1013|0x1014|0x1015|0x1016|0x1017|0x1018|0x1019|0x101a|0x101b|0x101c|0x101d|0x101e|0x101f|0x1020|0x1021|0x1022|0x1023|0x1024|0x1025|0x1026|0x1027|0x1028|0x1029|0x102a|0x102b|0x102e|0x1030|0x1031|0x1032|0x1033|0x1034|0x1035|0x1036|0x1037|0x1038|0x1039|0x103a|0x103b|0x103c|0x103d|0x103e|0x103f|0x1040|0x1041|0x1042|0x1043|0x1044|0x1045|0x104e|0x104f|0x1050|0x1051|0x1052|0x1053|0x1054|0x1055|0x1056|0x1057|0x1058|0x1059|0x105a|0x105b|0x105c|0x105d|0x1503|0x2000|0x2001|0x2002|0x2003|0x5000|0x5001|0x5002|0x5003|0x5004|0x5005|0x5006|0x5007|0x5008|0x5009|0x500a|0x500b|0x500c|0x500d|0x500e|0x500f|0x7000|0x7010)"; action "kldload -n snd_uaudio"; @@ -551,6 +578,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x04bf"; + match "product" "0x030a"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x04c5"; match "product" "(0x1058|0x1079)"; action "kldload -n uipaq"; @@ -559,6 +594,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x04ca"; + match "product" "0x2003"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x04da"; match "product" "0x2500"; action "kldload -n uipaq"; @@ -792,7 +835,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; - match "product" "0x935a"; + match "product" "(0x935a|0x935b)"; action "kldload -n if_run"; }; @@ -1039,6 +1082,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x8213|0x8215|0x8218|0x821a|0x821b|0x821f|0x8281|0x828f)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x05ad"; match "product" "0x0fba"; action "kldload -n uplcom"; @@ -1103,6 +1154,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x065a"; + match "product" "(0xc000|0xc001)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x066b"; match "product" "(0x200c|0x2202)"; action "kldload -n if_aue"; @@ -1344,7 +1403,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0789"; - match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168)"; + match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168|0x0169)"; action "kldload -n if_run"; }; @@ -1919,6 +1978,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0a5c"; + match "product" "0x21e1"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0acd"; match "product" "0x0300"; action "kldload -n uftdi"; @@ -2088,6 +2155,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; + match "product" "(0x17b5|0x17cb)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; match "product" "(0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; action "kldload -n uipaq"; }; @@ -2207,6 +2282,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0bdb"; + match "product" "0x1002"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0bed"; match "product" "(0x1100|0x1101)"; action "kldload -n uslcom"; @@ -2231,6 +2314,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c10"; + match "product" "0x0000"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c26"; match "product" "(0x0004|0x0009|0x000a|0x000b|0x000c|0x000d|0x0010|0x0011|0x0012|0x0013|0x0018)"; action "kldload -n uftdi"; @@ -2583,6 +2674,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0e8d"; + match "product" "0x763f"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0ea0"; match "product" "0x6858"; action "kldload -n uplcom"; @@ -2735,6 +2834,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1004"; + match "product" "0x618f"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x100d"; match "product" "(0x9031|0x9032)"; action "kldload -n if_run"; @@ -3232,7 +3339,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1410"; - match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5100|0x6000|0x6002|0x7042)"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)"; action "kldload -n u3g"; }; @@ -3344,7 +3451,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x148f"; - match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x5370|0x5572|0x8070)"; action "kldload -n if_run"; }; @@ -3799,6 +3906,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7203"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -4080,7 +4195,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a)"; action "kldload -n if_run"; }; @@ -4096,7 +4211,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)"; + match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102)"; + action "kldload -n if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x7e12|0xa805)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0xabc1"; action "kldload -n if_aue"; }; @@ -4215,8 +4346,8 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x22de"; - match "product" "0x6801"; + match "vendor" "0x22b8"; + match "product" "0x710f"; action "kldload -n u3g"; }; @@ -4296,6 +4427,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x413c"; + match "product" "0x8197"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; match "product" "0x9500"; action "kldload -n uslcom"; }; @@ -4495,6 +4634,36 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0489"; + match "intclass" "0xff"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "intclass" "0xff"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a5c"; + match "intclass" "0xff"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x01"; @@ -4635,5 +4804,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2386 USB entries processed +# 2426 USB entries processed From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:09:29 2013 Return-Path: Delivered-To: svn-src-all@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 E86F32A4; Thu, 19 Dec 2013 07:09:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2D3111A5; Thu, 19 Dec 2013 07:09:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ79T6q092656; Thu, 19 Dec 2013 07:09:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ79Tu3092652; Thu, 19 Dec 2013 07:09:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190709.rBJ79Tu3092652@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:09:29 +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: r259600 - in stable/8/sys/dev/usb: . controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:09:30 -0000 Author: hselasky Date: Thu Dec 19 07:09:28 2013 New Revision: 259600 URL: http://svnweb.freebsd.org/changeset/base/259600 Log: MFC r259023 and r259095: Improve the XHCI command timeout recovery handling code. Fix some typos while at it. Modified: stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/usb_bus.h stable/8/sys/dev/usb/usb_controller.h 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/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:02:11 2013 (r259599) +++ stable/8/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:09:28 2013 (r259600) @@ -278,6 +278,28 @@ usb_resume(device_t dev) } /*------------------------------------------------------------------------* + * usb_bus_reset_async_locked + *------------------------------------------------------------------------*/ +void +usb_bus_reset_async_locked(struct usb_bus *bus) +{ + USB_BUS_LOCK_ASSERT(bus, MA_OWNED); + + DPRINTF("\n"); + + if (bus->reset_msg[0].hdr.pm_qentry.tqe_prev != NULL || + bus->reset_msg[1].hdr.pm_qentry.tqe_prev != NULL) { + DPRINTF("Reset already pending\n"); + return; + } + + device_printf(bus->parent, "Resetting controller\n"); + + usb_proc_msignal(&bus->explore_proc, + &bus->reset_msg[0], &bus->reset_msg[1]); +} + +/*------------------------------------------------------------------------* * usb_shutdown *------------------------------------------------------------------------*/ static int @@ -399,7 +421,7 @@ usb_bus_detach(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_suspend * - * This function is used to suspend the USB contoller. + * This function is used to suspend the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_suspend(struct usb_proc_msg *pm) @@ -409,6 +431,8 @@ usb_bus_suspend(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -454,7 +478,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_resume * - * This function is used to resume the USB contoller. + * This function is used to resume the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_resume(struct usb_proc_msg *pm) @@ -464,6 +488,8 @@ usb_bus_resume(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -513,9 +539,31 @@ usb_bus_resume(struct usb_proc_msg *pm) } /*------------------------------------------------------------------------* + * usb_bus_reset + * + * This function is used to reset the USB controller. + *------------------------------------------------------------------------*/ +static void +usb_bus_reset(struct usb_proc_msg *pm) +{ + struct usb_bus *bus; + + DPRINTF("\n"); + + bus = ((struct usb_bus_msg *)pm)->bus; + + if (bus->bdev == NULL || bus->no_explore != 0) + return; + + /* a suspend and resume will reset the USB controller */ + usb_bus_suspend(pm); + usb_bus_resume(pm); +} + +/*------------------------------------------------------------------------* * usb_bus_shutdown * - * This function is used to shutdown the USB contoller. + * This function is used to shutdown the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_shutdown(struct usb_proc_msg *pm) @@ -728,6 +776,11 @@ usb_attach_sub(device_t dev, struct usb_ bus->resume_msg[1].hdr.pm_callback = &usb_bus_resume; bus->resume_msg[1].bus = bus; + bus->reset_msg[0].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[0].bus = bus; + bus->reset_msg[1].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[1].bus = bus; + bus->shutdown_msg[0].hdr.pm_callback = &usb_bus_shutdown; bus->shutdown_msg[0].bus = bus; bus->shutdown_msg[1].hdr.pm_callback = &usb_bus_shutdown; Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Thu Dec 19 07:02:11 2013 (r259599) +++ stable/8/sys/dev/usb/controller/xhci.c Thu Dec 19 07:09:28 2013 (r259600) @@ -253,6 +253,69 @@ xhci_ctx_get_le64(struct xhci_softc *sc, } #endif +static int +xhci_reset_command_queue_locked(struct xhci_softc *sc) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + uint64_t addr; + uint32_t temp; + + DPRINTF("\n"); + + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Command ring running\n"); + temp &= ~(XHCI_CRCR_LO_CS | XHCI_CRCR_LO_CA); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + + /* stop and cancel */ + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CS); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + /* wait 250ms */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 4); + + /* check if command ring is still running */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Comand ring still running\n"); + return (USB_ERR_IOERROR); + } + } + + /* reset command ring */ + sc->sc_command_ccs = 1; + sc->sc_command_idx = 0; + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + /* setup command ring control base address */ + addr = buf_res.physaddr; + phwr = buf_res.buffer; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[0]; + + DPRINTF("CRCR=0x%016llx\n", (unsigned long long)addr); + + memset(phwr->hwr_commands, 0, sizeof(phwr->hwr_commands)); + phwr->hwr_commands[XHCI_MAX_COMMANDS - 1].qwTrb0 = htole64(addr); + + usb_pc_cpu_flush(&sc->sc_hw.root_pc); + + XWRITE4(sc, oper, XHCI_CRCR_LO, ((uint32_t)addr) | XHCI_CRCR_LO_RCS); + XWRITE4(sc, oper, XHCI_CRCR_HI, (uint32_t)(addr >> 32)); + + return (0); +} + usb_error_t xhci_start_controller(struct xhci_softc *sc) { @@ -1025,6 +1088,7 @@ xhci_do_command(struct xhci_softc *sc, s uint32_t temp; uint8_t i; uint8_t j; + uint8_t timeout = 0; int err; XHCI_CMD_ASSERT_LOCKED(sc); @@ -1038,7 +1102,7 @@ xhci_do_command(struct xhci_softc *sc, s /* Queue command */ USB_BUS_LOCK(&sc->sc_bus); - +retry: i = sc->sc_command_idx; j = sc->sc_command_ccs; @@ -1109,25 +1173,22 @@ xhci_do_command(struct xhci_softc *sc, s err = 0; } if (err != 0) { - DPRINTFN(0, "Command timeout!\n"); - + DPRINTF("Command timeout!\n"); /* - * Try to abort the last command as per section - * 4.6.1.2 "Aborting a Command" of the XHCI - * specification: + * After some weeks of continuous operation, it has + * been observed that the ASMedia Technology, ASM1042 + * SuperSpeed USB Host Controller can suddenly stop + * accepting commands via the command queue. Try to + * first reset the command queue. If that fails do a + * host controller reset. */ - temp = XREAD4(sc, oper, XHCI_CRCR_LO); - XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); - - /* wait for abort event, if any */ - err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); - - if (err != 0 && xhci_interrupt_poll(sc) != 0) { - DPRINTF("Command was completed when polling\n"); - err = 0; - } - if (err != 0) { - DPRINTF("Command abort timeout!\n"); + if (timeout == 0 && + xhci_reset_command_queue_locked(sc) == 0) { + timeout = 1; + goto retry; + } else { + DPRINTF("Controller reset!\n"); + usb_bus_reset_async_locked(&sc->sc_bus); } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; Modified: stable/8/sys/dev/usb/usb_bus.h ============================================================================== --- stable/8/sys/dev/usb/usb_bus.h Thu Dec 19 07:02:11 2013 (r259599) +++ stable/8/sys/dev/usb/usb_bus.h Thu Dec 19 07:09:28 2013 (r259600) @@ -71,6 +71,7 @@ struct usb_bus { struct usb_bus_msg attach_msg[2]; struct usb_bus_msg suspend_msg[2]; struct usb_bus_msg resume_msg[2]; + struct usb_bus_msg reset_msg[2]; struct usb_bus_msg shutdown_msg[2]; /* * This mutex protects the USB hardware: Modified: stable/8/sys/dev/usb/usb_controller.h ============================================================================== --- stable/8/sys/dev/usb/usb_controller.h Thu Dec 19 07:02:11 2013 (r259599) +++ stable/8/sys/dev/usb/usb_controller.h Thu Dec 19 07:09:28 2013 (r259600) @@ -186,6 +186,7 @@ void usb_bus_mem_flush_all(struct usb_bu uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb); void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr); +void usb_bus_reset_async_locked(struct usb_bus *bus); #if USB_HAVE_TT_SUPPORT uint8_t usbd_fs_isoc_schedule_alloc_slot(struct usb_xfer *isoc_xfer, uint16_t isoc_time); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:12:35 2013 Return-Path: Delivered-To: svn-src-all@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 8742741F; Thu, 19 Dec 2013 07:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72C041212; Thu, 19 Dec 2013 07:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7CZ1g095560; Thu, 19 Dec 2013 07:12:35 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7CZRe095559; Thu, 19 Dec 2013 07:12:35 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190712.rBJ7CZRe095559@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 07:12: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: r259601 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:12:35 -0000 Author: truckman Date: Thu Dec 19 07:12:34 2013 New Revision: 259601 URL: http://svnweb.freebsd.org/changeset/base/259601 Log: MFC r258629, 258662: r258629: Mention that devd will kldload the driver when the device is connected. Mention that the automatic mode switch from umass to u3g needed by some devices does not work unless the driver is loaded before the device is connected. r258662 (by joel): mdoc: sort sections. Modified: stable/10/share/man/man4/u3g.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/u3g.4 ============================================================================== --- stable/10/share/man/man4/u3g.4 Thu Dec 19 07:09:28 2013 (r259600) +++ stable/10/share/man/man4/u3g.4 Thu Dec 19 07:12:34 2013 (r259601) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd November 26, 2013 .Dt U3G 4 .Os .Sh NAME @@ -40,6 +40,9 @@ module at boot time, place the following .Bd -literal -offset indent u3g_load="YES" .Ed +.Pp +If neither of the above is done, the driver will automatically be loaded +by devd(8) when the device is connected. .Sh DESCRIPTION The .Nm @@ -98,6 +101,7 @@ and .Xr ucom 4 , .Xr usb 4 , .Xr usb_quirk 4 , +.Xr devd 8 , .Xr usbconfig 8 .Sh HISTORY The @@ -117,3 +121,7 @@ driver was written by and .An Nick Hibma Aq n_hibma@FreeBSD.org . Hardware for testing was provided by AnyWi Technologies, Leiden, NL. +.Sh BUGS +The automatic mode switch from disk mode to modem mode does not work unless +the driver is either built into the kernel or loaded before the device is +connected. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:12:41 2013 Return-Path: Delivered-To: svn-src-all@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 CA87C4F9; Thu, 19 Dec 2013 07:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5E021215; Thu, 19 Dec 2013 07:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7Cf1K095613; Thu, 19 Dec 2013 07:12:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7Ce2R095609; Thu, 19 Dec 2013 07:12:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190712.rBJ7Ce2R095609@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:12:40 +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: r259602 - in stable/9/sys/dev/usb: . controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:12:41 -0000 Author: hselasky Date: Thu Dec 19 07:12:40 2013 New Revision: 259602 URL: http://svnweb.freebsd.org/changeset/base/259602 Log: MFC r259023 and r259095: Improve the XHCI command timeout recovery handling code. Fix some typos while at it. Modified: stable/9/sys/dev/usb/controller/usb_controller.c stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/usb_bus.h stable/9/sys/dev/usb/usb_controller.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:12:34 2013 (r259601) +++ stable/9/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:12:40 2013 (r259602) @@ -278,6 +278,28 @@ usb_resume(device_t dev) } /*------------------------------------------------------------------------* + * usb_bus_reset_async_locked + *------------------------------------------------------------------------*/ +void +usb_bus_reset_async_locked(struct usb_bus *bus) +{ + USB_BUS_LOCK_ASSERT(bus, MA_OWNED); + + DPRINTF("\n"); + + if (bus->reset_msg[0].hdr.pm_qentry.tqe_prev != NULL || + bus->reset_msg[1].hdr.pm_qentry.tqe_prev != NULL) { + DPRINTF("Reset already pending\n"); + return; + } + + device_printf(bus->parent, "Resetting controller\n"); + + usb_proc_msignal(&bus->explore_proc, + &bus->reset_msg[0], &bus->reset_msg[1]); +} + +/*------------------------------------------------------------------------* * usb_shutdown *------------------------------------------------------------------------*/ static int @@ -399,7 +421,7 @@ usb_bus_detach(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_suspend * - * This function is used to suspend the USB contoller. + * This function is used to suspend the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_suspend(struct usb_proc_msg *pm) @@ -409,6 +431,8 @@ usb_bus_suspend(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -454,7 +478,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_resume * - * This function is used to resume the USB contoller. + * This function is used to resume the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_resume(struct usb_proc_msg *pm) @@ -464,6 +488,8 @@ usb_bus_resume(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -513,9 +539,31 @@ usb_bus_resume(struct usb_proc_msg *pm) } /*------------------------------------------------------------------------* + * usb_bus_reset + * + * This function is used to reset the USB controller. + *------------------------------------------------------------------------*/ +static void +usb_bus_reset(struct usb_proc_msg *pm) +{ + struct usb_bus *bus; + + DPRINTF("\n"); + + bus = ((struct usb_bus_msg *)pm)->bus; + + if (bus->bdev == NULL || bus->no_explore != 0) + return; + + /* a suspend and resume will reset the USB controller */ + usb_bus_suspend(pm); + usb_bus_resume(pm); +} + +/*------------------------------------------------------------------------* * usb_bus_shutdown * - * This function is used to shutdown the USB contoller. + * This function is used to shutdown the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_shutdown(struct usb_proc_msg *pm) @@ -728,6 +776,11 @@ usb_attach_sub(device_t dev, struct usb_ bus->resume_msg[1].hdr.pm_callback = &usb_bus_resume; bus->resume_msg[1].bus = bus; + bus->reset_msg[0].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[0].bus = bus; + bus->reset_msg[1].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[1].bus = bus; + bus->shutdown_msg[0].hdr.pm_callback = &usb_bus_shutdown; bus->shutdown_msg[0].bus = bus; bus->shutdown_msg[1].hdr.pm_callback = &usb_bus_shutdown; Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Dec 19 07:12:34 2013 (r259601) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Dec 19 07:12:40 2013 (r259602) @@ -253,6 +253,69 @@ xhci_ctx_get_le64(struct xhci_softc *sc, } #endif +static int +xhci_reset_command_queue_locked(struct xhci_softc *sc) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + uint64_t addr; + uint32_t temp; + + DPRINTF("\n"); + + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Command ring running\n"); + temp &= ~(XHCI_CRCR_LO_CS | XHCI_CRCR_LO_CA); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + + /* stop and cancel */ + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CS); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + /* wait 250ms */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 4); + + /* check if command ring is still running */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Comand ring still running\n"); + return (USB_ERR_IOERROR); + } + } + + /* reset command ring */ + sc->sc_command_ccs = 1; + sc->sc_command_idx = 0; + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + /* setup command ring control base address */ + addr = buf_res.physaddr; + phwr = buf_res.buffer; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[0]; + + DPRINTF("CRCR=0x%016llx\n", (unsigned long long)addr); + + memset(phwr->hwr_commands, 0, sizeof(phwr->hwr_commands)); + phwr->hwr_commands[XHCI_MAX_COMMANDS - 1].qwTrb0 = htole64(addr); + + usb_pc_cpu_flush(&sc->sc_hw.root_pc); + + XWRITE4(sc, oper, XHCI_CRCR_LO, ((uint32_t)addr) | XHCI_CRCR_LO_RCS); + XWRITE4(sc, oper, XHCI_CRCR_HI, (uint32_t)(addr >> 32)); + + return (0); +} + usb_error_t xhci_start_controller(struct xhci_softc *sc) { @@ -1025,6 +1088,7 @@ xhci_do_command(struct xhci_softc *sc, s uint32_t temp; uint8_t i; uint8_t j; + uint8_t timeout = 0; int err; XHCI_CMD_ASSERT_LOCKED(sc); @@ -1038,7 +1102,7 @@ xhci_do_command(struct xhci_softc *sc, s /* Queue command */ USB_BUS_LOCK(&sc->sc_bus); - +retry: i = sc->sc_command_idx; j = sc->sc_command_ccs; @@ -1109,25 +1173,22 @@ xhci_do_command(struct xhci_softc *sc, s err = 0; } if (err != 0) { - DPRINTFN(0, "Command timeout!\n"); - + DPRINTF("Command timeout!\n"); /* - * Try to abort the last command as per section - * 4.6.1.2 "Aborting a Command" of the XHCI - * specification: + * After some weeks of continuous operation, it has + * been observed that the ASMedia Technology, ASM1042 + * SuperSpeed USB Host Controller can suddenly stop + * accepting commands via the command queue. Try to + * first reset the command queue. If that fails do a + * host controller reset. */ - temp = XREAD4(sc, oper, XHCI_CRCR_LO); - XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); - - /* wait for abort event, if any */ - err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); - - if (err != 0 && xhci_interrupt_poll(sc) != 0) { - DPRINTF("Command was completed when polling\n"); - err = 0; - } - if (err != 0) { - DPRINTF("Command abort timeout!\n"); + if (timeout == 0 && + xhci_reset_command_queue_locked(sc) == 0) { + timeout = 1; + goto retry; + } else { + DPRINTF("Controller reset!\n"); + usb_bus_reset_async_locked(&sc->sc_bus); } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; Modified: stable/9/sys/dev/usb/usb_bus.h ============================================================================== --- stable/9/sys/dev/usb/usb_bus.h Thu Dec 19 07:12:34 2013 (r259601) +++ stable/9/sys/dev/usb/usb_bus.h Thu Dec 19 07:12:40 2013 (r259602) @@ -71,6 +71,7 @@ struct usb_bus { struct usb_bus_msg attach_msg[2]; struct usb_bus_msg suspend_msg[2]; struct usb_bus_msg resume_msg[2]; + struct usb_bus_msg reset_msg[2]; struct usb_bus_msg shutdown_msg[2]; /* * This mutex protects the USB hardware: Modified: stable/9/sys/dev/usb/usb_controller.h ============================================================================== --- stable/9/sys/dev/usb/usb_controller.h Thu Dec 19 07:12:34 2013 (r259601) +++ stable/9/sys/dev/usb/usb_controller.h Thu Dec 19 07:12:40 2013 (r259602) @@ -186,6 +186,7 @@ void usb_bus_mem_flush_all(struct usb_bu uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb); void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr); +void usb_bus_reset_async_locked(struct usb_bus *bus); #if USB_HAVE_TT_SUPPORT uint8_t usbd_fs_isoc_schedule_alloc_slot(struct usb_xfer *isoc_xfer, uint16_t isoc_time); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:14:00 2013 Return-Path: Delivered-To: svn-src-all@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 C245F6A9; Thu, 19 Dec 2013 07:14:00 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC9F61222; Thu, 19 Dec 2013 07:14:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7E01b095815; Thu, 19 Dec 2013 07:14:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7DxDm095803; Thu, 19 Dec 2013 07:13:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190713.rBJ7DxDm095803@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259603 - in stable/10/sys/dev/usb: . controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:14:00 -0000 Author: hselasky Date: Thu Dec 19 07:13:59 2013 New Revision: 259603 URL: http://svnweb.freebsd.org/changeset/base/259603 Log: MFC r259023 and r259095: Improve the XHCI command timeout recovery handling code. Fix some typos while at it. Modified: stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/controller/xhci.c stable/10/sys/dev/usb/usb_bus.h stable/10/sys/dev/usb/usb_controller.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/10/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:12:40 2013 (r259602) +++ stable/10/sys/dev/usb/controller/usb_controller.c Thu Dec 19 07:13:59 2013 (r259603) @@ -296,6 +296,28 @@ usb_resume(device_t dev) } /*------------------------------------------------------------------------* + * usb_bus_reset_async_locked + *------------------------------------------------------------------------*/ +void +usb_bus_reset_async_locked(struct usb_bus *bus) +{ + USB_BUS_LOCK_ASSERT(bus, MA_OWNED); + + DPRINTF("\n"); + + if (bus->reset_msg[0].hdr.pm_qentry.tqe_prev != NULL || + bus->reset_msg[1].hdr.pm_qentry.tqe_prev != NULL) { + DPRINTF("Reset already pending\n"); + return; + } + + device_printf(bus->parent, "Resetting controller\n"); + + usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), + &bus->reset_msg[0], &bus->reset_msg[1]); +} + +/*------------------------------------------------------------------------* * usb_shutdown *------------------------------------------------------------------------*/ static int @@ -419,7 +441,7 @@ usb_bus_detach(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_suspend * - * This function is used to suspend the USB contoller. + * This function is used to suspend the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_suspend(struct usb_proc_msg *pm) @@ -429,6 +451,8 @@ usb_bus_suspend(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -474,7 +498,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_resume * - * This function is used to resume the USB contoller. + * This function is used to resume the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_resume(struct usb_proc_msg *pm) @@ -484,6 +508,8 @@ usb_bus_resume(struct usb_proc_msg *pm) usb_error_t err; uint8_t do_unlock; + DPRINTF("\n"); + bus = ((struct usb_bus_msg *)pm)->bus; udev = bus->devices[USB_ROOT_HUB_ADDR]; @@ -533,9 +559,31 @@ usb_bus_resume(struct usb_proc_msg *pm) } /*------------------------------------------------------------------------* + * usb_bus_reset + * + * This function is used to reset the USB controller. + *------------------------------------------------------------------------*/ +static void +usb_bus_reset(struct usb_proc_msg *pm) +{ + struct usb_bus *bus; + + DPRINTF("\n"); + + bus = ((struct usb_bus_msg *)pm)->bus; + + if (bus->bdev == NULL || bus->no_explore != 0) + return; + + /* a suspend and resume will reset the USB controller */ + usb_bus_suspend(pm); + usb_bus_resume(pm); +} + +/*------------------------------------------------------------------------* * usb_bus_shutdown * - * This function is used to shutdown the USB contoller. + * This function is used to shutdown the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_shutdown(struct usb_proc_msg *pm) @@ -750,6 +798,11 @@ usb_attach_sub(device_t dev, struct usb_ bus->resume_msg[1].hdr.pm_callback = &usb_bus_resume; bus->resume_msg[1].bus = bus; + bus->reset_msg[0].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[0].bus = bus; + bus->reset_msg[1].hdr.pm_callback = &usb_bus_reset; + bus->reset_msg[1].bus = bus; + bus->shutdown_msg[0].hdr.pm_callback = &usb_bus_shutdown; bus->shutdown_msg[0].bus = bus; bus->shutdown_msg[1].hdr.pm_callback = &usb_bus_shutdown; Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Thu Dec 19 07:12:40 2013 (r259602) +++ stable/10/sys/dev/usb/controller/xhci.c Thu Dec 19 07:13:59 2013 (r259603) @@ -278,6 +278,69 @@ xhci_ctx_get_le64(struct xhci_softc *sc, } #endif +static int +xhci_reset_command_queue_locked(struct xhci_softc *sc) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + uint64_t addr; + uint32_t temp; + + DPRINTF("\n"); + + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Command ring running\n"); + temp &= ~(XHCI_CRCR_LO_CS | XHCI_CRCR_LO_CA); + + /* + * Try to abort the last command as per section + * 4.6.1.2 "Aborting a Command" of the XHCI + * specification: + */ + + /* stop and cancel */ + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CS); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); + XWRITE4(sc, oper, XHCI_CRCR_HI, 0); + + /* wait 250ms */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 4); + + /* check if command ring is still running */ + temp = XREAD4(sc, oper, XHCI_CRCR_LO); + if (temp & XHCI_CRCR_LO_CRR) { + DPRINTF("Comand ring still running\n"); + return (USB_ERR_IOERROR); + } + } + + /* reset command ring */ + sc->sc_command_ccs = 1; + sc->sc_command_idx = 0; + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + /* setup command ring control base address */ + addr = buf_res.physaddr; + phwr = buf_res.buffer; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[0]; + + DPRINTF("CRCR=0x%016llx\n", (unsigned long long)addr); + + memset(phwr->hwr_commands, 0, sizeof(phwr->hwr_commands)); + phwr->hwr_commands[XHCI_MAX_COMMANDS - 1].qwTrb0 = htole64(addr); + + usb_pc_cpu_flush(&sc->sc_hw.root_pc); + + XWRITE4(sc, oper, XHCI_CRCR_LO, ((uint32_t)addr) | XHCI_CRCR_LO_RCS); + XWRITE4(sc, oper, XHCI_CRCR_HI, (uint32_t)(addr >> 32)); + + return (0); +} + usb_error_t xhci_start_controller(struct xhci_softc *sc) { @@ -1059,6 +1122,7 @@ xhci_do_command(struct xhci_softc *sc, s uint32_t temp; uint8_t i; uint8_t j; + uint8_t timeout = 0; int err; XHCI_CMD_ASSERT_LOCKED(sc); @@ -1072,7 +1136,7 @@ xhci_do_command(struct xhci_softc *sc, s /* Queue command */ USB_BUS_LOCK(&sc->sc_bus); - +retry: i = sc->sc_command_idx; j = sc->sc_command_ccs; @@ -1143,25 +1207,22 @@ xhci_do_command(struct xhci_softc *sc, s err = 0; } if (err != 0) { - DPRINTFN(0, "Command timeout!\n"); - + DPRINTF("Command timeout!\n"); /* - * Try to abort the last command as per section - * 4.6.1.2 "Aborting a Command" of the XHCI - * specification: + * After some weeks of continuous operation, it has + * been observed that the ASMedia Technology, ASM1042 + * SuperSpeed USB Host Controller can suddenly stop + * accepting commands via the command queue. Try to + * first reset the command queue. If that fails do a + * host controller reset. */ - temp = XREAD4(sc, oper, XHCI_CRCR_LO); - XWRITE4(sc, oper, XHCI_CRCR_LO, temp | XHCI_CRCR_LO_CA); - - /* wait for abort event, if any */ - err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, hz / 16); - - if (err != 0 && xhci_interrupt_poll(sc) != 0) { - DPRINTF("Command was completed when polling\n"); - err = 0; - } - if (err != 0) { - DPRINTF("Command abort timeout!\n"); + if (timeout == 0 && + xhci_reset_command_queue_locked(sc) == 0) { + timeout = 1; + goto retry; + } else { + DPRINTF("Controller reset!\n"); + usb_bus_reset_async_locked(&sc->sc_bus); } err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; Modified: stable/10/sys/dev/usb/usb_bus.h ============================================================================== --- stable/10/sys/dev/usb/usb_bus.h Thu Dec 19 07:12:40 2013 (r259602) +++ stable/10/sys/dev/usb/usb_bus.h Thu Dec 19 07:13:59 2013 (r259603) @@ -81,6 +81,7 @@ struct usb_bus { struct usb_bus_msg attach_msg[2]; struct usb_bus_msg suspend_msg[2]; struct usb_bus_msg resume_msg[2]; + struct usb_bus_msg reset_msg[2]; struct usb_bus_msg shutdown_msg[2]; /* * This mutex protects the USB hardware: Modified: stable/10/sys/dev/usb/usb_controller.h ============================================================================== --- stable/10/sys/dev/usb/usb_controller.h Thu Dec 19 07:12:40 2013 (r259602) +++ stable/10/sys/dev/usb/usb_controller.h Thu Dec 19 07:13:59 2013 (r259603) @@ -191,6 +191,7 @@ void usb_bus_mem_flush_all(struct usb_bu uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb); void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr); +void usb_bus_reset_async_locked(struct usb_bus *bus); #if USB_HAVE_TT_SUPPORT uint8_t usbd_fs_isoc_schedule_alloc_slot(struct usb_xfer *isoc_xfer, uint16_t isoc_time); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:17:07 2013 Return-Path: Delivered-To: svn-src-all@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 A0B5C80D; Thu, 19 Dec 2013 07:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C49D1239; Thu, 19 Dec 2013 07:17:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7H77n096246; Thu, 19 Dec 2013 07:17:07 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7H7rQ096245; Thu, 19 Dec 2013 07:17:07 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190717.rBJ7H7rQ096245@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 07:17: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: r259604 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:17:07 -0000 Author: truckman Date: Thu Dec 19 07:17:07 2013 New Revision: 259604 URL: http://svnweb.freebsd.org/changeset/base/259604 Log: MFC r258629, 258662: r258629: Mention that devd will kldload the driver when the device is connected. Mention that the automatic mode switch from umass to u3g needed by some devices does not work unless the driver is loaded before the device is connected. r258662 (by joel): mdoc: sort sections. Modified: stable/9/share/man/man4/u3g.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/u3g.4 ============================================================================== --- stable/9/share/man/man4/u3g.4 Thu Dec 19 07:13:59 2013 (r259603) +++ stable/9/share/man/man4/u3g.4 Thu Dec 19 07:17:07 2013 (r259604) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd November 26, 2013 .Dt U3G 4 .Os .Sh NAME @@ -38,6 +38,9 @@ module at boot time, place the following .Bd -literal -offset indent u3g_load="YES" .Ed +.Pp +If neither of the above is done, the driver will automatically be loaded +by devd(8) when the device is connected. .Sh DESCRIPTION The .Nm @@ -95,6 +98,7 @@ and .Xr ucom 4 , .Xr usb 4 , .Xr usb_quirk 4 , +.Xr devd 8 , .Xr usbconfig 8 .Sh HISTORY The @@ -114,3 +118,7 @@ driver was written by and .An Nick Hibma Aq n_hibma@FreeBSD.org . Hardware for testing was provided by AnyWi Technologies, Leiden, NL. +.Sh BUGS +The automatic mode switch from disk mode to modem mode does not work unless +the driver is either built into the kernel or loaded before the device is +connected. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:17:19 2013 Return-Path: Delivered-To: svn-src-all@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 4DA49943; Thu, 19 Dec 2013 07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39CD1123C; Thu, 19 Dec 2013 07:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7HJNE096302; Thu, 19 Dec 2013 07:17:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7HJMf096301; Thu, 19 Dec 2013 07:17:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190717.rBJ7HJMf096301@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:17:19 +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: r259605 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:17:19 -0000 Author: hselasky Date: Thu Dec 19 07:17:18 2013 New Revision: 259605 URL: http://svnweb.freebsd.org/changeset/base/259605 Log: MFC r259248 and r259462: Set chain bit correctly. This will fix some problems sending and receiving Zero Length Packets, ZLPs. See comment in code for more information. Modified: stable/8/sys/dev/usb/controller/xhci.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/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Thu Dec 19 07:17:07 2013 (r259604) +++ stable/8/sys/dev/usb/controller/xhci.c Thu Dec 19 07:17:18 2013 (r259605) @@ -1858,7 +1858,16 @@ restart: td->td_trb[x].dwTrb2 = htole32(dword); dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | - XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT; + XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT | + /* + * CHAIN-BIT: Ensure that a multi-TRB IN-endpoint + * frame only receives a single short packet event + * by setting the CHAIN bit in the LINK field. In + * addition some XHCI controllers have problems + * sending a ZLP unless the CHAIN-BIT is set in + * the LINK TRB. + */ + XHCI_TRB_3_CHAIN_BIT; td->td_trb[x].dwTrb3 = htole32(dword); @@ -1896,9 +1905,11 @@ restart: } /* clear TD SIZE to zero, hence this is the last TRB */ - /* remove chain bit because this is the last TRB in the chain */ + /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); + /* remove CHAIN-BIT from last LINK TRB */ + td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:18:31 2013 Return-Path: Delivered-To: svn-src-all@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 9926EAAF; Thu, 19 Dec 2013 07:18:31 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83D741256; Thu, 19 Dec 2013 07:18:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7IVdX096480; Thu, 19 Dec 2013 07:18:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7IV3f096479; Thu, 19 Dec 2013 07:18:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190718.rBJ7IV3f096479@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:18:31 +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: r259606 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:18:31 -0000 Author: hselasky Date: Thu Dec 19 07:18:31 2013 New Revision: 259606 URL: http://svnweb.freebsd.org/changeset/base/259606 Log: MFC r259248 and r259462: Set chain bit correctly. This will fix some problems sending and receiving Zero Length Packets, ZLPs. See comment in code for more information. Modified: stable/9/sys/dev/usb/controller/xhci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Dec 19 07:17:18 2013 (r259605) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Dec 19 07:18:31 2013 (r259606) @@ -1858,7 +1858,16 @@ restart: td->td_trb[x].dwTrb2 = htole32(dword); dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | - XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT; + XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT | + /* + * CHAIN-BIT: Ensure that a multi-TRB IN-endpoint + * frame only receives a single short packet event + * by setting the CHAIN bit in the LINK field. In + * addition some XHCI controllers have problems + * sending a ZLP unless the CHAIN-BIT is set in + * the LINK TRB. + */ + XHCI_TRB_3_CHAIN_BIT; td->td_trb[x].dwTrb3 = htole32(dword); @@ -1896,9 +1905,11 @@ restart: } /* clear TD SIZE to zero, hence this is the last TRB */ - /* remove chain bit because this is the last TRB in the chain */ + /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); + /* remove CHAIN-BIT from last LINK TRB */ + td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:20:37 2013 Return-Path: Delivered-To: svn-src-all@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 DA841D60; Thu, 19 Dec 2013 07:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C65FC12E0; Thu, 19 Dec 2013 07:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7Kb6a097249; Thu, 19 Dec 2013 07:20:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7KbJ1097248; Thu, 19 Dec 2013 07:20:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312190720.rBJ7KbJ1097248@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Dec 2013 07:20: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: r259607 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:20:37 -0000 Author: hselasky Date: Thu Dec 19 07:20:37 2013 New Revision: 259607 URL: http://svnweb.freebsd.org/changeset/base/259607 Log: MFC r259248 and r259462: Set chain bit correctly. This will fix some problems sending and receiving Zero Length Packets, ZLPs. See comment in code for more information. Modified: stable/10/sys/dev/usb/controller/xhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Thu Dec 19 07:18:31 2013 (r259606) +++ stable/10/sys/dev/usb/controller/xhci.c Thu Dec 19 07:20:37 2013 (r259607) @@ -1892,7 +1892,16 @@ restart: td->td_trb[x].dwTrb2 = htole32(dword); dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | - XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT; + XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT | + /* + * CHAIN-BIT: Ensure that a multi-TRB IN-endpoint + * frame only receives a single short packet event + * by setting the CHAIN bit in the LINK field. In + * addition some XHCI controllers have problems + * sending a ZLP unless the CHAIN-BIT is set in + * the LINK TRB. + */ + XHCI_TRB_3_CHAIN_BIT; td->td_trb[x].dwTrb3 = htole32(dword); @@ -1930,9 +1939,11 @@ restart: } /* clear TD SIZE to zero, hence this is the last TRB */ - /* remove chain bit because this is the last TRB in the chain */ + /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); + /* remove CHAIN-BIT from last LINK TRB */ + td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 07:33:07 2013 Return-Path: Delivered-To: svn-src-all@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 D8AC5B67; Thu, 19 Dec 2013 07:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C417713DF; Thu, 19 Dec 2013 07:33:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ7X7Wu004341; Thu, 19 Dec 2013 07:33:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ7X7dg004339; Thu, 19 Dec 2013 07:33:07 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201312190733.rBJ7X7dg004339@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 19 Dec 2013 07:33: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: r259608 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 07:33:07 -0000 Author: alfred Date: Thu Dec 19 07:33:07 2013 New Revision: 259608 URL: http://svnweb.freebsd.org/changeset/base/259608 Log: Defer start/stop port to workqueues. MFC: 259411 Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Dec 19 07:20:37 2013 (r259607) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Dec 19 07:33:07 2013 (r259608) @@ -153,6 +153,19 @@ restart: return (i); } +static void mlx4_en_stop_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->stop_port_task); +} + +static void mlx4_en_start_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->start_port_task); +} static void mlx4_en_set_multicast(struct net_device *dev) { @@ -473,6 +486,7 @@ static void mlx4_en_do_get_stats(struct queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); } + mlx4_en_QUERY_PORT(priv->mdev, priv->port); mutex_unlock(&mdev->state_lock); } @@ -498,8 +512,31 @@ static void mlx4_en_linkstate(struct wor mutex_unlock(&mdev->state_lock); } +static void mlx4_en_lock_and_stop_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + stop_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_stop_port(dev); + mutex_unlock(&mdev->state_lock); +} + +static void mlx4_en_lock_and_start_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + start_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_start_port(dev); + mutex_unlock(&mdev->state_lock); +} -int mlx4_en_start_port(struct net_device *dev) +int mlx4_en_do_start_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -691,7 +728,7 @@ cq_err: } -void mlx4_en_stop_port(struct net_device *dev) +void mlx4_en_do_stop_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -761,8 +798,8 @@ reset: mutex_lock(&mdev->state_lock); if (priv->port_up) { - mlx4_en_stop_port(dev); - if (mlx4_en_start_port(dev)) + mlx4_en_do_stop_port(dev); + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed restarting port %d\n", priv->port); } mutex_unlock(&mdev->state_lock); @@ -793,7 +830,7 @@ mlx4_en_init_locked(struct mlx4_en_priv dev = priv->dev; mdev = priv->mdev; if (dev->if_drv_flags & IFF_DRV_RUNNING) - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); if (!mdev->device_up) { en_err(priv, "Cannot open - device down/disabled\n"); @@ -816,7 +853,7 @@ mlx4_en_init_locked(struct mlx4_en_priv } mlx4_en_set_default_moderation(priv); - if (mlx4_en_start_port(dev)) + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed starting port:%d\n", priv->port); } @@ -905,7 +942,7 @@ void mlx4_en_destroy_netdev(struct net_d mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); mutex_lock(&mdev->state_lock); - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mutex_unlock(&mdev->state_lock); cancel_delayed_work(&priv->stats_task); @@ -925,7 +962,6 @@ void mlx4_en_destroy_netdev(struct net_d mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); - mtx_destroy(&priv->ioctl_lock.m); kfree(priv); if_free(dev); } @@ -951,9 +987,9 @@ static int mlx4_en_change_mtu(struct net * the port */ en_dbg(DRV, priv, "Change MTU called with card down!?\n"); } else { - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mlx4_en_set_default_moderation(priv); - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) { en_err(priv, "Failed restarting port:%d\n", priv->port); @@ -973,8 +1009,13 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); + /* + * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a + * non-sleepable lock. + * I moved it to the periodic mlx4_en_do_get_stats. + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + return (active); + */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1078,7 +1119,6 @@ static int mlx4_en_ioctl(struct ifnet *d error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: - mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) mlx4_en_start_port(dev); @@ -1087,16 +1127,24 @@ static int mlx4_en_ioctl(struct ifnet *d } else { if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); - if_link_state_change(dev, LINK_STATE_DOWN); + if_link_state_change(dev, LINK_STATE_DOWN); + /* + * Since mlx4_en_stop_port is defered we + * have to wait till it's finished. + */ + for (int count=0; count<10; count++) { + if (dev->if_drv_flags & IFF_DRV_RUNNING) { + DELAY(20000); + } else { + break; + } + } } } - mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: - spin_lock(&priv->ioctl_lock); mlx4_en_set_multicast(dev); - spin_unlock(&priv->ioctl_lock); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: @@ -1153,7 +1201,7 @@ static int mlx4_en_set_ring_size(struct mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); } mlx4_en_free_resources(priv); priv->prof->tx_ring_size = tx_size; @@ -1164,7 +1212,7 @@ static int mlx4_en_set_ring_size(struct goto out; } if (port_up) { - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) en_err(priv, "Failed starting port\n"); } @@ -1256,7 +1304,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(priv->dev); + mlx4_en_do_stop_port(priv->dev); } mlx4_en_free_resources(priv); priv->tx_ring_num = tx_ring_num; @@ -1265,7 +1313,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN if (error) en_err(priv, "Failed reallocating port resources\n"); if (error == 0 && port_up) { - error = -mlx4_en_start_port(priv->dev); + error = -mlx4_en_do_start_port(priv->dev); if (error) en_err(priv, "Failed starting port\n"); } @@ -1517,8 +1565,9 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->msg_enable = MLX4_EN_MSG_LEVEL; priv->ip_reasm = priv->mdev->profile.ip_reasm; mtx_init(&priv->stats_lock.m, "mlx4 stats", NULL, MTX_DEF); - mtx_init(&priv->ioctl_lock.m, "mlx4 ioctl", NULL, MTX_DEF); mtx_init(&priv->vlan_lock.m, "mlx4 vlan", NULL, MTX_DEF); + INIT_WORK(&priv->start_port_task, mlx4_en_lock_and_start_port); + INIT_WORK(&priv->stop_port_task, mlx4_en_lock_and_stop_port); INIT_WORK(&priv->mcast_task, mlx4_en_do_set_multicast); INIT_WORK(&priv->watchdog_task, mlx4_en_restart); INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); Modified: stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Thu Dec 19 07:20:37 2013 (r259607) +++ stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h Thu Dec 19 07:33:07 2013 (r259608) @@ -493,7 +493,6 @@ struct mlx4_en_priv { spinlock_t vlan_lock; struct mlx4_en_port_state port_state; spinlock_t stats_lock; - spinlock_t ioctl_lock; unsigned long last_moder_packets[MAX_RX_RINGS]; unsigned long last_moder_tx_packets; @@ -546,6 +545,8 @@ struct mlx4_en_priv { struct mlx4_en_cq rx_cq[MAX_RX_RINGS]; struct mlx4_en_tx_hash_entry tx_hash[MLX4_EN_TX_HASH_SIZE]; struct work_struct mcast_task; + struct work_struct start_port_task; + struct work_struct stop_port_task; struct work_struct watchdog_task; struct work_struct linkstate_task; struct delayed_work stats_task; @@ -580,8 +581,8 @@ void mlx4_en_destroy_netdev(struct net_d int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, struct mlx4_en_port_profile *prof); -int mlx4_en_start_port(struct net_device *dev); -void mlx4_en_stop_port(struct net_device *dev); +int mlx4_en_do_start_port(struct net_device *dev); +void mlx4_en_do_stop_port(struct net_device *dev); void mlx4_en_free_resources(struct mlx4_en_priv *priv); int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 08:06:43 2013 Return-Path: Delivered-To: svn-src-all@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 25BD4A59; Thu, 19 Dec 2013 08:06:43 +0000 (UTC) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id D3E4A16B7; Thu, 19 Dec 2013 08:06:42 +0000 (UTC) Received: by lath.rinet.ru (Postfix, from userid 222) id EB59388C2; Thu, 19 Dec 2013 11:56:47 +0400 (MSK) Date: Thu, 19 Dec 2013 11:56:47 +0400 From: Oleg Bulyzhin To: "Andrey V. Elsukov" Subject: Re: svn commit: r258346 - stable/10/sys/dev/ixgbe Message-ID: <20131219075647.GA39816@lath.rinet.ru> References: <201311191424.rAJEOQ8U037410@svn.freebsd.org> <52AF3001.2000208@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52AF3001.2000208@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Oleg Bulyzhin , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 08:06:43 -0000 On Mon, Dec 16, 2013 at 08:53:21PM +0400, Andrey V. Elsukov wrote: > On 19.11.2013 18:24, Oleg Bulyzhin wrote: > > Author: oleg > > Date: Tue Nov 19 14:24:25 2013 > > New Revision: 258346 > > URL: http://svnweb.freebsd.org/changeset/base/258346 > > > > Log: > > MFC: 257695 > > > > - Fix link loss on vlan reconfiguration. > > - Fix issues with 'vlanhwfilter'. > > Hi, Oleg, > > do you plan to merge this in stable/9 too? > > -- > WBR, Andrey V. Elsukov I didn't plan it (i'm still hoping jfv@ will fix it). -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 09:01:47 2013 Return-Path: Delivered-To: svn-src-all@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 29592700; Thu, 19 Dec 2013 09:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15EB71B05; Thu, 19 Dec 2013 09:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ91kgA036882; Thu, 19 Dec 2013 09:01:46 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ91ko3036881; Thu, 19 Dec 2013 09:01:46 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201312190901.rBJ91ko3036881@svn.freebsd.org> From: Stefan Esser Date: Thu, 19 Dec 2013 09:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259609 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 09:01:47 -0000 Author: se Date: Thu Dec 19 09:01:46 2013 New Revision: 259609 URL: http://svnweb.freebsd.org/changeset/base/259609 Log: Fix overflow for timeout values of more than 68 years, which is the maximum covered by sbintime (LONG_MAX seconds). Some programs use timeout values in excess of 1000 years. The conversion to sbintime caused wrap-around on overflow, which resulted in short or negative timeout values. This caused long delays on sockets opened by affected programs (e.g. OpenSSH). Kernels compiled without -fno-strict-overflow were not affected, apparently because the compiler tested the sign of the timeout value before performing the multiplication that lead to overflow. When the -fno-strict-overflow option was added to CFLAGS, this optimization was disabled and the test was performed on the result of the multiplication. Negative products were caught and resulted in EINVAL being returned, but wrap-around to positive values just shortened the timeout value to the residue of the result that could be represented by sbintime. The fix is to cap the timeout values at the maximum that can be represented by sbintime, which is 2^31 - 1 seconds or more than 68 years. After this change, the kernel can be compiled with -fno-strict-overflow with no ill effects. MFC after: 3 days Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) static __inline sbintime_t timer2sbintime(intptr_t data) { - + if (data > LLONG_MAX / SBT_1MS) + return LLONG_MAX; return (SBT_1MS * data); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 09:46:14 2013 Return-Path: Delivered-To: svn-src-all@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 E81E93B9; Thu, 19 Dec 2013 09:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3C881F34; Thu, 19 Dec 2013 09:46:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJ9kEIl051176; Thu, 19 Dec 2013 09:46:14 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJ9kE67051174; Thu, 19 Dec 2013 09:46:14 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312190946.rBJ9kE67051174@svn.freebsd.org> From: Don Lewis Date: Thu, 19 Dec 2013 09:46:14 +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: r259610 - in 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 09:46:15 -0000 Author: truckman Date: Thu Dec 19 09:46:14 2013 New Revision: 259610 URL: http://svnweb.freebsd.org/changeset/base/259610 Log: MFC r258363: Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my Virgin Mobile branded device. It needs the U3GINIT_SCSIEJECT quirk. Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs 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 Thu Dec 19 09:01:46 2013 (r259609) +++ stable/8/sys/dev/usb/serial/u3g.c Thu Dec 19 09:46:14 2013 (r259610) @@ -340,6 +340,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Dec 19 09:01:46 2013 (r259609) +++ stable/8/sys/dev/usb/usbdevs Thu Dec 19 09:46:14 2013 (r259610) @@ -3068,6 +3068,7 @@ product NOVATEL EU870D 0x2420 Expedite product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD product NOVATEL U727_2 0x5100 Merlin U727 CDMA product NOVATEL U760 0x6000 Novatel U760 From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 11:16:18 2013 Return-Path: Delivered-To: svn-src-all@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 EB35E528; Thu, 19 Dec 2013 11:16:17 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 31D0014ED; Thu, 19 Dec 2013 11:16:17 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E34D1421EEA; Thu, 19 Dec 2013 21:49:42 +1100 (EST) Date: Thu, 19 Dec 2013 21:49:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Esser Subject: Re: svn commit: r259609 - head/sys/kern In-Reply-To: <201312190901.rBJ91ko3036881@svn.freebsd.org> Message-ID: <20131219204903.V24189@besplex.bde.org> References: <201312190901.rBJ91ko3036881@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=HZAtEE08 c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=YOrjK_Anl_cA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=2ZRwf33eRQXAlThll-8A:9 a=ffKMsPN5J7qry5RI:21 a=ykkCnlJT-72suRuO:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 11:16:18 -0000 On Thu, 19 Dec 2013, Stefan Esser wrote: > Log: > Fix overflow for timeout values of more than 68 years, which is the maximum > covered by sbintime (LONG_MAX seconds). Not LONG_MAX seconds, but INT32_MAX seconds. LONG_MAX seconds is about 2**32 times larger on 64-bit arches. sbintimes and their complexity give many more possibilities for overflow. I thought that the new overflow bugs and some old ones were already fixed. > Some programs use timeout values in excess of 1000 years. The conversion > to sbintime caused wrap-around on overflow, which resulted in short or > negative timeout values. This caused long delays on sockets opened by > affected programs (e.g. OpenSSH). > > Kernels compiled without -fno-strict-overflow were not affected, apparently > because the compiler tested the sign of the timeout value before performing > the multiplication that lead to overflow. I think it just gave a garbage value that was accidentally less harmful. > When the -fno-strict-overflow option was added to CFLAGS, this optimization > was disabled and the test was performed on the result of the multiplication. > Negative products were caught and resulted in EINVAL being returned, but > wrap-around to positive values just shortened the timeout value to the > residue of the result that could be represented by sbintime. This shows one reason why -fno-strict-overflow shouldn't be used. It just wastes time to give different undefined behaviour with undocumented details. > The fix is to cap the timeout values at the maximum that can be represented > by sbintime, which is 2^31 - 1 seconds or more than 68 years. 2^31 - 1 is a correct spelling of INT32_MAX, unlike LONG_MAX. > After this change, the kernel can be compiled with -fno-strict-overflow > with no ill effects. > Modified: head/sys/kern/kern_event.c > ============================================================================== > --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) > +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) > @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) > static __inline sbintime_t > timer2sbintime(intptr_t data) > { > - > + if (data > LLONG_MAX / SBT_1MS) > + return LLONG_MAX; > return (SBT_1MS * data); > } This has the following style bugs: - it removes the empty line after the (null) declarations - it is missing parentheses around the return value - it uses the long long abomination This has the following type errors: - using the long long abomination is not just a style bug. sbintime_t has type int64_t, not long long. The overflow check will break if long long becomes longer than int64_t - returning LLONG_MAX is usually just a style bug. When long long is longer than int64_t, the return value will overflow, but the implementation-defined behaviour for this is usually to convert it to the correct value. INT64_MAX is a dangerous default maximum timeout. You can't even add the minimum sbintime_t of 2**-32 seconds to this without overflowing. Old timeout code used the following method to reduce the problem of overflowing timeouts: For alarm() and setitimer(), limit the timeout to 100 million seconds (3.17 years) and return EINVAL if it is too large. This works with 32-bit time_t until about 2035. POSIX doesn't allow this. Clamping the time to 100 million seconds isn't allowed either, since the residual time can be seen from applications. Note that 64-bit time_t has little effect on this problem. Uses wishing to overflow the kernel simply ask for a timeout in a timeval of INT64_MAX seconds plus 999999 seconds so that adding just 1 microseconds to it overflow. With seconds in sbintime_t instead of in time_t, overflow occurs much sooner. This is quite broken now: - the limit of 100000000 used to be enforced in itimerfix(), but this was removed in connection with implementing POSIX realtime timers without even breaking the documentaion to match or touching PR(s) about the POSIX non-conformance of the limit. - setitimer() mostly uses sbintimes now, so the old limit is irrelevant and enforcing it in itimerfix() would break the new sbintime code and presumably the not so new realtime timers code. The sbintime code uses a modified limit that is also not allowed by POSIX. This limit is of course undocumented. It is INT32_MAX / 2, so that there is plenty of room for expansion. This is what the above should use, modulo the conformance bug. EINVAL is returned when this limit is exceeded. - select() and poll() were more careful and seem to be correct now. The timeout in poll() is limited to INT_MAX milliseconds, so it fits in sbintime_t. Except this assumes that int is 32 bits. select() limits the timeout to INT32_MAX seconds so that it is representable as an sbintime_t and then does a further overflow check involving INT64_MAX. When overflow would occur, it sets asbt to -1, which I think means an infinite timeout. I don't like this. -1 is a tiny amount less than 0, not near plus infinity. - nanosleep() used to be less careful than select() and poll(), but seems to have been fixed. For some reason, it uses a mixture of the above methods. It limits sleep times to INT32_MAX / 2 seconds but repeats the sleep as necessary so as not to return an error. The logic for this is subtle and I haven't checked it. davide@ has patches related to fixing this, but none seem to have been committed yet, except some old ones that gave some of the above overflow checking. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 11:57:39 2013 Return-Path: Delivered-To: svn-src-all@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 ED07253A; Thu, 19 Dec 2013 11:57:38 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5F917FA; Thu, 19 Dec 2013 11:57:37 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBJBvZIB069553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Dec 2013 15:57:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBJBvZY9069552; Thu, 19 Dec 2013 15:57:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Dec 2013 15:57:35 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131219115735.GN29088@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> <201312181640.52147.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312181640.52147.jhb@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 11:57:39 -0000 On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: J> > On 18.12.2013 22:45, John-Mark Gurney wrote: J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: J> > >> Author: melifaro J> > >> Date: Wed Dec 18 18:25:27 2013 J> > >> New Revision: 259562 J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 J> > >> J> > >> Log: J> > >> Switch netstat -rn to use standard API for retrieving list of routes J> > >> instead of peeking inside in-kernel radix via kget. J> > >> This permits us to change kernel structures without breaking userland. J> > >> Additionally, this change provide more reliable and faster output. J> > >> J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W J> > >> for other families) were removed. `Refs` is radix-specific thing J> > >> which is not informative for users. `Use` field value is handy sometimes, J> > >> but a) current API does not support it and b) I'm not sure we will J> > >> support per-rte pcpu counters in near future. J> > >> J> > >> Old method of retrieving data is still supported (either by defining J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are J> > >> hidden. J> > >> J> > >> Sponsored by: Yandex LLC J> > >> MFC after: 4 weeks J> > >> PR: kern/167204 J> > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will J> > > this change make it not usable, or will you still automatically use J> > Well. It will probably break in (maybe, near) future. J> J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's J> fine if kvm mode is fragile and requires the binary to be in sync with the J> kernel and is only used for crash dumps, but it is very useful to extract J> all sorts of info out of a crash dump. The problem is that these tools (netstat, and some others) prevent us from improving the kernel network stack. We can't make improvements that are mergeable to stable/x branch, since the tools would be broken. Moreover any improvement in head/, requires from developer additional work in netstat code, which I must admit isn't a pleasure to work with. And any improvement in head adds additional incompatibility between newer kernel and older world, which is of course allowed in CURRENT, but still we'd prefer to reduce number of such events. I agree that usage of tools on vmcores is useful. But we all should agree that it has very limited use. Only kernel hackers and developers are expected to do this. However, speaking of myself, I was never interested in routing table from a vmcore neither interface statistics, when fixing a bug in networking stack, and I've fixed quite a lot of them. Still, I believe, that some developers find this useful. My suggestion is that all this code is deleted from src/usr.bin/netstat, and moved to src/tools, and we relax assertion that src/tools must be compatible with any kernel within the branch. So, any person who wants this functionality, needs to keep his src/tools in sync with kernel and compile a tool when he desires to dump routing table from a vmcore. Finally, when we remove all the kvm(3) usage from a tool, then we can remove the sugid bit from it, which would be a another fine point. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 12:00:48 2013 Return-Path: Delivered-To: svn-src-all@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 98C8575C; Thu, 19 Dec 2013 12:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8506A18A4; Thu, 19 Dec 2013 12:00:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJC0mG5001225; Thu, 19 Dec 2013 12:00:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJC0mXm001223; Thu, 19 Dec 2013 12:00:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201312191200.rBJC0mXm001223@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Dec 2013 12:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259612 - head/sys/dev/drm2/ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 12:00:48 -0000 Author: avg Date: Thu Dec 19 12:00:48 2013 New Revision: 259612 URL: http://svnweb.freebsd.org/changeset/base/259612 Log: ttm_bo_vm_lookup_rb: actually make use of the red-black tree Previously the code would just iterate over the whole tree as if it were just a list. Without this change I would observe X server becoming more and more jerky over time. MFC after: 5 days Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Dec 19 10:28:54 2013 (r259611) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Dec 19 12:00:48 2013 (r259612) @@ -76,13 +76,16 @@ static struct ttm_buffer_object *ttm_bo_ struct ttm_buffer_object *bo; struct ttm_buffer_object *best_bo = NULL; - RB_FOREACH(bo, ttm_bo_device_buffer_objects, &bdev->addr_space_rb) { + bo = RB_ROOT(&bdev->addr_space_rb); + while (bo != NULL) { cur_offset = bo->vm_node->start; if (page_start >= cur_offset) { best_bo = bo; if (page_start == cur_offset) break; - } + bo = RB_RIGHT(bo, vm_rb); + } else + bo = RB_LEFT(bo, vm_rb); } if (unlikely(best_bo == NULL)) From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 12:33:25 2013 Return-Path: Delivered-To: svn-src-all@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 A8EF1256; Thu, 19 Dec 2013 12:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88D601B32; Thu, 19 Dec 2013 12:33:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJCXPkv012804; Thu, 19 Dec 2013 12:33:25 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJCXOkX012801; Thu, 19 Dec 2013 12:33:24 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312191233.rBJCXOkX012801@svn.freebsd.org> From: Bryan Drewery Date: Thu, 19 Dec 2013 12:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259613 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 12:33:25 -0000 Author: bdrewery Date: Thu Dec 19 12:33:24 2013 New Revision: 259613 URL: http://svnweb.freebsd.org/changeset/base/259613 Log: MFC r259266: Fix multi-repository support by properly respecting 'enabled' flag. This will read the REPOS_DIR env/config setting (default is /etc/pkg and /usr/local/etc/pkg/repos) and use the last enabled repository. This can be changed in the environment using a comma-separated list, or in /usr/local/etc/pkg.conf with JSON array syntax of: REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] Approved by: bapt (mentor) Modified: stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/config.h stable/10/usr.sbin/pkg/pkg.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Thu Dec 19 12:00:48 2013 (r259612) +++ stable/10/usr.sbin/pkg/config.c Thu Dec 19 12:33:24 2013 (r259613) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -51,11 +53,17 @@ __FBSDID("$FreeBSD$"); #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +struct config_value { + char *value; + STAILQ_ENTRY(config_value) next; +}; + struct config_entry { uint8_t type; const char *key; const char *val; char *value; + STAILQ_HEAD(, config_value) *list; bool envset; }; @@ -65,6 +73,7 @@ static struct config_entry c[] = { "PACKAGESITE", URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest", NULL, + NULL, false, }, [ABI] = { @@ -72,6 +81,7 @@ static struct config_entry c[] = { "ABI", NULL, NULL, + NULL, false, }, [MIRROR_TYPE] = { @@ -79,6 +89,7 @@ static struct config_entry c[] = { "MIRROR_TYPE", "SRV", NULL, + NULL, false, }, [ASSUME_ALWAYS_YES] = { @@ -86,6 +97,7 @@ static struct config_entry c[] = { "ASSUME_ALWAYS_YES", "NO", NULL, + NULL, false, }, [SIGNATURE_TYPE] = { @@ -93,6 +105,7 @@ static struct config_entry c[] = { "SIGNATURE_TYPE", NULL, NULL, + NULL, false, }, [FINGERPRINTS] = { @@ -100,6 +113,15 @@ static struct config_entry c[] = { "FINGERPRINTS", NULL, NULL, + NULL, + false, + }, + [REPOS_DIR] = { + PKG_CONFIG_LIST, + "REPOS_DIR", + NULL, + NULL, + NULL, false, }, }; @@ -474,17 +496,34 @@ subst_packagesite(const char *abi) c[PACKAGESITE].value = strdup(sbuf_data(newval)); } +static int +boolstr_to_bool(const char *str) +{ + if (str != NULL && (strcasecmp(str, "true") == 0 || + strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0 || + str[0] == '1')) + return (true); + + return (false); +} + static void config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) { + yaml_node_item_t *item; yaml_node_pair_t *pair; - yaml_node_t *key, *val; + yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + struct config_entry *temp_config; + struct config_value *cv; int i; size_t j; pair = node->data.mapping.pairs.start; + /* Temporary config for configs that may be disabled. */ + temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); + while (pair < node->data.mapping.pairs.top) { key = yaml_document_get_node(doc, pair->key); val = yaml_document_get_node(doc, pair->value); @@ -530,7 +569,12 @@ config_parse(yaml_document_t *doc, yaml_ else if (strcasecmp(key->data.scalar.value, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else { /* Skip unknown entries for future use. */ + else if (strcasecmp(key->data.scalar.value, + "enabled") == 0) { + /* Skip disabled repos. */ + if (!boolstr_to_bool(val->data.scalar.value)) + goto cleanup; + } else { /* Skip unknown entries for future use. */ ++pair; continue; } @@ -554,10 +598,58 @@ config_parse(yaml_document_t *doc, yaml_ continue; } - c[i].value = strdup(val->data.scalar.value); + /* Parse sequence value ["item1", "item2"] */ + switch (c[i].type) { + case PKG_CONFIG_LIST: + if (val->type != YAML_SEQUENCE_NODE) { + fprintf(stderr, "Skipping invalid array " + "value for %s.\n", c[i].key); + ++pair; + continue; + } + item = val->data.sequence.items.start; + temp_config[i].list = + malloc(sizeof(*temp_config[i].list)); + STAILQ_INIT(temp_config[i].list); + + while (item < val->data.sequence.items.top) { + item_val = yaml_document_get_node(doc, *item); + if (item_val->type != YAML_SCALAR_NODE) { + ++item; + continue; + } + cv = malloc(sizeof(struct config_value)); + cv->value = + strdup(item_val->data.scalar.value); + STAILQ_INSERT_TAIL(temp_config[i].list, cv, + next); + ++item; + } + break; + default: + /* Normal string value. */ + temp_config[i].value = strdup(val->data.scalar.value); + break; + } ++pair; } + /* Repo is enabled, copy over all settings from temp_config. */ + for (i = 0; i < CONFIG_SIZE; i++) { + if (c[i].envset) + continue; + switch (c[i].type) { + case PKG_CONFIG_LIST: + c[i].list = temp_config[i].list; + break; + default: + c[i].value = temp_config[i].value; + break; + } + } + +cleanup: + free(temp_config); sbuf_delete(buf); } @@ -632,23 +724,84 @@ read_conf_file(const char *confpath, pkg return (0); } +static int +load_repositories(const char *repodir) +{ + struct dirent *ent; + DIR *d; + char *p; + size_t n; + char path[MAXPATHLEN]; + int ret; + + ret = 0; + + if ((d = opendir(repodir)) == NULL) + return (1); + + while ((ent = readdir(d))) { + /* Trim out 'repos'. */ + if ((n = strlen(ent->d_name)) <= 5) + continue; + p = &ent->d_name[n - 5]; + if (strcmp(p, ".conf") == 0) { + snprintf(path, sizeof(path), "%s%s%s", + repodir, + repodir[strlen(repodir) - 1] == '/' ? "" : "/", + ent->d_name); + if (access(path, F_OK) == 0 && + read_conf_file(path, CONFFILE_REPO)) { + ret = 1; + goto cleanup; + } + } + } + +cleanup: + closedir(d); + + return (ret); +} + int config_init(void) { - const char *val; + char *val; int i; const char *localbase; + char *env_list_item; char confpath[MAXPATHLEN]; + struct config_value *cv; char abi[BUFSIZ]; for (i = 0; i < CONFIG_SIZE; i++) { val = getenv(c[i].key); if (val != NULL) { - c[i].val = val; c[i].envset = true; + switch (c[i].type) { + case PKG_CONFIG_LIST: + /* Split up comma-separated items from env. */ + c[i].list = malloc(sizeof(*c[i].list)); + STAILQ_INIT(c[i].list); + for (env_list_item = strtok(val, ","); + env_list_item != NULL; + env_list_item = strtok(NULL, ",")) { + cv = + malloc(sizeof(struct config_value)); + cv->value = + strdup(env_list_item); + STAILQ_INSERT_TAIL(c[i].list, cv, + next); + } + break; + default: + c[i].val = val; + break; + } } } + /* Read LOCALBASE/etc/pkg.conf first. */ localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); @@ -657,10 +810,22 @@ config_init(void) CONFFILE_PKG)) goto finalize; - snprintf(confpath, sizeof(confpath), "/etc/pkg/FreeBSD.conf"); - if (access(confpath, F_OK) == 0 && read_conf_file(confpath, - CONFFILE_REPO)) - goto finalize; + /* Then read in all repos from REPOS_DIR list of directories. */ + if (c[REPOS_DIR].list == NULL) { + c[REPOS_DIR].list = malloc(sizeof(*c[REPOS_DIR].list)); + STAILQ_INIT(c[REPOS_DIR].list); + cv = malloc(sizeof(struct config_value)); + cv->value = strdup("/etc/pkg"); + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + cv = malloc(sizeof(struct config_value)); + if (asprintf(&cv->value, "%s/etc/pkg/repos", localbase) < 0) + goto finalize; + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + } + + STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) + if (load_repositories(cv->value)) + goto finalize; finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { @@ -704,10 +869,7 @@ config_bool(pkg_config_key k, bool *val) else value = c[k].val; - if (strcasecmp(value, "true") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "on") == 0 || - *value == '1') + if (boolstr_to_bool(value)) *val = true; return (0); Modified: stable/10/usr.sbin/pkg/config.h ============================================================================== --- stable/10/usr.sbin/pkg/config.h Thu Dec 19 12:00:48 2013 (r259612) +++ stable/10/usr.sbin/pkg/config.h Thu Dec 19 12:33:24 2013 (r259613) @@ -39,12 +39,14 @@ typedef enum { ASSUME_ALWAYS_YES, SIGNATURE_TYPE, FINGERPRINTS, + REPOS_DIR, CONFIG_SIZE } pkg_config_key; typedef enum { PKG_CONFIG_STRING=0, PKG_CONFIG_BOOL, + PKG_CONFIG_LIST, } pkg_config_t; typedef enum { Modified: stable/10/usr.sbin/pkg/pkg.7 ============================================================================== --- stable/10/usr.sbin/pkg/pkg.7 Thu Dec 19 12:00:48 2013 (r259612) +++ stable/10/usr.sbin/pkg/pkg.7 Thu Dec 19 12:33:24 2013 (r259613) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2013 +.Dd December 12, 2013 .Dt PKG 7 .Os .Sh NAME @@ -152,6 +152,7 @@ MIRROR_TYPE: "srv", SIGNATURE_TYPE: "none", FINGERPRINTS: "/usr/share/keys/pkg", ASSUME_ALWAYS_YES: "yes" +REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] .Ed .Pp Reference @@ -194,14 +195,20 @@ The URL that .Xr pkg 8 and other packages will be fetched from. +.It Ev REPOS_DIR +Comma-separated list of directories that should be searched for repository +configuration files. .El .Sh FILES Configuration is read from the files in the listed order. -The first enabled repository is the one used for bootstrapping +This path can be changed by setting +.Sy REPOS_DIR . +The last enabled repository is the one used for bootstrapping .Xr pkg 8 . .Bl -tag -width "/usr/local/etc/pkg/repos/*.conf" .It Pa /usr/local/etc/pkg.conf .It Pa /etc/pkg/FreeBSD.conf +.It Pa /usr/local/etc/pkg/repos/*.conf .El .Sh EXAMPLES Some examples are listed here. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 13:44:08 2013 Return-Path: Delivered-To: svn-src-all@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 2168AF5B; Thu, 19 Dec 2013 13:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0273411DF; Thu, 19 Dec 2013 13:44:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJDi7Pk039276; Thu, 19 Dec 2013 13:44:07 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJDi7rT039273; Thu, 19 Dec 2013 13:44:07 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312191344.rBJDi7rT039273@svn.freebsd.org> From: Bryan Drewery Date: Thu, 19 Dec 2013 13:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259614 - releng/10.0/usr.sbin/pkg X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 13:44:08 -0000 Author: bdrewery Date: Thu Dec 19 13:44:07 2013 New Revision: 259614 URL: http://svnweb.freebsd.org/changeset/base/259614 Log: MFS r259613: Fix multi-repository support by properly respecting 'enabled' flag. This will read the REPOS_DIR env/config setting (default is /etc/pkg and /usr/local/etc/pkg/repos) and use the last enabled repository. This can be changed in the environment using a comma-separated list, or in /usr/local/etc/pkg.conf with JSON array syntax of: REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] Approved by: bapt (mentor) Approved by: re (gjb) Modified: releng/10.0/usr.sbin/pkg/config.c releng/10.0/usr.sbin/pkg/config.h releng/10.0/usr.sbin/pkg/pkg.7 Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/pkg/config.c ============================================================================== --- releng/10.0/usr.sbin/pkg/config.c Thu Dec 19 12:33:24 2013 (r259613) +++ releng/10.0/usr.sbin/pkg/config.c Thu Dec 19 13:44:07 2013 (r259614) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -51,11 +53,17 @@ __FBSDID("$FreeBSD$"); #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +struct config_value { + char *value; + STAILQ_ENTRY(config_value) next; +}; + struct config_entry { uint8_t type; const char *key; const char *val; char *value; + STAILQ_HEAD(, config_value) *list; bool envset; }; @@ -65,6 +73,7 @@ static struct config_entry c[] = { "PACKAGESITE", URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest", NULL, + NULL, false, }, [ABI] = { @@ -72,6 +81,7 @@ static struct config_entry c[] = { "ABI", NULL, NULL, + NULL, false, }, [MIRROR_TYPE] = { @@ -79,6 +89,7 @@ static struct config_entry c[] = { "MIRROR_TYPE", "SRV", NULL, + NULL, false, }, [ASSUME_ALWAYS_YES] = { @@ -86,6 +97,7 @@ static struct config_entry c[] = { "ASSUME_ALWAYS_YES", "NO", NULL, + NULL, false, }, [SIGNATURE_TYPE] = { @@ -93,6 +105,7 @@ static struct config_entry c[] = { "SIGNATURE_TYPE", NULL, NULL, + NULL, false, }, [FINGERPRINTS] = { @@ -100,6 +113,15 @@ static struct config_entry c[] = { "FINGERPRINTS", NULL, NULL, + NULL, + false, + }, + [REPOS_DIR] = { + PKG_CONFIG_LIST, + "REPOS_DIR", + NULL, + NULL, + NULL, false, }, }; @@ -474,17 +496,34 @@ subst_packagesite(const char *abi) c[PACKAGESITE].value = strdup(sbuf_data(newval)); } +static int +boolstr_to_bool(const char *str) +{ + if (str != NULL && (strcasecmp(str, "true") == 0 || + strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0 || + str[0] == '1')) + return (true); + + return (false); +} + static void config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) { + yaml_node_item_t *item; yaml_node_pair_t *pair; - yaml_node_t *key, *val; + yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + struct config_entry *temp_config; + struct config_value *cv; int i; size_t j; pair = node->data.mapping.pairs.start; + /* Temporary config for configs that may be disabled. */ + temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); + while (pair < node->data.mapping.pairs.top) { key = yaml_document_get_node(doc, pair->key); val = yaml_document_get_node(doc, pair->value); @@ -530,7 +569,12 @@ config_parse(yaml_document_t *doc, yaml_ else if (strcasecmp(key->data.scalar.value, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else { /* Skip unknown entries for future use. */ + else if (strcasecmp(key->data.scalar.value, + "enabled") == 0) { + /* Skip disabled repos. */ + if (!boolstr_to_bool(val->data.scalar.value)) + goto cleanup; + } else { /* Skip unknown entries for future use. */ ++pair; continue; } @@ -554,10 +598,58 @@ config_parse(yaml_document_t *doc, yaml_ continue; } - c[i].value = strdup(val->data.scalar.value); + /* Parse sequence value ["item1", "item2"] */ + switch (c[i].type) { + case PKG_CONFIG_LIST: + if (val->type != YAML_SEQUENCE_NODE) { + fprintf(stderr, "Skipping invalid array " + "value for %s.\n", c[i].key); + ++pair; + continue; + } + item = val->data.sequence.items.start; + temp_config[i].list = + malloc(sizeof(*temp_config[i].list)); + STAILQ_INIT(temp_config[i].list); + + while (item < val->data.sequence.items.top) { + item_val = yaml_document_get_node(doc, *item); + if (item_val->type != YAML_SCALAR_NODE) { + ++item; + continue; + } + cv = malloc(sizeof(struct config_value)); + cv->value = + strdup(item_val->data.scalar.value); + STAILQ_INSERT_TAIL(temp_config[i].list, cv, + next); + ++item; + } + break; + default: + /* Normal string value. */ + temp_config[i].value = strdup(val->data.scalar.value); + break; + } ++pair; } + /* Repo is enabled, copy over all settings from temp_config. */ + for (i = 0; i < CONFIG_SIZE; i++) { + if (c[i].envset) + continue; + switch (c[i].type) { + case PKG_CONFIG_LIST: + c[i].list = temp_config[i].list; + break; + default: + c[i].value = temp_config[i].value; + break; + } + } + +cleanup: + free(temp_config); sbuf_delete(buf); } @@ -632,23 +724,84 @@ read_conf_file(const char *confpath, pkg return (0); } +static int +load_repositories(const char *repodir) +{ + struct dirent *ent; + DIR *d; + char *p; + size_t n; + char path[MAXPATHLEN]; + int ret; + + ret = 0; + + if ((d = opendir(repodir)) == NULL) + return (1); + + while ((ent = readdir(d))) { + /* Trim out 'repos'. */ + if ((n = strlen(ent->d_name)) <= 5) + continue; + p = &ent->d_name[n - 5]; + if (strcmp(p, ".conf") == 0) { + snprintf(path, sizeof(path), "%s%s%s", + repodir, + repodir[strlen(repodir) - 1] == '/' ? "" : "/", + ent->d_name); + if (access(path, F_OK) == 0 && + read_conf_file(path, CONFFILE_REPO)) { + ret = 1; + goto cleanup; + } + } + } + +cleanup: + closedir(d); + + return (ret); +} + int config_init(void) { - const char *val; + char *val; int i; const char *localbase; + char *env_list_item; char confpath[MAXPATHLEN]; + struct config_value *cv; char abi[BUFSIZ]; for (i = 0; i < CONFIG_SIZE; i++) { val = getenv(c[i].key); if (val != NULL) { - c[i].val = val; c[i].envset = true; + switch (c[i].type) { + case PKG_CONFIG_LIST: + /* Split up comma-separated items from env. */ + c[i].list = malloc(sizeof(*c[i].list)); + STAILQ_INIT(c[i].list); + for (env_list_item = strtok(val, ","); + env_list_item != NULL; + env_list_item = strtok(NULL, ",")) { + cv = + malloc(sizeof(struct config_value)); + cv->value = + strdup(env_list_item); + STAILQ_INSERT_TAIL(c[i].list, cv, + next); + } + break; + default: + c[i].val = val; + break; + } } } + /* Read LOCALBASE/etc/pkg.conf first. */ localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); @@ -657,10 +810,22 @@ config_init(void) CONFFILE_PKG)) goto finalize; - snprintf(confpath, sizeof(confpath), "/etc/pkg/FreeBSD.conf"); - if (access(confpath, F_OK) == 0 && read_conf_file(confpath, - CONFFILE_REPO)) - goto finalize; + /* Then read in all repos from REPOS_DIR list of directories. */ + if (c[REPOS_DIR].list == NULL) { + c[REPOS_DIR].list = malloc(sizeof(*c[REPOS_DIR].list)); + STAILQ_INIT(c[REPOS_DIR].list); + cv = malloc(sizeof(struct config_value)); + cv->value = strdup("/etc/pkg"); + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + cv = malloc(sizeof(struct config_value)); + if (asprintf(&cv->value, "%s/etc/pkg/repos", localbase) < 0) + goto finalize; + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + } + + STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) + if (load_repositories(cv->value)) + goto finalize; finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { @@ -704,10 +869,7 @@ config_bool(pkg_config_key k, bool *val) else value = c[k].val; - if (strcasecmp(value, "true") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "on") == 0 || - *value == '1') + if (boolstr_to_bool(value)) *val = true; return (0); Modified: releng/10.0/usr.sbin/pkg/config.h ============================================================================== --- releng/10.0/usr.sbin/pkg/config.h Thu Dec 19 12:33:24 2013 (r259613) +++ releng/10.0/usr.sbin/pkg/config.h Thu Dec 19 13:44:07 2013 (r259614) @@ -39,12 +39,14 @@ typedef enum { ASSUME_ALWAYS_YES, SIGNATURE_TYPE, FINGERPRINTS, + REPOS_DIR, CONFIG_SIZE } pkg_config_key; typedef enum { PKG_CONFIG_STRING=0, PKG_CONFIG_BOOL, + PKG_CONFIG_LIST, } pkg_config_t; typedef enum { Modified: releng/10.0/usr.sbin/pkg/pkg.7 ============================================================================== --- releng/10.0/usr.sbin/pkg/pkg.7 Thu Dec 19 12:33:24 2013 (r259613) +++ releng/10.0/usr.sbin/pkg/pkg.7 Thu Dec 19 13:44:07 2013 (r259614) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2013 +.Dd December 12, 2013 .Dt PKG 7 .Os .Sh NAME @@ -152,6 +152,7 @@ MIRROR_TYPE: "srv", SIGNATURE_TYPE: "none", FINGERPRINTS: "/usr/share/keys/pkg", ASSUME_ALWAYS_YES: "yes" +REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] .Ed .Pp Reference @@ -194,14 +195,20 @@ The URL that .Xr pkg 8 and other packages will be fetched from. +.It Ev REPOS_DIR +Comma-separated list of directories that should be searched for repository +configuration files. .El .Sh FILES Configuration is read from the files in the listed order. -The first enabled repository is the one used for bootstrapping +This path can be changed by setting +.Sy REPOS_DIR . +The last enabled repository is the one used for bootstrapping .Xr pkg 8 . .Bl -tag -width "/usr/local/etc/pkg/repos/*.conf" .It Pa /usr/local/etc/pkg.conf .It Pa /etc/pkg/FreeBSD.conf +.It Pa /usr/local/etc/pkg/repos/*.conf .El .Sh EXAMPLES Some examples are listed here. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 15:31:21 2013 Return-Path: Delivered-To: svn-src-all@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 6455022B; Thu, 19 Dec 2013 15:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5037E1ADD; Thu, 19 Dec 2013 15:31:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJFVLR7083115; Thu, 19 Dec 2013 15:31:21 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJFVKRf083112; Thu, 19 Dec 2013 15:31:20 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312191531.rBJFVKRf083112@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 19 Dec 2013 15:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259615 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 15:31:21 -0000 Author: ray Date: Thu Dec 19 15:31:20 2013 New Revision: 259615 URL: http://svnweb.freebsd.org/changeset/base/259615 Log: Enable mouse support for terminal clients (like dialog(1)). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_sysmouse.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt.h Thu Dec 19 15:31:20 2013 (r259615) @@ -412,7 +412,7 @@ int vtfont_load(vfnt_t *f, struct vt_f /* Sysmouse. */ void sysmouse_process_event(mouse_info_t *mi); #ifndef SC_NO_CUTPASTE -void vt_mouse_event(int type, int x, int y, int event, int cnt); +void vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel); void vt_mouse_state(int show); #endif #define VT_MOUSE_SHOW 1 Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt_core.c Thu Dec 19 15:31:20 2013 (r259615) @@ -1120,8 +1120,68 @@ finish_vt_acq(struct vt_window *vw) } #ifndef SC_NO_CUTPASTE +static void +vt_mouse_terminput_button(struct vt_device *vd, int button) +{ + struct vt_window *vw; + struct vt_font *vf; + char mouseb[6] = "\x1B[M"; + int i, x, y; + + vw = vd->vd_curwindow; + vf = vw->vw_font; + + /* Translate to char position. */ + x = vd->vd_mx / vf->vf_width; + y = vd->vd_my / vf->vf_height; + /* Avoid overflow. */ + x = MIN(x, 255 - '!'); + y = MIN(y, 255 - '!'); + + mouseb[3] = ' ' + button; + mouseb[4] = '!' + x; + mouseb[5] = '!' + y; + + for (i = 0; i < sizeof(mouseb); i++ ) + terminal_input_char(vw->vw_terminal, mouseb[i]); +} + +static void +vt_mouse_terminput(struct vt_device *vd, int type, int x, int y, int event, + int cnt) +{ + + switch (type) { + case MOUSE_BUTTON_EVENT: + if (cnt > 0) { + /* Mouse button pressed. */ + if (event & MOUSE_BUTTON1DOWN) + vt_mouse_terminput_button(vd, 0); + if (event & MOUSE_BUTTON2DOWN) + vt_mouse_terminput_button(vd, 1); + if (event & MOUSE_BUTTON3DOWN) + vt_mouse_terminput_button(vd, 2); + } else { + /* Mouse button released. */ + vt_mouse_terminput_button(vd, 3); + } + break; +#ifdef notyet + case MOUSE_MOTION_EVENT: + if (mouse->u.data.z < 0) { + /* Scroll up. */ + sc_mouse_input_button(vd, 64); + } else if (mouse->u.data.z > 0) { + /* Scroll down. */ + sc_mouse_input_button(vd, 65); + } + break; +#endif + } +} + void -vt_mouse_event(int type, int x, int y, int event, int cnt) +vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel) { struct vt_device *vd; struct vt_window *vw; @@ -1146,6 +1206,9 @@ vt_mouse_event(int type, int x, int y, i * under mouse pointer when nothing changed. */ + if (mlevel > 0) + vt_mouse_terminput(vd, type, x, y, event, cnt); + switch (type) { case MOUSE_ACTION: case MOUSE_MOTION_EVENT: Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Thu Dec 19 13:44:07 2013 (r259614) +++ head/sys/dev/vt/vt_sysmouse.c Thu Dec 19 15:31:20 2013 (r259615) @@ -192,7 +192,8 @@ sysmouse_process_event(mouse_info_t *mi) #ifndef SC_NO_CUTPASTE mtx_unlock(&sysmouse_lock); - vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value); + vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value, + sysmouse_level); return; #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 15:41:17 2013 Return-Path: Delivered-To: svn-src-all@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 ACE9B856; Thu, 19 Dec 2013 15:41:17 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4F61CC6; Thu, 19 Dec 2013 15:41:17 +0000 (UTC) Received: from [192.168.1.73] (254C556E.nat.pool.telekom.hu [37.76.85.110]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.7) with ESMTP id rBJFellg069324 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 07:41:08 -0800 (PST) (envelope-from julian@elischer.org) Message-ID: <52B3137A.4000805@elischer.org> Date: Thu, 19 Dec 2013 16:40:42 +0100 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John Baldwin , Mateusz Guzik Subject: Re: svn commit: r259407 - head/sys/kern References: <201312150411.rBF4Bhtg018852@svn.freebsd.org> <201312171141.49251.jhb@freebsd.org> <20131217181745.GB7535@dft-labs.eu> <201312171434.01345.jhb@freebsd.org> In-Reply-To: <201312171434.01345.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 15:41:17 -0000 On 12/17/13, 8:34 PM, John Baldwin wrote: > On Tuesday, December 17, 2013 1:17:45 pm Mateusz Guzik wrote: >> On Tue, Dec 17, 2013 at 11:41:49AM -0500, John Baldwin wrote: >>> On Saturday, December 14, 2013 11:11:43 pm Mateusz Guzik wrote: >>>> Author: mjg >>>> Date: Sun Dec 15 04:11:43 2013 >>>> New Revision: 259407 >>>> URL: http://svnweb.freebsd.org/changeset/base/259407 >>>> >>>> Log: >>>> proc exit: don't take PROC_LOCK while freeing rlimits >>>> >>>> Code wishing to check rlimits of some process should check whether it >>>> is exiting first, which current consumers do. >>> Does this measurably reduce contention? >>> >> No, this is just a cosmetic change I did while doing some other work >> with rlimits. >> >> It would use some more cosmetic work (e.g. no reason not to >> lim_free(p->plimit); p->p_limit = NULL) and maybe I'll get to that >> later unless this kind of stuff is unwanted. > I find it useful to leave the locking in place so it is clear that p_limit is > always written to with the lock held. If we ever got a static analyzer that > understood locking rules then leaving this locking in would reduce false > positives. When I first did locking for fields in struct proc I did it by > hand based on grepping the source tree for all uses of a field and ensuring > they were locked. I think it might be more confusing later on for another > reader to see unlocked access and then have to think about why that is safe. > leave the locks there but commented out with an explanatory comment. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 15:45:04 2013 Return-Path: Delivered-To: svn-src-all@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 91C0ABC6; Thu, 19 Dec 2013 15:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA851D0A; Thu, 19 Dec 2013 15:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJFj4GM087947; Thu, 19 Dec 2013 15:45:04 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJFj4xU087944; Thu, 19 Dec 2013 15:45:04 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201312191545.rBJFj4xU087944@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 19 Dec 2013 15:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259616 - releng/10.0/sys/ofed/drivers/net/mlx4 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 15:45:04 -0000 Author: alfred Date: Thu Dec 19 15:45:03 2013 New Revision: 259616 URL: http://svnweb.freebsd.org/changeset/base/259616 Log: Defer start/stop port to workqueues. MF10: r259608 Approved by: re Modified: releng/10.0/sys/ofed/drivers/net/mlx4/en_netdev.c releng/10.0/sys/ofed/drivers/net/mlx4/mlx4_en.h Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- releng/10.0/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Dec 19 15:31:20 2013 (r259615) +++ releng/10.0/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Dec 19 15:45:03 2013 (r259616) @@ -153,6 +153,19 @@ restart: return (i); } +static void mlx4_en_stop_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->stop_port_task); +} + +static void mlx4_en_start_port(struct net_device *dev) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + + queue_work(priv->mdev->workqueue, &priv->start_port_task); +} static void mlx4_en_set_multicast(struct net_device *dev) { @@ -473,6 +486,7 @@ static void mlx4_en_do_get_stats(struct queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); } + mlx4_en_QUERY_PORT(priv->mdev, priv->port); mutex_unlock(&mdev->state_lock); } @@ -498,8 +512,31 @@ static void mlx4_en_linkstate(struct wor mutex_unlock(&mdev->state_lock); } +static void mlx4_en_lock_and_stop_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + stop_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_stop_port(dev); + mutex_unlock(&mdev->state_lock); +} + +static void mlx4_en_lock_and_start_port(struct work_struct *work) +{ + struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, + start_port_task); + struct net_device *dev = priv->dev; + struct mlx4_en_dev *mdev = priv->mdev; + + mutex_lock(&mdev->state_lock); + mlx4_en_do_start_port(dev); + mutex_unlock(&mdev->state_lock); +} -int mlx4_en_start_port(struct net_device *dev) +int mlx4_en_do_start_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -691,7 +728,7 @@ cq_err: } -void mlx4_en_stop_port(struct net_device *dev) +void mlx4_en_do_stop_port(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -761,8 +798,8 @@ reset: mutex_lock(&mdev->state_lock); if (priv->port_up) { - mlx4_en_stop_port(dev); - if (mlx4_en_start_port(dev)) + mlx4_en_do_stop_port(dev); + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed restarting port %d\n", priv->port); } mutex_unlock(&mdev->state_lock); @@ -793,7 +830,7 @@ mlx4_en_init_locked(struct mlx4_en_priv dev = priv->dev; mdev = priv->mdev; if (dev->if_drv_flags & IFF_DRV_RUNNING) - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); if (!mdev->device_up) { en_err(priv, "Cannot open - device down/disabled\n"); @@ -816,7 +853,7 @@ mlx4_en_init_locked(struct mlx4_en_priv } mlx4_en_set_default_moderation(priv); - if (mlx4_en_start_port(dev)) + if (mlx4_en_do_start_port(dev)) en_err(priv, "Failed starting port:%d\n", priv->port); } @@ -905,7 +942,7 @@ void mlx4_en_destroy_netdev(struct net_d mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); mutex_lock(&mdev->state_lock); - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mutex_unlock(&mdev->state_lock); cancel_delayed_work(&priv->stats_task); @@ -925,7 +962,6 @@ void mlx4_en_destroy_netdev(struct net_d mtx_destroy(&priv->stats_lock.m); mtx_destroy(&priv->vlan_lock.m); - mtx_destroy(&priv->ioctl_lock.m); kfree(priv); if_free(dev); } @@ -951,9 +987,9 @@ static int mlx4_en_change_mtu(struct net * the port */ en_dbg(DRV, priv, "Change MTU called with card down!?\n"); } else { - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); mlx4_en_set_default_moderation(priv); - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) { en_err(priv, "Failed restarting port:%d\n", priv->port); @@ -973,8 +1009,13 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); + /* + * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a + * non-sleepable lock. + * I moved it to the periodic mlx4_en_do_get_stats. + if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) + return (active); + */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1078,7 +1119,6 @@ static int mlx4_en_ioctl(struct ifnet *d error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: - mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) mlx4_en_start_port(dev); @@ -1087,16 +1127,24 @@ static int mlx4_en_ioctl(struct ifnet *d } else { if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); - if_link_state_change(dev, LINK_STATE_DOWN); + if_link_state_change(dev, LINK_STATE_DOWN); + /* + * Since mlx4_en_stop_port is defered we + * have to wait till it's finished. + */ + for (int count=0; count<10; count++) { + if (dev->if_drv_flags & IFF_DRV_RUNNING) { + DELAY(20000); + } else { + break; + } + } } } - mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: - spin_lock(&priv->ioctl_lock); mlx4_en_set_multicast(dev); - spin_unlock(&priv->ioctl_lock); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: @@ -1153,7 +1201,7 @@ static int mlx4_en_set_ring_size(struct mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(dev); + mlx4_en_do_stop_port(dev); } mlx4_en_free_resources(priv); priv->prof->tx_ring_size = tx_size; @@ -1164,7 +1212,7 @@ static int mlx4_en_set_ring_size(struct goto out; } if (port_up) { - err = mlx4_en_start_port(dev); + err = mlx4_en_do_start_port(dev); if (err) en_err(priv, "Failed starting port\n"); } @@ -1256,7 +1304,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN mutex_lock(&mdev->state_lock); if (priv->port_up) { port_up = 1; - mlx4_en_stop_port(priv->dev); + mlx4_en_do_stop_port(priv->dev); } mlx4_en_free_resources(priv); priv->tx_ring_num = tx_ring_num; @@ -1265,7 +1313,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HAN if (error) en_err(priv, "Failed reallocating port resources\n"); if (error == 0 && port_up) { - error = -mlx4_en_start_port(priv->dev); + error = -mlx4_en_do_start_port(priv->dev); if (error) en_err(priv, "Failed starting port\n"); } @@ -1517,8 +1565,9 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->msg_enable = MLX4_EN_MSG_LEVEL; priv->ip_reasm = priv->mdev->profile.ip_reasm; mtx_init(&priv->stats_lock.m, "mlx4 stats", NULL, MTX_DEF); - mtx_init(&priv->ioctl_lock.m, "mlx4 ioctl", NULL, MTX_DEF); mtx_init(&priv->vlan_lock.m, "mlx4 vlan", NULL, MTX_DEF); + INIT_WORK(&priv->start_port_task, mlx4_en_lock_and_start_port); + INIT_WORK(&priv->stop_port_task, mlx4_en_lock_and_stop_port); INIT_WORK(&priv->mcast_task, mlx4_en_do_set_multicast); INIT_WORK(&priv->watchdog_task, mlx4_en_restart); INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate); Modified: releng/10.0/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- releng/10.0/sys/ofed/drivers/net/mlx4/mlx4_en.h Thu Dec 19 15:31:20 2013 (r259615) +++ releng/10.0/sys/ofed/drivers/net/mlx4/mlx4_en.h Thu Dec 19 15:45:03 2013 (r259616) @@ -493,7 +493,6 @@ struct mlx4_en_priv { spinlock_t vlan_lock; struct mlx4_en_port_state port_state; spinlock_t stats_lock; - spinlock_t ioctl_lock; unsigned long last_moder_packets[MAX_RX_RINGS]; unsigned long last_moder_tx_packets; @@ -546,6 +545,8 @@ struct mlx4_en_priv { struct mlx4_en_cq rx_cq[MAX_RX_RINGS]; struct mlx4_en_tx_hash_entry tx_hash[MLX4_EN_TX_HASH_SIZE]; struct work_struct mcast_task; + struct work_struct start_port_task; + struct work_struct stop_port_task; struct work_struct watchdog_task; struct work_struct linkstate_task; struct delayed_work stats_task; @@ -580,8 +581,8 @@ void mlx4_en_destroy_netdev(struct net_d int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, struct mlx4_en_port_profile *prof); -int mlx4_en_start_port(struct net_device *dev); -void mlx4_en_stop_port(struct net_device *dev); +int mlx4_en_do_start_port(struct net_device *dev); +void mlx4_en_do_stop_port(struct net_device *dev); void mlx4_en_free_resources(struct mlx4_en_priv *priv); int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 17:01:13 2013 Return-Path: Delivered-To: svn-src-all@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 8EB50640 for ; Thu, 19 Dec 2013 17:01:13 +0000 (UTC) Received: from nm31.bullet.mail.ir2.yahoo.com (nm31.bullet.mail.ir2.yahoo.com [212.82.96.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB8FC1356 for ; Thu, 19 Dec 2013 17:01:12 +0000 (UTC) Received: from [212.82.98.125] by nm31.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 Received: from [46.228.39.95] by tm18.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 Received: from [127.0.0.1] by smtp132.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 17:01:02 -0000 X-Yahoo-Newman-Id: 678763.25012.bm@smtp132.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kt4LMN0VM1k7EeEP4RrEdMGKGubpuhRCMc5Uz10iIIYezvj G2kVjRv72BWBWB1.7tvGNWwNKTEboW4idJywY_TXUdxBi8ukAkOUU0cg9aSL QStw3m15Xc46fHc55yIuUHHe0ot6Mzg.8TND_uZShyqosn39SldT1ssjdxHB KBiJqRbzKr38Pi5OBkQ_5ns6K00yjJruMyZ3rvCoQggD.Ls42o1pDG8iyHDl Fzj9IWQQA5utxE43yDp5brQt0atQ5.Jan3V3FBb8Y2B2njpLZ6cqtUSJtXwI WGi564IuRJQMSU4sLedU5rTgGhGQtgfPTWbJo0kTuJLQBTTDWkZ8FYgI94l. lrxTVnmkjIfKdKOHjRFkpSOAlL1hJvecG3XcjWj32Z18ikwsmNF_s.CSOKcb mlhhsBKGqMxQYs10deyKq_AB5fZSFET0pSEkRntXo.u_m6LukJGWOYJDOgyO 45mfK5bs54Oz8F6j7Qm6n6L9Y.LVYVJv53b20xw9T6F2Y26lrvMSRwzk8mQE vqlilQyXOZBq_Hz2Ugd.rGhpAf60X3w-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.11] (se@84.154.112.54 with plain [188.125.69.59]) by smtp132.mail.ir2.yahoo.com with SMTP; 19 Dec 2013 17:01:02 +0000 UTC Message-ID: <52B32647.2030008@freebsd.org> Date: Thu, 19 Dec 2013 18:00:55 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Bruce Evans , Stefan Esser Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> In-Reply-To: <20131219204903.V24189@besplex.bde.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 17:01:13 -0000 Am 19.12.2013 11:49, schrieb Bruce Evans: > On Thu, 19 Dec 2013, Stefan Esser wrote: > >> Log: >> Fix overflow for timeout values of more than 68 years, which is the >> maximum >> covered by sbintime (LONG_MAX seconds). > > Not LONG_MAX seconds, but INT32_MAX seconds. LONG_MAX seconds is about > 2**32 > times larger on 64-bit arches. Hi Bruce, yes, you are of course correct ... The limit is 2^31-2^-32 seconds, to be exact ;-) This is represented by LONG_MAX in sbintime, which made me use that wrong constant in the commit message. > sbintimes and their complexity give many more possibilities for overflow. > I thought that the new overflow bugs and some old ones were already fixed. > >> Some programs use timeout values in excess of 1000 years. The conversion >> to sbintime caused wrap-around on overflow, which resulted in short or >> negative timeout values. This caused long delays on sockets opened by >> affected programs (e.g. OpenSSH). >> >> Kernels compiled without -fno-strict-overflow were not affected, >> apparently >> because the compiler tested the sign of the timeout value before >> performing >> the multiplication that lead to overflow. > > I think it just gave a garbage value that was accidentally less harmful. The result of the multiplication was performed modulo 2^64 due to the limited range of the operation. The result was then interpreted as a signed 64 bit 2s-complement number. The factor 2^32/1000 is 0x418937, which multiplied with a round decimal number over 1000*2^32 will result in "random" bit sequence in the resulting sbintime. Half the values will have been positive, and many will have corresponded to substantial timeout values, but some will have been very low, resulting in unexpectedly low timeouts. >> When the -fno-strict-overflow option was added to CFLAGS, this >> optimization >> was disabled and the test was performed on the result of the >> multiplication. >> Negative products were caught and resulted in EINVAL being returned, but >> wrap-around to positive values just shortened the timeout value to the >> residue of the result that could be represented by sbintime. > > This shows one reason why -fno-strict-overflow shouldn't be used. It just > wastes time to give different undefined behaviour with undocumented > details. Well, I thought so when I found the cause of the breakage (long delays opening TCP connections) that were the result of the compilation with -fno-strict-overflow. But I reconsidered, because a real bug in the code has been identied, this way. The bug existed, without being detected (because too short but non-zero timeout values were caught at the application layer, which just re-issued the call with the remaining time as timeout parameter). If applications didn't have to worry about short timeouts for other reasons, then this bug would have led to observable problems, even with -fno-strict-overflow. >> The fix is to cap the timeout values at the maximum that can be >> represented >> by sbintime, which is 2^31 - 1 seconds or more than 68 years. > > 2^31 - 1 is a correct spelling of INT32_MAX, unlike LONG_MAX. Yes, sbintime is defined in units of 2^-32 seconds, which makes the highest representable time exactly (2^31 - 2^-32) seconds. This value is represented by LLONG_MAX units of 2^32 seconds ... >> After this change, the kernel can be compiled with -fno-strict-overflow >> with no ill effects. > >> Modified: head/sys/kern/kern_event.c >> ============================================================================== >> >> --- head/sys/kern/kern_event.c Thu Dec 19 07:33:07 2013 (r259608) >> +++ head/sys/kern/kern_event.c Thu Dec 19 09:01:46 2013 (r259609) >> @@ -526,7 +526,8 @@ knote_fork(struct knlist *list, int pid) >> static __inline sbintime_t >> timer2sbintime(intptr_t data) >> { >> - >> + if (data > LLONG_MAX / SBT_1MS) >> + return LLONG_MAX; >> return (SBT_1MS * data); >> } > > This has the following style bugs: > - it removes the empty line after the (null) declarations > - it is missing parentheses around the return value > - it uses the long long abomination Ughh, I'll fix the style bugs ... It had taken me several hours over the last week to find this bug, and I committed the fix that worked on my system without making it compliant with FreeBSD style. Sorry for that ... > This has the following type errors: > - using the long long abomination is not just a style bug. sbintime_t has > type int64_t, not long long. The overflow check will break if long long > becomes longer than int64_t The definition of sbintime is int64_t on all architectures. If any architecture used a wider integer type for sbintime, the fix would just limit the maximum timeout to 68 years (instead of many magnitudes longer than the universe will last), which is still way beyond any sensible timeout value. And functions will have to check for too short timeouts to be robust, anyway. The functions in kern_timeout.c heavily depend on sbintime having at least 64 bits and perform calculations under the assumption, that no value above INT64_MAX can be passed as sbintime. So, even if there was a wider sbintime, the highest value supported was still represented by INT64_MAX. > - returning LLONG_MAX is usually just a style bug. When long long is > longer > than int64_t, the return value will overflow, but the > implementation-defined > behaviour for this is usually to convert it to the correct value. Yes, it was a silly mistake to use LLONG_MAX, even though it is identical to INT64_MAX on all architectures currently supported by FreeBSD. > INT64_MAX is a dangerous default maximum timeout. You can't even add the > minimum sbintime_t of 2**-32 seconds to this without overflowing. The function timer2sbintime is used in only two places in the kernel, one being filt_timerattach(), which caused the kernel breakage, the other with a constant timeout of 0. No further additions are ever performed on the value, so there is no risk of overflow. The function is declared "static inline", and will therefore not be called from outside of this source file. > Old timeout code used the following method to reduce the problem of > overflowing timeouts: > For alarm() and setitimer(), limit the timeout to 100 million seconds > (3.17 years) and return EINVAL if it is too large. This works with > 32-bit time_t until about 2035. POSIX doesn't allow this. Clamping > the time to 100 million seconds isn't allowed either, since the > residual time can be seen from applications. Note that 64-bit time_t > has little effect on this problem. Uses wishing to overflow the kernel > simply ask for a timeout in a timeval of INT64_MAX seconds plus 999999 > seconds so that adding just 1 microseconds to it overflow. With > seconds in sbintime_t instead of in time_t, overflow occurs much > sooner. The brokenness of the kernel compiled with -fno-strict-overflow was due to EINVAL being returned to callers of filt_timerattach(), which apparently did not check that return code (or at least endlessly retried with the same invalid timeout parameter). > This is quite broken now: > - the limit of 100000000 used to be enforced in itimerfix(), but this was > removed in connection with implementing POSIX realtime timers without > even breaking the documentaion to match or touching PR(s) about the > POSIX non-conformance of the limit. > - setitimer() mostly uses sbintimes now, so the old limit is irrelevant > and enforcing it in itimerfix() would break the new sbintime code and > presumably the not so new realtime timers code. The sbintime code > uses a modified limit that is also not allowed by POSIX. This limit is > of course undocumented. It is INT32_MAX / 2, so that there is plenty > of room for expansion. This is what the above should use, modulo the > conformance bug. EINVAL is returned when this limit is exceeded. Are you sure about the limit of INT32_MAX / 2 (i.e. 2^30 -1) seconds? My reading is that sbintime = INT64_MAX represents (2^31-2^-32) seconds, and that this value is correctly treated in the timeout code. It is possible to pass values of more than 2^31 seconds to setitimer() on architectures where time_t is defined as int64_t. There are no tests for overflow in tvtosbt() in /sys/sys/time.h. > - select() and poll() were more careful and seem to be correct now. > The timeout in poll() is limited to INT_MAX milliseconds, so it fits > in sbintime_t. Except this assumes that int is 32 bits. select() > limits the timeout to INT32_MAX seconds so that it is representable > as an sbintime_t and then does a further overflow check involving > INT64_MAX. When overflow would occur, it sets asbt to -1, which I > think means an infinite timeout. I don't like this. -1 is a tiny > amount less than 0, not near plus infinity. > - nanosleep() used to be less careful than select() and poll(), but seems > to have been fixed. For some reason, it uses a mixture of the above > methods. It limits sleep times to INT32_MAX / 2 seconds but repeats > the sleep as necessary so as not to return an error. The logic for > this is subtle and I haven't checked it. I just looked at nanosleep() and have to admit, that I do not fully understand its semantics. A tv_nsec value < 0 or > 10^9 results in EINVAL, while a negative tv_sec is silently treated as 0. If a timeout of 2^30 seconds or more is requested, the sleep time is limited to 2^30 - 1 seconds, but the difference is returned in the timespec value pointed to by the optional return value pointer (if present). That value may thus be non-zero, even if the function had returned 0 (indicating that the timeout has occured). At least for the case of tv_sec in the range of 2^30 to 2^31-1, the caller will assume that the full time has elapsed, while in fact only 2^30 seconds have passed and the call should be repeated with the remaining sleep time returned in rmtp ... > davide@ has patches related to fixing this, but none seem to have been > committed yet, except some old ones that gave some of the above overflow > checking. Thanks for the detailed information and sorry about the style violation. I'll fix it, if consensus is reached about the correct style. I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the missing empty line: static __inline sbintime_t timer2sbintime(intptr_t data) { if (data > INT64_MAX / SBT_1MS) return INT64_MAX; return (SBT_1MS * data); } If you can show evidence that a limit of INT64_MAX/2 is more appropriate (2^30 seconds or 34 years), the limit could be of course be reduced to that value. I could not find any code that would not tolerate INT64_MAX, though ... Regards, STefan From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 17:24:22 2013 Return-Path: Delivered-To: svn-src-all@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 9AC18C63; Thu, 19 Dec 2013 17:24:22 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2111569; Thu, 19 Dec 2013 17:24:21 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBJHOKGn041823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 09:24:21 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBJHOKUL041822; Thu, 19 Dec 2013 09:24:20 -0800 (PST) (envelope-from jmg) Date: Thu, 19 Dec 2013 09:24:20 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131219172420.GS99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <20131218184512.GM99167@funkthat.com> <52B2009E.1060905@FreeBSD.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131219115735.GN29088@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 19 Dec 2013 09:24:21 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Alexander V. Chernikov" , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 17:24:22 -0000 Gleb Smirnoff wrote this message on Thu, Dec 19, 2013 at 15:57 +0400: > On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: > J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > J> > On 18.12.2013 22:45, John-Mark Gurney wrote: > J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > J> > >> Author: melifaro > J> > >> Date: Wed Dec 18 18:25:27 2013 > J> > >> New Revision: 259562 > J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > J> > >> > J> > >> Log: > J> > >> Switch netstat -rn to use standard API for retrieving list of routes > J> > >> instead of peeking inside in-kernel radix via kget. > J> > >> This permits us to change kernel structures without breaking userland. > J> > >> Additionally, this change provide more reliable and faster output. > J> > >> > J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > J> > >> for other families) were removed. `Refs` is radix-specific thing > J> > >> which is not informative for users. `Use` field value is handy sometimes, > J> > >> but a) current API does not support it and b) I'm not sure we will > J> > >> support per-rte pcpu counters in near future. > J> > >> > J> > >> Old method of retrieving data is still supported (either by defining > J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > J> > >> hidden. > J> > >> > J> > >> Sponsored by: Yandex LLC > J> > >> MFC after: 4 weeks > J> > >> PR: kern/167204 > J> > > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > J> > > this change make it not usable, or will you still automatically use > J> > Well. It will probably break in (maybe, near) future. > J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's > J> fine if kvm mode is fragile and requires the binary to be in sync with the > J> kernel and is only used for crash dumps, but it is very useful to extract > J> all sorts of info out of a crash dump. > > The problem is that these tools (netstat, and some others) prevent us from > improving the kernel network stack. We can't make improvements that are > mergeable to stable/x branch, since the tools would be broken. Moreover > any improvement in head/, requires from developer additional work in netstat > code, which I must admit isn't a pleasure to work with. And any improvement > in head adds additional incompatibility between newer kernel and older world, > which is of course allowed in CURRENT, but still we'd prefer to reduce number > of such events. I've thought about this issue a bit, and I realized that w/ ctf (from dtrace) that we could make netstat and related tools be able to understand what fields are available, even w/ older/different kernels... It does mean we'd have to be careful not to repurpose struct names, but that shouldn't be too hard... I haven't been happy w/ reading raw structs, but w/ ctf, there would be "meaning" behind the data... We could even add a SYSCTL_ that prepends the data w/ the CTF data and the tool could support both methods... > I agree that usage of tools on vmcores is useful. But we all should agree that > it has very limited use. Only kernel hackers and developers are expected to > do this. However, speaking of myself, I was never interested in routing table > from a vmcore neither interface statistics, when fixing a bug in networking stack, > and I've fixed quite a lot of them. Still, I believe, that some developers find > this useful. > > My suggestion is that all this code is deleted from src/usr.bin/netstat, and > moved to src/tools, and we relax assertion that src/tools must be compatible > with any kernel within the branch. So, any person who wants this functionality, > needs to keep his src/tools in sync with kernel and compile a tool when he > desires to dump routing table from a vmcore. Having recently debugged a kernel issue, it was very nice that tools like dmesg could operate on a core... > Finally, when we remove all the kvm(3) usage from a tool, then we can remove > the sugid bit from it, which would be a another fine point. Which is a good thing, but shouldn't need to remove the kvm access.. We have dual kvm/sysctl access for most things in the kernel... Once a tool has completed sysctl access for all data it needs, why would it need the sgid bit? I will admit, I've never liked having dual access... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 17:29:57 2013 Return-Path: Delivered-To: svn-src-all@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 800FAF25; Thu, 19 Dec 2013 17:29:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ACAC15B6; Thu, 19 Dec 2013 17:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJHTvrx025183; Thu, 19 Dec 2013 17:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJHTvAG025181; Thu, 19 Dec 2013 17:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312191729.rBJHTvAG025181@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 19 Dec 2013 17:29:57 +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: r259617 - in stable/9/sys: mips/include powerpc/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 17:29:57 -0000 Author: pluknet Date: Thu Dec 19 17:29:56 2013 New Revision: 259617 URL: http://svnweb.freebsd.org/changeset/base/259617 Log: MFC r255194 and prerequisites r229494,229496: Introduce internal macros for __U/INT64_C to define the U/INT64_MAX/MIN values properly. The previous definition only worked if __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS were defined at the same time. Newer versions of gcc define __INT64_C and __UINT64_C, so avoid redefining them if gcc provides them. Applying r255194 fixes stable/9 host to allow source upgrading to the newer versions with usr.bin/dtc included in bootstrap tools. Approved by: imp (MFC to stable/9) Modified: stable/9/sys/mips/include/_stdint.h stable/9/sys/powerpc/include/_stdint.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/mips/include/_stdint.h ============================================================================== --- stable/9/sys/mips/include/_stdint.h Thu Dec 19 15:45:03 2013 (r259616) +++ stable/9/sys/mips/include/_stdint.h Thu Dec 19 17:29:56 2013 (r259617) @@ -66,6 +66,16 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef __INT64_C +#ifdef __mips_n64 +#define __INT64_C(c) (c ## L) +#define __UINT64_C(c) (c ## UL) +#else +#define __INT64_C(c) (c ## LL) +#define __UINT64_C(c) (c ## ULL) +#endif +#endif + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -74,19 +84,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) +#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INT64_C(0x7fffffffffffffff) +#define INT64_MAX __INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 Modified: stable/9/sys/powerpc/include/_stdint.h ============================================================================== --- stable/9/sys/powerpc/include/_stdint.h Thu Dec 19 15:45:03 2013 (r259616) +++ stable/9/sys/powerpc/include/_stdint.h Thu Dec 19 17:29:56 2013 (r259617) @@ -65,6 +65,16 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef __INT64_C +#ifdef __LP64__ +#define __INT64_C(c) (c ## L) +#define __UINT64_C(c) (c ## UL) +#else +#define __INT64_C(c) (c ## LL) +#define __UINT64_C(c) (c ## ULL) +#endif +#endif + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -73,19 +83,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) +#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INT64_C(0x7fffffffffffffff) +#define INT64_MAX __INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 18:06:53 2013 Return-Path: Delivered-To: svn-src-all@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 8F886C5F; Thu, 19 Dec 2013 18:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 602AB188A; Thu, 19 Dec 2013 18:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJI6rEm039754; Thu, 19 Dec 2013 18:06:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJI6qnU039748; Thu, 19 Dec 2013 18:06:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312191806.rBJI6qnU039748@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Dec 2013 18:06: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: r259618 - stable/9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 18:06:53 -0000 Author: imp Date: Thu Dec 19 18:06:52 2013 New Revision: 259618 URL: http://svnweb.freebsd.org/changeset/base/259618 Log: Improve compatibility with earlier parts of the 9 branch by defaulting to MK_CLANG_IS_CC is no when it isn't otherwise defined. Also, bsd.compiler.mk wasn't present in 9.0, so don't require it. With these changes, you can compile a tip of 9.x kernel and modules old-school on a 9.0 system. # Direct commit since this isn't relevant to 10 or current. Modified: stable/9/sys/conf/kern.mk stable/9/sys/conf/kern.pre.mk stable/9/sys/conf/kmod.mk Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Thu Dec 19 17:29:56 2013 (r259617) +++ stable/9/sys/conf/kern.mk Thu Dec 19 18:06:52 2013 (r259618) @@ -8,6 +8,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn -Wundef -Wno-pointer-sign -fformat-extensions \ -Wmissing-include-dirs -fdiagnostics-show-option \ ${CWARNEXTRA} +MK_CLANG_IS_CC ?= no # # The following flags are next up for working on: # -Wextra Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Thu Dec 19 17:29:56 2013 (r259617) +++ stable/9/sys/conf/kern.pre.mk Thu Dec 19 18:06:52 2013 (r259618) @@ -4,10 +4,11 @@ # of the definitions that need to be before %BEFORE_DEPEND. .include -.include +.sinclude # backwards compat option for older systems. MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} +COMPILER_TYPE?="gcc" # Can be overridden by makeoptions or /etc/make.conf KERNEL_KO?= kernel Modified: stable/9/sys/conf/kmod.mk ============================================================================== --- stable/9/sys/conf/kmod.mk Thu Dec 19 17:29:56 2013 (r259617) +++ stable/9/sys/conf/kmod.mk Thu Dec 19 18:06:52 2013 (r259618) @@ -73,10 +73,15 @@ OBJCOPY?= objcopy .endif .include -.include +.sinclude + +# backwards compat option for older systems. +COMPILER_TYPE?="gcc" .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S +MK_CLANG_IS_CC ?= no + # amd64 and mips use direct linking for kmod, all others use shared binaries .if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips __KLD_SHARED=yes From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 18:27:36 2013 Return-Path: Delivered-To: svn-src-all@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 9356F370; Thu, 19 Dec 2013 18:27:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD1A1A4E; Thu, 19 Dec 2013 18:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJIRagN047332; Thu, 19 Dec 2013 18:27:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJIRWPc047314; Thu, 19 Dec 2013 18:27:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312191827.rBJIRWPc047314@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Dec 2013 18:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259619 - in head/contrib/gcc: . cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 18:27:36 -0000 Author: pfg Date: Thu Dec 19 18:27:32 2013 New Revision: 259619 URL: http://svnweb.freebsd.org/changeset/base/259619 Log: gcc: backport upstream fix for issue with C++'s placement new Fixes GCC libstdc++/29286 Obtained from: gcc 4.3 (rev. 125603, 125653; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/init.c head/contrib/gcc/doc/c-tree.texi head/contrib/gcc/expr.c head/contrib/gcc/gimple-low.c head/contrib/gcc/gimplify.c head/contrib/gcc/omp-low.c head/contrib/gcc/print-tree.c head/contrib/gcc/tree-gimple.c head/contrib/gcc/tree-inline.c head/contrib/gcc/tree-pretty-print.c head/contrib/gcc/tree-ssa-alias.c head/contrib/gcc/tree-ssa-dce.c head/contrib/gcc/tree-ssa-operands.c head/contrib/gcc/tree-ssa-structalias.c head/contrib/gcc/tree.def head/contrib/gcc/tree.h Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/ChangeLog.gcc43 Thu Dec 19 18:27:32 2013 (r259619) @@ -65,6 +65,48 @@ fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. +2007-06-12 Ian Lance Taylor (r125653) + Daniel Berlin + + PR libstdc++/29286 + * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR. + * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define. + (CHANGE_DYNAMIC_TYPE_LOCATION): Define. + (DECL_NO_TBAA_P): Define. + (struct tree_decl_common): Add no_tbaa_flag field. + * tree-ssa-structalias.c (struct variable_info): Add + no_tbaa_pruning field. + (new_var_info): Initialize no_tbaa_pruning field. + (unify_nodes): Copy no_tbaa_pruning field. + (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR. + (dump_solution_for_var): Print no_tbaa_pruning flag. + (set_uids_in_ptset): Add no_tbaa_pruning parameter. Change all + callers. + (compute_tbaa_pruning): New static function. + (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes. + Call compute_tbaa_pruning. + * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers. + * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR. + * gimple-low.c (lower_stmt): Likewise. + * tree-gimple.c (is_gimple_stmt): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. + * tree-inline.c (estimate_num_insns_1): Likewise. + (copy_result_decl_to_var): Likewise. + * expr.c (expand_expr_real_1): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag. + * omp-low.c (omp_copy_decl_2): Likewise. + * print-tree.c (print_node): Print DECL_NO_TBAA_P flag. + * doc/c-tree.texi (Expression trees): Document + CHANGE_DYNAMIC_TYPE_EXPR. + +2007-06-09 Daniel Berlin (r125603) + + * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd + parameter, use it. + (find_what_p_points_to): Pass new parameter to set_uids_in_ptset. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Thu Dec 19 18:27:32 2013 (r259619) @@ -25,6 +25,12 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. +2007-06-12 Ian Lance Taylor (r125653) + + PR libstdc++/29286 + * init.c (avoid_placement_new_aliasing): New static function. + (build_new_1): Call it. + 2007-05-31 Daniel Berlin (r125239) * typeck.c (build_binary_op): Include types in error. Modified: head/contrib/gcc/cp/init.c ============================================================================== --- head/contrib/gcc/cp/init.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/cp/init.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,6 +1,7 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1564,6 +1565,55 @@ build_raw_new_expr (tree placement, tree return new_expr; } +/* Make sure that there are no aliasing issues with T, a placement new + expression applied to PLACEMENT, by recording the change in dynamic + type. If placement new is inlined, as it is with libstdc++, and if + the type of the placement new differs from the type of the + placement location itself, then alias analysis may think it is OK + to interchange writes to the location from before the placement new + and from after the placement new. We have to prevent type-based + alias analysis from applying. PLACEMENT may be NULL, which means + that we couldn't capture it in a temporary variable, in which case + we use a memory clobber. */ + +static tree +avoid_placement_new_aliasing (tree t, tree placement) +{ + tree type_change; + + if (processing_template_decl) + return t; + + /* If we are not using type based aliasing, we don't have to do + anything. */ + if (!flag_strict_aliasing) + return t; + + /* If we have a pointer and a location, record the change in dynamic + type. Otherwise we need a general memory clobber. */ + if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE + && placement != NULL_TREE + && TREE_CODE (TREE_TYPE (placement)) == POINTER_TYPE) + type_change = build_stmt (CHANGE_DYNAMIC_TYPE_EXPR, + TREE_TYPE (t), + placement); + else + { + /* Build a memory clobber. */ + type_change = build_stmt (ASM_EXPR, + build_string (0, ""), + NULL_TREE, + NULL_TREE, + tree_cons (NULL_TREE, + build_string (6, "memory"), + NULL_TREE)); + + ASM_VOLATILE_P (type_change) = 1; + } + + return build2 (COMPOUND_EXPR, TREE_TYPE (t), type_change, t); +} + /* Generate code for a new-expression, including calling the "operator new" function, initializing the object, and, if an exception occurs during construction, cleaning up. The arguments are as for @@ -1607,6 +1657,7 @@ build_new_1 (tree placement, tree type, beginning of the storage allocated for an array-new expression in order to store the number of elements. */ tree cookie_size = NULL_TREE; + tree placement_var; /* True if the function we are calling is a placement allocation function. */ bool placement_allocation_fn_p; @@ -1700,6 +1751,20 @@ build_new_1 (tree placement, tree type, alloc_fn = NULL_TREE; + /* If PLACEMENT is a simple pointer type, then copy it into + PLACEMENT_VAR. */ + if (processing_template_decl + || placement == NULL_TREE + || TREE_CHAIN (placement) != NULL_TREE + || TREE_CODE (TREE_TYPE (TREE_VALUE (placement))) != POINTER_TYPE) + placement_var = NULL_TREE; + else + { + placement_var = get_temp_regvar (TREE_TYPE (TREE_VALUE (placement)), + TREE_VALUE (placement)); + placement = tree_cons (NULL_TREE, placement_var, NULL_TREE); + } + /* Allocate the object. */ if (! placement && TYPE_FOR_JAVA (elt_type)) { @@ -1792,7 +1857,12 @@ build_new_1 (tree placement, tree type, /* In the simple case, we can stop now. */ pointer_type = build_pointer_type (type); if (!cookie_size && !is_initialized) - return build_nop (pointer_type, alloc_call); + { + rval = build_nop (pointer_type, alloc_call); + if (placement != NULL) + rval = avoid_placement_new_aliasing (rval, placement_var); + return rval; + } /* While we're working, use a pointer to the type we've actually allocated. Store the result of the call in a variable so that we @@ -2051,6 +2121,9 @@ build_new_1 (tree placement, tree type, /* A new-expression is never an lvalue. */ gcc_assert (!lvalue_p (rval)); + if (placement != NULL) + rval = avoid_placement_new_aliasing (rval, placement_var); + return rval; } Modified: head/contrib/gcc/doc/c-tree.texi ============================================================================== --- head/contrib/gcc/doc/c-tree.texi Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/doc/c-tree.texi Thu Dec 19 18:27:32 2013 (r259619) @@ -1916,6 +1916,7 @@ This macro returns the attributes on the @tindex TARGET_EXPR @tindex AGGR_INIT_EXPR @tindex VA_ARG_EXPR +@tindex CHANGE_DYNAMIC_TYPE_EXPR @tindex OMP_PARALLEL @tindex OMP_FOR @tindex OMP_SECTIONS @@ -2572,6 +2573,13 @@ mechanism. It represents expressions li Its @code{TREE_TYPE} yields the tree representation for @code{type} and its sole argument yields the representation for @code{ap}. +@item CHANGE_DYNAMIC_TYPE_EXPR +Indicates the special aliasing required by C++ placement new. It has +two operands: a type and a location. It means that the dynamic type +of the location is changing to be the specified type. The alias +analysis code takes this into account when doing type based alias +analysis. + @item OMP_PARALLEL Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/expr.c Thu Dec 19 18:27:32 2013 (r259619) @@ -8718,6 +8718,13 @@ expand_expr_real_1 (tree exp, rtx target /* Lowered by gimplify.c. */ gcc_unreachable (); + case CHANGE_DYNAMIC_TYPE_EXPR: + /* This is ignored at the RTL level. The tree level set + DECL_POINTER_ALIAS_SET of any variable to be 0, which is + overkill for the RTL layer but is all that we can + represent. */ + return const0_rtx; + case EXC_PTR_EXPR: return get_exception_pointer (cfun); Modified: head/contrib/gcc/gimple-low.c ============================================================================== --- head/contrib/gcc/gimple-low.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/gimple-low.c Thu Dec 19 18:27:32 2013 (r259619) @@ -243,6 +243,7 @@ lower_stmt (tree_stmt_iterator *tsi, str case GOTO_EXPR: case LABEL_EXPR: case SWITCH_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: case OMP_FOR: case OMP_SECTIONS: case OMP_SECTION: Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/gimplify.c Thu Dec 19 18:27:32 2013 (r259619) @@ -5748,6 +5748,11 @@ gimplify_expr (tree *expr_p, tree *pre_p ret = GS_ALL_DONE; break; + case CHANGE_DYNAMIC_TYPE_EXPR: + ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p), + pre_p, post_p, is_gimple_reg, fb_lvalue); + break; + case OBJ_TYPE_REF: { enum gimplify_status r0, r1; Modified: head/contrib/gcc/omp-low.c ============================================================================== --- head/contrib/gcc/omp-low.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/omp-low.c Thu Dec 19 18:27:32 2013 (r259619) @@ -518,6 +518,7 @@ omp_copy_decl_2 (tree var, tree name, tr TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (var); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (var); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (var); DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); DECL_IGNORED_P (copy) = DECL_IGNORED_P (var); TREE_USED (copy) = 1; Modified: head/contrib/gcc/print-tree.c ============================================================================== --- head/contrib/gcc/print-tree.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/print-tree.c Thu Dec 19 18:27:32 2013 (r259619) @@ -401,7 +401,9 @@ print_node (FILE *file, const char *pref if (DECL_VIRTUAL_P (node)) fputs (" virtual", file); if (DECL_PRESERVE_P (node)) - fputs (" preserve", file); + fputs (" preserve", file); + if (DECL_NO_TBAA_P (node)) + fputs (" no-tbaa", file); if (DECL_LANG_FLAG_0 (node)) fputs (" decl_0", file); if (DECL_LANG_FLAG_1 (node)) Modified: head/contrib/gcc/tree-gimple.c ============================================================================== --- head/contrib/gcc/tree-gimple.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-gimple.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,6 @@ /* Functions to analyze and validate GIMPLE trees. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Diego Novillo Rewritten by Jason Merrill @@ -215,6 +216,7 @@ is_gimple_stmt (tree t) case TRY_FINALLY_EXPR: case EH_FILTER_EXPR: case CATCH_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: case ASM_EXPR: case RESX_EXPR: case PHI_NODE: Modified: head/contrib/gcc/tree-inline.c ============================================================================== --- head/contrib/gcc/tree-inline.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-inline.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1649,6 +1649,11 @@ estimate_num_insns_1 (tree *tp, int *wal *walk_subtrees = 0; return NULL; + /* CHANGE_DYNAMIC_TYPE_EXPR explicitly expands to nothing. */ + case CHANGE_DYNAMIC_TYPE_EXPR: + *walk_subtrees = 0; + return NULL; + /* Try to estimate the cost of assignments. We have three cases to deal with: 1) Simple assignments to registers; @@ -2635,6 +2640,7 @@ copy_decl_to_var (tree decl, copy_body_d TREE_READONLY (copy) = TREE_READONLY (decl); TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); return copy_decl_for_dup_finish (id, decl, copy); } @@ -2661,6 +2667,7 @@ copy_result_decl_to_var (tree decl, copy { TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); + DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); } return copy_decl_for_dup_finish (id, decl, copy); Modified: head/contrib/gcc/tree-pretty-print.c ============================================================================== --- head/contrib/gcc/tree-pretty-print.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-pretty-print.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1443,6 +1443,17 @@ dump_generic_node (pretty_printer *buffe is_expr = false; break; + case CHANGE_DYNAMIC_TYPE_EXPR: + pp_string (buffer, "<<>>"); + is_expr = false; + break; + case LABEL_EXPR: op0 = TREE_OPERAND (node, 0); /* If this is for break or continue, don't bother printing it. */ Modified: head/contrib/gcc/tree-ssa-alias.c ============================================================================== --- head/contrib/gcc/tree-ssa-alias.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-alias.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,5 @@ /* Alias analysis for trees. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -1961,28 +1961,29 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG); - alias_stats.tbaa_queries++; - - /* If the alias sets don't conflict then MEM cannot alias VAR. */ - if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) + if (!DECL_NO_TBAA_P (ptr)) { - alias_stats.alias_noalias++; - alias_stats.tbaa_resolved++; - return false; - } + alias_stats.tbaa_queries++; - /* If var is a record or union type, ptr cannot point into var - unless there is some operation explicit address operation in the - program that can reference a field of the ptr's dereferenced - type. This also assumes that the types of both var and ptr are - contained within the compilation unit, and that there is no fancy - addressing arithmetic associated with any of the types - involved. */ + /* If the alias sets don't conflict then MEM cannot alias VAR. */ + if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) + { + alias_stats.alias_noalias++; + alias_stats.tbaa_resolved++; + return false; + } - if ((mem_alias_set != 0) && (var_alias_set != 0)) - { - tree ptr_type = TREE_TYPE (ptr); - tree var_type = TREE_TYPE (var); + /* If VAR is a record or union type, PTR cannot point into VAR + unless there is some explicit address operation in the + program that can reference a field of the type pointed-to by + PTR. This also assumes that the types of both VAR and PTR + are contained within the compilation unit, and that there is + no fancy addressing arithmetic associated with any of the + types involved. */ + if (mem_alias_set != 0 && var_alias_set != 0) + { + tree ptr_type = TREE_TYPE (ptr); + tree var_type = TREE_TYPE (var); /* The star count is -1 if the type at the end of the pointer_to chain is not a record or union type. */ @@ -1991,41 +1992,41 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem { int ptr_star_count = 0; - /* Ipa_type_escape_star_count_of_interesting_type is a little to - restrictive for the pointer type, need to allow pointers to - primitive types as long as those types cannot be pointers - to everything. */ - while (POINTER_TYPE_P (ptr_type)) - /* Strip the *'s off. */ - { - ptr_type = TREE_TYPE (ptr_type); - ptr_star_count++; - } - - /* There does not appear to be a better test to see if the - pointer type was one of the pointer to everything - types. */ + /* ipa_type_escape_star_count_of_interesting_type is a + little too restrictive for the pointer type, need to + allow pointers to primitive types as long as those + types cannot be pointers to everything. */ + while (POINTER_TYPE_P (ptr_type)) + { + /* Strip the *s off. */ + ptr_type = TREE_TYPE (ptr_type); + ptr_star_count++; + } - if (ptr_star_count > 0) - { - alias_stats.structnoaddress_queries++; - if (ipa_type_escape_field_does_not_clobber_p (var_type, - TREE_TYPE (ptr))) + /* There does not appear to be a better test to see if + the pointer type was one of the pointer to everything + types. */ + if (ptr_star_count > 0) + { + alias_stats.structnoaddress_queries++; + if (ipa_type_escape_field_does_not_clobber_p (var_type, + TREE_TYPE (ptr))) + { + alias_stats.structnoaddress_resolved++; + alias_stats.alias_noalias++; + return false; + } + } + else if (ptr_star_count == 0) { + /* If PTR_TYPE was not really a pointer to type, it cannot + alias. */ + alias_stats.structnoaddress_queries++; alias_stats.structnoaddress_resolved++; alias_stats.alias_noalias++; return false; } } - else if (ptr_star_count == 0) - { - /* If ptr_type was not really a pointer to type, it cannot - alias. */ - alias_stats.structnoaddress_queries++; - alias_stats.structnoaddress_resolved++; - alias_stats.alias_noalias++; - return false; - } } } Modified: head/contrib/gcc/tree-ssa-dce.c ============================================================================== --- head/contrib/gcc/tree-ssa-dce.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-dce.c Thu Dec 19 18:27:32 2013 (r259619) @@ -1,5 +1,6 @@ /* Dead code elimination pass for the GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Ben Elliston and Andrew MacLeod Adapted to use control dependence by Steven Bosscher, SUSE Labs. @@ -307,6 +308,7 @@ mark_stmt_if_obviously_necessary (tree s case ASM_EXPR: case RESX_EXPR: case RETURN_EXPR: + case CHANGE_DYNAMIC_TYPE_EXPR: mark_stmt_necessary (stmt, true); return; Modified: head/contrib/gcc/tree-ssa-operands.c ============================================================================== --- head/contrib/gcc/tree-ssa-operands.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-operands.c Thu Dec 19 18:27:32 2013 (r259619) @@ -2057,6 +2057,10 @@ get_expr_operands (tree stmt, tree *expr return; } + case CHANGE_DYNAMIC_TYPE_EXPR: + get_expr_operands (stmt, &CHANGE_DYNAMIC_TYPE_LOCATION (expr), opf_none); + return; + case BLOCK: case FUNCTION_DECL: case EXC_PTR_EXPR: Modified: head/contrib/gcc/tree-ssa-structalias.c ============================================================================== --- head/contrib/gcc/tree-ssa-structalias.c Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree-ssa-structalias.c Thu Dec 19 18:27:32 2013 (r259619) @@ -251,6 +251,10 @@ struct variable_info /* True if this is a heap variable. */ unsigned int is_heap_var:1; + /* True if we may not use TBAA to prune references to this + variable. This is used for C++ placement new. */ + unsigned int no_tbaa_pruning : 1; + /* Points-to set for this variable. */ bitmap solution; @@ -368,6 +372,7 @@ static varinfo_t new_var_info (tree t, unsigned int id, const char *name) { varinfo_t ret = pool_alloc (variable_info_pool); + tree var; ret->id = id; ret->name = name; @@ -378,6 +383,12 @@ new_var_info (tree t, unsigned int id, c ret->is_special_var = false; ret->is_unknown_size_var = false; ret->has_union = false; + var = t; + if (TREE_CODE (var) == SSA_NAME) + var = SSA_NAME_VAR (var); + ret->no_tbaa_pruning = (DECL_P (var) + && POINTER_TYPE_P (TREE_TYPE (var)) + && DECL_NO_TBAA_P (var)); ret->solution = BITMAP_ALLOC (&pta_obstack); ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack); ret->next = NULL; @@ -1221,6 +1232,9 @@ unify_nodes (constraint_graph_t graph, u merge_graph_nodes (graph, to, from); merge_node_constraints (graph, to, from); + if (get_varinfo (from)->no_tbaa_pruning) + get_varinfo (to)->no_tbaa_pruning = true; + if (update_changed && TEST_BIT (changed, from)) { RESET_BIT (changed, from); @@ -3564,6 +3578,14 @@ find_func_aliases (tree origt) } } } + else if (TREE_CODE (t) == CHANGE_DYNAMIC_TYPE_EXPR) + { + unsigned int j; + + get_constraint_for (CHANGE_DYNAMIC_TYPE_LOCATION (t), &lhsc); + for (j = 0; VEC_iterate (ce_s, lhsc, j, c); ++j) + get_varinfo (c->var)->no_tbaa_pruning = true; + } /* After promoting variables and computing aliasing we will need to re-scan most statements. FIXME: Try to minimize the @@ -4250,7 +4272,10 @@ dump_solution_for_var (FILE *file, unsig { fprintf (file, "%s ", get_varinfo (i)->name); } - fprintf (file, "}\n"); + fprintf (file, "}"); + if (vi->no_tbaa_pruning) + fprintf (file, " no-tbaa-pruning"); + fprintf (file, "\n"); } } @@ -4422,10 +4447,15 @@ shared_bitmap_add (bitmap pt_vars) /* Set bits in INTO corresponding to the variable uids in solution set FROM, which came from variable PTR. For variables that are actually dereferenced, we also use type - based alias analysis to prune the points-to sets. */ + based alias analysis to prune the points-to sets. + IS_DEREFED is true if PTR was directly dereferenced, which we use to + help determine whether we are we are allowed to prune using TBAA. + If NO_TBAA_PRUNING is true, we do not perform any TBAA pruning of + the from set. */ static void -set_uids_in_ptset (tree ptr, bitmap into, bitmap from) +set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed, + bool no_tbaa_pruning) { unsigned int i; bitmap_iterator bi; @@ -4462,7 +4492,8 @@ set_uids_in_ptset (tree ptr, bitmap into if (sft) { var_alias_set = get_alias_set (sft); - if (!vi->directly_dereferenced + if (no_tbaa_pruning + || (!is_derefed && !vi->directly_dereferenced) || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (sft)); } @@ -4476,7 +4507,8 @@ set_uids_in_ptset (tree ptr, bitmap into else { var_alias_set = get_alias_set (vi->decl); - if (!vi->directly_dereferenced + if (no_tbaa_pruning + || (!is_derefed && !vi->directly_dereferenced) || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (vi->decl)); } @@ -4564,7 +4596,9 @@ find_what_p_points_to (tree p) return false; finished_solution = BITMAP_GGC_ALLOC (); - set_uids_in_ptset (vi->decl, finished_solution, vi->solution); + set_uids_in_ptset (vi->decl, finished_solution, vi->solution, + vi->directly_dereferenced, + vi->no_tbaa_pruning); result = shared_bitmap_lookup (finished_solution); if (!result) @@ -4913,6 +4947,142 @@ remove_preds_and_fake_succs (constraint_ bitmap_obstack_release (&predbitmap_obstack); } +/* Compute the set of variables we can't TBAA prune. */ + +static void +compute_tbaa_pruning (void) +{ + unsigned int size = VEC_length (varinfo_t, varmap); + unsigned int i; + bool any; + + changed_count = 0; + changed = sbitmap_alloc (size); + sbitmap_zero (changed); + + /* Mark all initial no_tbaa_pruning nodes as changed. */ + any = false; + for (i = 0; i < size; ++i) + { + varinfo_t ivi = get_varinfo (i); + + if (find (i) == i && ivi->no_tbaa_pruning) + { + any = true; + if ((graph->succs[i] && !bitmap_empty_p (graph->succs[i])) + || VEC_length (constraint_t, graph->complex[i]) > 0) + { + SET_BIT (changed, i); + ++changed_count; + } + } + } + + while (changed_count > 0) + { + struct topo_info *ti = init_topo_info (); + ++stats.iterations; + + bitmap_obstack_initialize (&iteration_obstack); + + compute_topo_order (graph, ti); + + while (VEC_length (unsigned, ti->topo_order) != 0) + { + bitmap_iterator bi; + + i = VEC_pop (unsigned, ti->topo_order); + + /* If this variable is not a representative, skip it. */ + if (find (i) != i) + continue; + + /* If the node has changed, we need to process the complex + constraints and outgoing edges again. */ + if (TEST_BIT (changed, i)) + { + unsigned int j; + constraint_t c; + VEC(constraint_t,heap) *complex = graph->complex[i]; + + RESET_BIT (changed, i); + --changed_count; + + /* Process the complex copy constraints. */ + for (j = 0; VEC_iterate (constraint_t, complex, j, c); ++j) + { + if (c->lhs.type == SCALAR && c->rhs.type == SCALAR) + { + varinfo_t lhsvi = get_varinfo (find (c->lhs.var)); + + if (!lhsvi->no_tbaa_pruning) + { + lhsvi->no_tbaa_pruning = true; + if (!TEST_BIT (changed, lhsvi->id)) + { + SET_BIT (changed, lhsvi->id); + ++changed_count; + } + } + } + } + + /* Propagate to all successors. */ + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i], 0, j, bi) + { + unsigned int to = find (j); + varinfo_t tovi = get_varinfo (to); + + /* Don't propagate to ourselves. */ + if (to == i) + continue; + + if (!tovi->no_tbaa_pruning) + { + tovi->no_tbaa_pruning = true; + if (!TEST_BIT (changed, to)) + { + SET_BIT (changed, to); + ++changed_count; + } + } + } + } + } + + free_topo_info (ti); + bitmap_obstack_release (&iteration_obstack); + } + + sbitmap_free (changed); + + if (any) + { + for (i = 0; i < size; ++i) + { + varinfo_t ivi = get_varinfo (i); + varinfo_t ivip = get_varinfo (find (i)); + + if (ivip->no_tbaa_pruning) + { + tree var = ivi->decl; + + if (TREE_CODE (var) == SSA_NAME) + var = SSA_NAME_VAR (var); + + if (POINTER_TYPE_P (TREE_TYPE (var))) + { + DECL_NO_TBAA_P (var) = 1; + + /* Tell the RTL layer that this pointer can alias + anything. */ + DECL_POINTER_ALIAS_SET (var) = 0; + } + } + } + } +} + /* Create points-to sets for the current function. See the comments at the start of the file for an algorithmic overview. */ @@ -4948,7 +5118,7 @@ compute_points_to_sets (struct alias_inf } } - for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) { tree stmt = bsi_stmt (bsi); @@ -4959,6 +5129,13 @@ compute_points_to_sets (struct alias_inf This is used when creating name tags and alias sets. */ update_alias_info (stmt, ai); + + /* The information in CHANGE_DYNAMIC_TYPE_EXPR nodes has now + been captured, and we can remove them. */ + if (TREE_CODE (stmt) == CHANGE_DYNAMIC_TYPE_EXPR) + bsi_remove (&bsi, true); + else + bsi_next (&bsi); } } @@ -4991,6 +5168,8 @@ compute_points_to_sets (struct alias_inf solve_graph (graph); + compute_tbaa_pruning (); + if (dump_file) dump_sa_points_to_info (dump_file); have_alias_info = true; Modified: head/contrib/gcc/tree.def ============================================================================== --- head/contrib/gcc/tree.def Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree.def Thu Dec 19 18:27:32 2013 (r259619) @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the tree codes used in GCC. Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -880,6 +880,15 @@ DEFTREECODE (CATCH_EXPR, "catch_expr", t expanding. */ DEFTREECODE (EH_FILTER_EXPR, "eh_filter_expr", tcc_statement, 2) +/* Indicates a change in the dynamic type of a memory location. This + has no value and generates no executable code. It is only used for + type based alias analysis. This is generated by C++ placement new. + CHANGE_DYNAMIC_TYPE_NEW_TYPE, the first operand, is the new type. + CHNAGE_DYNAMIC_TYPE_LOCATION, the second operand, is the location + whose type is being changed. */ +DEFTREECODE (CHANGE_DYNAMIC_TYPE_EXPR, "change_dynamic_type_expr", + tcc_statement, 2) + /* Node used for describing a property that is known at compile time. */ DEFTREECODE (SCEV_KNOWN, "scev_known", tcc_expression, 0) Modified: head/contrib/gcc/tree.h ============================================================================== --- head/contrib/gcc/tree.h Thu Dec 19 18:06:52 2013 (r259618) +++ head/contrib/gcc/tree.h Thu Dec 19 18:27:32 2013 (r259619) @@ -1548,6 +1548,12 @@ struct tree_constructor GTY(()) #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1) #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE)) +/* CHANGE_DYNAMIC_TYPE_EXPR accessors. */ +#define CHANGE_DYNAMIC_TYPE_NEW_TYPE(NODE) \ + TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 0) +#define CHANGE_DYNAMIC_TYPE_LOCATION(NODE) \ + TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 1) + /* OBJ_TYPE_REF accessors. */ #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0) #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1) @@ -2538,6 +2544,11 @@ struct tree_struct_field_tag GTY(()) #define DECL_CALL_CLOBBERED(DECL) \ DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag +/* For a DECL with pointer type, this is set if Type Based Alias + Analysis should not be applied to this DECL. */ +#define DECL_NO_TBAA_P(DECL) \ + DECL_COMMON_CHECK (DECL)->decl_common.no_tbaa_flag + struct tree_decl_common GTY(()) { struct tree_decl_minimal common; @@ -2579,6 +2590,8 @@ struct tree_decl_common GTY(()) parm decl. */ unsigned gimple_reg_flag : 1; unsigned call_clobbered_flag : 1; + /* In a DECL with pointer type, set if no TBAA should be done. */ + unsigned no_tbaa_flag : 1; unsigned int align : 24; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 18:52:42 2013 Return-Path: Delivered-To: svn-src-all@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 95D0EC98; Thu, 19 Dec 2013 18:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 809E31D48; Thu, 19 Dec 2013 18:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJIqgoD057788; Thu, 19 Dec 2013 18:52:42 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJIqfTS057784; Thu, 19 Dec 2013 18:52:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312191852.rBJIqfTS057784@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Dec 2013 18:52: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: r259621 - 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-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 18:52:42 -0000 Author: dteske Date: Thu Dec 19 18:52:41 2013 New Revision: 259621 URL: http://svnweb.freebsd.org/changeset/base/259621 Log: MFC r259276,259468-259470,259472,259474,259476-259478,259480-259481,259570, 259572, and 259597-259598... r259276: Fix bug in `services' script in adding dumpdev comment to rc.conf r259468: Ignore spurious escape generated by VMware's Ctrl-Cmd combination r259469: Mask errors in `config' script from newaliases(1) about non-FQHN r259470: Set atime=on for /var/mail zfsboot dataset to support mail server r259472: Accept NULL input for zfsboot SWAP to indicate SWAP of zero bytes r259474: Multiple changes, including bug-fixes and debugging improvements r259476: Change default ZFS disk layout, making it easier to resize r259477: fletcher4 is now the default (zfsboot related) r259478: De-uglify the geli(8)-setup infobox (zfsboot related) r259480: Fix ghosted zroot issue by always performing labelclear on swap r259481: Auto-enable 4k sector alignmet when geli(8) is enabled (zfsboot) r259570: Fix numerical comparison error (zfsboot) r259572: Mask spurious rm error in bsdinstall_log from `auto' script r259597: Fix zfsboot regression when installing to 3+ disks r259598: Set cachefile property of bootpool so it imports to new system Modified: stable/10/usr.sbin/bsdinstall/scripts/auto stable/10/usr.sbin/bsdinstall/scripts/config stable/10/usr.sbin/bsdinstall/scripts/services stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Thu Dec 19 18:52:27 2013 (r259620) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Thu Dec 19 18:52:41 2013 (r259621) @@ -49,6 +49,10 @@ error() { ############################################################ MAIN +# Don't send ESC on function-key 62/63 (left/right command key) +f_quietly kbdcontrol -f 62 '' +f_quietly kbdcontrol -f 63 '' + f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC @@ -99,7 +103,7 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then export BSDINSTALL_DISTSITE fi -rm $PATH_FSTAB +rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ @@ -120,8 +124,7 @@ exec 3>&1 PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ --title "Partitioning" \ --menu "How would you like to partition your disk?" \ - 0 0 0 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + 0 0 0 2>&1 1>&3` || exit 1 exec 3>&- case "$PARTMODE" in Modified: stable/10/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/config Thu Dec 19 18:52:27 2013 (r259620) +++ stable/10/usr.sbin/bsdinstall/scripts/config Thu Dec 19 18:52:41 2013 (r259621) @@ -42,7 +42,7 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHR [ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/ # Set up other things from installed config -chroot $BSDINSTALL_CHROOT /usr/bin/newaliases +chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 ################################################################################ # END Modified: stable/10/usr.sbin/bsdinstall/scripts/services ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/services Thu Dec 19 18:52:27 2013 (r259620) +++ stable/10/usr.sbin/bsdinstall/scripts/services Thu Dec 19 18:52:41 2013 (r259621) @@ -50,13 +50,12 @@ DAEMONS=$(dialog --backtitle "FreeBSD In 2>&1 1>&3) exec 3>&- -local havedump= +havedump= for daemon in $DAEMONS; do if [ "$daemon" == "dumpdev" ]; then havedump=1 - echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \ - \"NO\" to disable >> \ - $BSDINSTALL_TMPETC/rc.conf.services + echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services continue fi Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 18:52:27 2013 (r259620) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Dec 19 18:52:41 2013 (r259621) @@ -66,23 +66,30 @@ f_include $BSDCFG_SHARE/variable.subr # # Should we use geli(8) to encrypt the drives? +# NB: Automatically enables ZFSBOOT_BOOT_POOL # : ${ZFSBOOT_GELI_ENCRYPTION=} # -# Default name the unencrypted pool when using geli(8) to encrypt the drives +# Default path to the geli(8) keyfile used in drive encryption # -: ${ZFSBOOT_GELI_POOL_NAME:=bootpool} +: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} # -# Default size for the unencrypted boot pool when using geli(8) +# Create a separate boot pool? +# NB: Automatically set when using geli(8) or MBR # -: ${ZFSBOOT_GELI_BOOT_SIZE:=2g} +: ${ZFSBOOT_BOOT_POOL=} # -# Default path to the geli(8) keyfile used in drive encryption +# Default name for boot pool when enabled (e.g., geli(8) or MBR) # -: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} +: ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} + +# +# Default size for boot pool when enabled (e.g., geli(8) or MBR) +# +: ${ZFSBOOT_BOOT_POOL_SIZE:=2g} # # Default disks to use (always empty unless being scripted) @@ -132,6 +139,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /var mountpoint=/var /var/crash compression=lz4,exec=off,setuid=off /var/log compression=lz4,exec=off,setuid=off + /var/mail compression=lz4,atime=on /var/tmp compression=lz4,exec=on,setuid=off " # END-QUOTE @@ -155,8 +163,10 @@ CHMOD_MODE='chmod %s "%s"' DD_WITH_OPTIONS='dd if="%s" of="%s" %s' ECHO_APPEND='echo "%s" >> "%s"' GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_DETACH_F='geli detach -f "%s"' GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' GNOP_CREATE='gnop create -S 4096 "%s"' +GNOP_DESTROY='gnop destroy "%s"' GPART_ADD='gpart add -t %s "%s"' GPART_ADD_INDEX='gpart add -i %s -t %s "%s"' GPART_ADD_INDEX_WITH_SIZE='gpart add -i %s -t %s -s %s "%s"' @@ -165,19 +175,23 @@ GPART_ADD_LABEL_WITH_SIZE='gpart add -l GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' +GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' +GRAID_DELETE='graid delete "%s"' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' +ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' ZPOOL_SET='zpool set %s "%s"' # @@ -201,12 +215,12 @@ msg_force_4k_sectors="Force 4K Sectors?" msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" msg_freebsd_installer="FreeBSD Installer" msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" -msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk" msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" +msg_invalid_boot_pool_size="Invalid boot pool size \`%s'" msg_invalid_disk_argument="Invalid disk argument \`%s'" -msg_invalid_geli_boot_size="Invalid geli(8) boot size \`%s'" msg_invalid_index_argument="Invalid index argument \`%s'" msg_invalid_swap_size="Invalid swap size \`%s'" msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" @@ -610,13 +624,13 @@ dialog_menu_layout() # so we can have some real swap. This also provides wiggle room incase your # replacement drivers do not have the exact same sector counts. # -# NOTE: The MBR layout is more complicated (GPT is preferred). +# NOTE: $swapsize and $bootsize should be defined by the calling function. +# NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" - local disksize partsize # Check arguments if [ ! "$disk" ]; then @@ -663,26 +677,18 @@ zfs_create_diskpart() # NOTE: Failure is ok here, blank disk will have nothing to destroy. # f_dprintf "$funcname: Destroying all data/layouts on \`%s'..." "$disk" - f_quietly gpart destroy -F $disk - f_quietly graid destroy $disk - f_quietly zpool labelclear -f /dev/$disk # Kill it with fire + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk + f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" /dev/$disk # Make doubly-sure backup GPT is destroyed - f_quietly gpart create -s gpt $disk - f_quietly gpart destroy -F $disk + f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk - # Calculate partition size given desired amount of swap - f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" - if ! device_$disk get capacity disksize; then - f_dprintf "$funcname: Unable to get disk capacity of \`%s'" \ - "$disk" - msg_error="$msg_error: $funcname" \ - f_show_err "$msg_unable_to_get_disk_capacity" "$disk" - return $FAILURE - fi - partsize=$(( $disksize - $swapsize )) - f_dprintf "$funcname: disksize=[%s] partsize=[%s]" \ - "$disksize" "$partsize" + # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 # # Lay down the desired type of partition scheme @@ -693,147 +699,148 @@ zfs_create_diskpart() # # 1. Create GPT layout using labels # - f_eval_catch $funcname gpart "$GPART_CREATE" gpt \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" gpt $disk || return $FAILURE # # 2. Add small freebsd-boot partition labeled `boot#' # f_eval_catch $funcname gpart "$GPART_ADD_LABEL_WITH_SIZE" \ - gptboot\$index freebsd-boot 512k \$disk || + gptboot$index freebsd-boot 512k $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 \$disk || + /boot/pmbr /boot/gptzfsboot 1 $disk || return $FAILURE - # zpool will use the `zfs#' GPT labels + # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 + [ ${swapsize:-0} -gt 0 ] && targetpart=p3 - # Change things around if we are using geli(8) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # + # Prepare boot pool if enabled (e.g., for geli(8)) + # + if [ "$ZFSBOOT_BOOT_POOL" ]; then bootpart=p2 targetpart=p3 - partsize=$(( $partsize - $gelisize )) - f_dprintf "$funcname: gelisize=[%s]" \ - "gelisize=[$gelisize]" + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" boot\$index \ - freebsd-zfs \${gelisize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ + freebsd-zfs ${bootsize}b $disk || return $FAILURE - - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart + fi fi # - # 3. Add freebsd-zfs partition labeled `zfs#' for zpool - # NOTE: Using above calculated partsize to leave room for swap. + # 3. Add freebsd-swap partition labeled `swap#' # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: partsize=[%s]" \ - "partsize=[$partsize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs\$index \ - freebsd-zfs \${partsize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ + freebsd-swap ${swapsize}b $disk || return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs\$index freebsd-zfs \$disk || + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/gpt/swap$index + # Update fstab(5) + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/gpt/swap$index none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi - f_quietly zpool labelclear -f "/dev/$disk$targetpart" # - # 4. Add freebsd-swap partition labeled `swap#' + # 4. Add freebsd-zfs partition labeled `zfs#' for zroot # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap\$index freebsd-swap \$disk || - return $FAILURE - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap\$index none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || - return $FAILURE - fi + f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ + zfs$index freebsd-zfs $disk || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart ;; MBR) f_dprintf "$funcname: Creating MBR layout..." # # 1. Create MBR layout (no labels) # - f_eval_catch $funcname gpart "$GPART_CREATE" mbr \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" mbr $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE" /boot/mbr \ - \$disk || return $FAILURE + $disk || return $FAILURE # # 2. Add freebsd slice with all available space # - f_eval_catch $funcname gpart "$GPART_ADD" freebsd \$disk || + f_eval_catch $funcname gpart "$GPART_ADD" freebsd $disk || return $FAILURE - f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 \$disk || + f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 $disk || return $FAILURE - f_quietly zpool labelclear -f /dev/${disk}s1 # Pedantic - f_quietly gpart destroy -F ${disk}s1 # Pedantic + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1 + # Pedantically nuke any old scheme + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" ${disk}s1 # # 3. Write BSD scheme to the freebsd slice # - f_eval_catch $funcname gpart "$GPART_CREATE" BSD \${disk}s1 || + f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE - # zpool will use s1a (no labels) - bootpart=s1a targetpart=s1a mbrindex=1 + # NB: zpool will use s1a (no labels) + bootpart=s1a targetpart=s1d mbrindex=4 - # Change things around if we are using geli(8) + # + # Always prepare a boot pool on MBR + # + ZFSBOOT_BOOT_POOL=1 + f_eval_catch $funcname gpart \ + "$GPART_ADD_INDEX_WITH_SIZE" \ + 1 freebsd-zfs ${bootsize}b ${disk}s1 || + return $FAILURE + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - bootpart=s1a targetpart=s1d - partsize=$(( $partsize - $gelisize )) - mbrindex=4 # If this is s1a then make the zpool s1d - f_dprintf "$funcname: mbrindex=[%s] gelisize=[%s]" \ - "$mbrindex" "$gelisize" - f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs \${gelisize}b \${disk}s1 || - return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # - # 4. Partition the BSD slice for ZFS - # NOTE: Using above calculated partsize to leave room for swap. + # 4. Add freebsd-swap partition # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: mbrindex=[%s] partsize=[%s]" \ - "$mbrindex" "$partsize" f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - \$mbrindex freebsd-zfs \${partsize}b \ - \${disk}s1 || return $FAILURE - else - f_dprintf "$funcname: mbrindex=[%s]" "$mbrindex" - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - \$mbrindex freebsd-zfs \${disk}s1 || - return $FAILURE - fi - f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic - - # - # 5. Add freebsd-swap partition - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - 2 freebsd-swap \${disk}s1 || + "$GPART_ADD_INDEX_WITH_SIZE" 2 \ + freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1b # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/\${disk}s1b none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/${disk}s1b none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 5. Add freebsd-zfs partition for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /boot/zfsboot /dev/${disk}s1 count=1 || + return $FAILURE ;; esac # $ZFSBOOT_PARTITION_SCHEME @@ -849,16 +856,18 @@ zfs_create_diskpart() zfs_create_boot() { local funcname=zfs_create_boot - local poolname="$1" vdev_type="$2" - local bootpart targetpart - - shift 2 # name vdev_type - - # We may need this later - local disks="$*" + local zroot_name="$1" + local zroot_vdevtype="$2" + local zroot_vdevs= # Calculated below + local boot_vdevs= # Used for geli(8) and/or MBR layouts + shift 2 # poolname vdev_type + local disks="$*" disk + local bootpart targetpart # Set by zfs_create_diskpart() below + # # Pedantic checks; should never be seen - if [ ! "$poolname" ]; then + # + if [ ! "$zroot_name" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ f_show_err "$msg_null_poolname" @@ -871,132 +880,130 @@ zfs_create_boot() return $FAILURE fi f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ - "$poolname" "$vdev_type" + "$zroot_name" "$zroot_vdevtype" + # # Initialize fstab(5) + # f_dprintf "$funcname: Initializing temporary fstab(5) file..." - f_eval_catch $funcname sh \ - "$SHELL_TRUNCATE" \$BSDINSTALL_TMPETC/fstab || + f_eval_catch $funcname sh "$SHELL_TRUNCATE" $BSDINSTALL_TMPETC/fstab || return $FAILURE f_eval_catch $funcname printf "$PRINTF_FSTAB" \ "# Device" Mountpoint FStype Options Dump "Pass#" \ - \$BSDINSTALL_TMPETC/fstab || return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE + # # Expand SI units in desired sizes - f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." - local swapsize gelisize + # + f_dprintf "$funcname: Expanding supplied size values..." + local swapsize bootsize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then f_dprintf "$funcname: Invalid swap size \`%s'" \ "$ZFSBOOT_SWAP_SIZE" f_show_err "$msg_invalid_swap_size" "$ZFSBOOT_SWAP_SIZE" return $FAILURE fi - if ! f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize; then - f_dprintf "$funcname: Invalid geli(8) boot size \`%s'" \ - "$ZFSBOOT_GELI_BOOT_SIZE" - f_show_err "$msg_invalid_geli_boot_size" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + if ! f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize; then + f_dprintf "$funcname: Invalid boot pool size \`%s'" \ + "$ZFSBOOT_BOOT_POOL_SIZE" + f_show_err "$msg_invalid_boot_pool_size" \ + "$ZFSBOOT_BOOT_POOL_SIZE" return $FAILURE fi f_dprintf "$funcname: ZFSBOOT_SWAP_SIZE=[%s] swapsize=[%s]" \ "$ZFSBOOT_SWAP_SIZE" "$swapsize" - f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ - "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + f_dprintf "$funcname: ZFSBOOT_BOOT_POOL_SIZE=[%s] bootsize=[%s]" \ + "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" - # Prepare the disks + # + # Prepare the disks and build pool device list(s) + # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." + [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && + f_dprintf "$funcname: With 4k alignment using gnop(8)..." local n=0 - for disk in $*; do + for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - n=$(( $n + 1 )) - done - - # MBR boot loader hack part 1 - # We have to do this early because geli gets in the way later - if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then - f_dprintf "$funcname: Copying MBR boot loader to disks..." - f_dprintf "$funcname: disks=[%s]" "$disks" - for disk in $disks; do - f_dprintf "$funcname: disk=[%s]" "$disk" - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\${disk}s1 count=1 || - return $FAILURE - done - fi - - # Forced 4k alignment support provided by Geom NOP (see gnop(8)) - local unenc_list= - if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then - local part="$targetpart" new_list= - - # We don't gnop the encrypted partition because geli will do - # this for us gnop the unencrypted disk - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" - - f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - f_dprintf "$funcname: *=[%s]" "$*" - for disk in $*; do - f_dprintf "$funcname: disk=[%s] part=[%s]" \ - "$disk" "$part" - f_eval_catch $funcname gnop "$GNOP_CREATE" \ - \$disk\$part || return $FAILURE + # Now $bootpart and $targetpart are set (suffix for $disk) + + # Forced 4k alignment support using Geom NOP (see gnop(8)) + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$bootpart || return $FAILURE + fi + # Don't gnop encrypted partition if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - unenc_list="$unenc_list $disk$part.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.eli" else - new_list="$new_list $disk$targetpart.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$targetpart || + return $FAILURE fi - done - set -- $new_list - else - local new_list= - for disk in $*; do - new_list="$new_list $disk$targetpart" - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - unenc_list="$unenc_list $disk$bootpart" - done - set -- $new_list - fi + else + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart" + fi + zroot_vdevs="$zroot_vdevs $disk$targetpart" + fi + + n=$(( $n + 1 )) + done # disks # - # If encryption is enabled, we need to create the GEOMs + # If we need/want a boot pool, create it # - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - local bootvdev= options= - local geli_pool="$BSDINSTALL_CHROOT/$ZFSBOOT_GELI_POOL_NAME" - local key="$ZFSBOOT_GELI_KEY_FILE" - - f_dprintf "$funcname: Setting up disk encryption..." + if [ "$ZFSBOOT_BOOT_POOL" ]; then + local bootpool_vdevtype= # Calculated below + local bootpool_options= # Calculated below + local bootpool_name="$ZFSBOOT_BOOT_POOL_NAME" + local bootpool="$BSDINSTALL_CHROOT/$bootpool_name" + local zroot_key="${ZFSBOOT_GELI_KEY_FILE#/}" + + f_dprintf "$funcname: Setting up boot pool..." + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + f_dprintf "$funcname: For encrypted root disk..." - # Create the parent directories for our unencrypted pool - f_quietly umount /mnt + # Create parent directory for boot pool + f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ - \$BSDINSTALL_CHROOT || return $FAILURE + $BSDINSTALL_CHROOT || return $FAILURE - # Create mirror across the unencrypted partition on all disks - [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror + # Create mirror across the boot partition on all disks + [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && + bootpool_vdevtype=mirror - f_dprintf "$funcname: %s %s %s" \ - "ZFSBOOT_GELI_POOL_NAME=[$ZFSBOOT_GELI_POOL_NAME]" \ - "bootvdev=[$bootvdev]" "unenc_list=[$unenc_list]" - options="-o altroot=\"\$BSDINSTALL_CHROOT\"" - options="$options -m \"/\$ZFSBOOT_GELI_POOL_NAME\"" - options="$options -f" + bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" \$ZFSBOOT_GELI_POOL_NAME \$bootvdev \ - \$unenc_list || return $FAILURE - - f_dprintf "$funcname: geli_pool=[%s]" "$geli_pool" - f_eval_catch $funcname mkdir "$MKDIR_P" \$geli_pool/boot || + "$bootpool_options" "$bootpool_name" \ + "$bootpool_vdevtype" "$boot_vdevs" || return $FAILURE - # Generate an encryption key using random(4) - f_dprintf "$funcname: key=[%s]" "$key" - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random \$geli_pool/\$key "bs=4096 count=1" || + f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE - # Create the geli(8) GEOMS - local geli_list + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Generate an encryption key using random(4) + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /dev/random "$bootpool/$zroot_key" \ + "bs=4096 count=1" || return $FAILURE + else + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ + "$bootpool_name" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs + fi + + fi + + # + # Create the geli(8) GEOMS + # + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Prompt user for password (twice) if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password then @@ -1004,57 +1011,57 @@ zfs_create_boot() f_show_err "$msg_user_cancelled" return $FAILURE fi - f_dprintf "$funcname: disks=[%s]" "$disks" + + # Initialize geli(8) on each of the target partitions for disk in $disks; do - f_dprintf "$funcname: disk=[%s] targetpart=[%s]" \ - "$disk" "$targetpart" f_dialog_info "$msg_geli_setup" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_PASSWORD_INIT" \ - \$geli_pool/boot/\$disk\$targetpart.eli \ - AES-XTS \$geli_pool/\$key \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_PASSWORD_INIT" \ + "$bootpool/boot/$disk$targetpart.eli" \ + AES-XTS "$bootpool/$zroot_key" \ + $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_ATTACH" \$geli_pool/\$key \ - \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH" \ + "$bootpool/$zroot_key" $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - geli_list="$geli_list $disk$targetpart.eli" done - set -- $geli_list - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE - f_quietly umount /mnt # done with tmpfs + unset pw_password # Sensitive info + + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" "$bootpool_name" || + return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # - # Create the ZFS pool with desired type and disk devices + # Create the ZFS root pool with desired type and disk devices # - local vdevs="$*" - f_dprintf "$funcname: Creating boot pool..." - f_dprintf "poolname=[%s] vdev_type=[%s] vdevs=[%s]" \ - "$poolname" "$vdev_type" "$vdevs" + f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\" -m none -f" \ - \$poolname \$vdev_type \$vdevs + "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE - # Customize the zpool a bit... + # Customize the zroot a bit... local option - f_dprintf "$funcname: Setting miscellaneous options on boot pool..." - for option in checksum=fletcher4 atime=off; do - f_dprintf "$funcname: option=[%s]" "$option" - f_eval_catch $funcname zfs "$ZFS_SET" \$option \$poolname || - return $FAILURE + f_dprintf "$funcname: Setting miscellaneous options on root pool..." + for option in atime=off; do + f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || + return $FAILURE done # - # Create ZFS dataset layout within the new boot pool + # Create ZFS dataset layout within the new root pool # f_dprintf "$funcname: Creating ZFS datasets..." echo "$ZFSBOOT_DATASETS" | while read dataset options; do @@ -1073,10 +1080,8 @@ zfs_create_boot() # Replace both commas and spaces with ` -o ' f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options - f_dprintf "$funcname: dataset=[%s] options=[%s]" \ - "$dataset" "$options" f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "\${options:+-o \$options}" \$poolname\$dataset || + "${options:+-o $options}" "$zroot_name$dataset" || return $FAILURE done @@ -1084,57 +1089,53 @@ zfs_create_boot() f_dprintf "$funcname: Modifying directory permissions..." local dir for dir in /tmp /var/tmp; do - f_dprintf "$funcname: dir=[%s]" "$dir" f_eval_catch $funcname chmod "$CHMOD_MODE" 1777 \ - \$BSDINSTALL_CHROOTDIR\$dir || return $FAILURE + $BSDINSTALL_CHROOTDIR$dir || return $FAILURE done # Create symlink(s) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_dprintf "$funcname: Creating /boot symlink for GELI..." - f_eval_catch $funcname ln "$LN_SF" \ - \$ZFSBOOT_GELI_POOL_NAME/boot \ - \$BSDINSTALL_CHROOT/boot || return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_dprintf "$funcname: Creating /boot symlink for boot pool..." + f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \ + $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property + local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" f_dprintf "$funcname: Setting bootfs property..." - f_dprintf "$funcname: %s %s" \ - "ZFSBOOT_BEROOT_NAME=[$ZFSBOOT_BEROOT_NAME]" \ - "ZFSBOOT_BOOTFS_NAME=[$ZFSBOOT_BOOTFS_NAME]" f_eval_catch $funcname zpool "$ZPOOL_SET" \ - bootfs=\"\$poolname/\$ZFSBOOT_BEROOT_NAME/\$ZFSBOOT_BOOTFS_NAME\" \ - \$poolname || return $FAILURE + "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || + return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \$poolname || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$bootpool_name" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_quietly gnop destroy $disk$bootpart.nop - else - f_quietly gnop destroy $disk$targetpart.nop + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$bootpart.nop + fi + if [ ! "$ZFSBOOT_GELI_ENCRYPTION" ]; then + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$targetpart.nop fi done - # MBR boot loader hack part 2 + # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." - f_dprintf "$funcname: disks=[%s]" # Stick the ZFS boot loader in the "convienient hole" after # the ZFS internal metadata for disk in $disks; do - f_dprintf "$funcname: disk=[%s] bootpart=[%s]" \ - "$disk" "$bootpart" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\$disk\$bootpart \ + /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done fi @@ -1142,74 +1143,79 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \$poolname || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR - f_dprintf "$funcname: Configuring zpool.cache..." - f_eval_catch $funcname mkdir "$MKDIR_P" \$BSDINSTALL_CHROOT/boot/zfs || + f_dprintf "$funcname: Configuring zpool.cache for zroot..." + f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ - cachefile=\"\$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\" \ - \$poolname || return $FAILURE + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$zroot_name" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ "$funcname" f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_enable=\"YES\"' \ - \$BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE + $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE - # We're all done unless we should go on to do encryption - [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + # We're all done unless we should go on for boot pool + [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS + + # Set cachefile for boot pool so it auto-imports at system start + f_dprintf "$funcname: Configuring zpool.cache for boot pool..." + f_eval_catch $funcname zpool "$ZPOOL_SET" \ + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$bootpool_name" || return $FAILURE # Some additional geli(8) requirements for loader.conf(5) for option in \ - zpool_cache_load=\"YES\" \ - zpool_cache_type=\"/boot/zfs/zpool.cache\" \ - zpool_cache_name=\"/boot/zfs/zpool.cache\" \ + 'zpool_cache_load=\"YES\"' \ + 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ + 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ ; do - f_eval_catch $funcname echo "$ECHO_APPEND" \$option \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || + f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done + f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + + # We're all done unless we should go on to do encryption + [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # # Configure geli(8)-based encryption # f_dprintf "$funcname: Configuring disk encryption..." f_eval_catch $funcname echo "$ECHO_APPEND" 'aesni_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - f_dprintf "$funcname: disks=[%s]" "$disks" + $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE for disk in $disks; do - f_dprintf "$funcname: %s %s %s" \ - "disk=[$disk]" "targetpart=[$targetpart]" \ - "ZFSBOOT_GELI_KEY_FILE=[$ZFSBOOT_GELI_KEY_FILE]" f_eval_catch $funcname printf "$PRINTF_CONF" \ - geli_%s_keyfile0_load '"$disk$targetpart" YES' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + geli_%s_keyfile0_load "$disk$targetpart YES" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart $disk$targetpart:geli_keyfile0" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_name \ - '"$disk$targetpart" "$ZFSBOOT_GELI_KEY_FILE"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart \"$ZFSBOOT_GELI_KEY_FILE\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE done @@ -1258,7 +1264,7 @@ f_dialog_backtitle "$msg_freebsd_install # f_dprintf "BSDINSTALL_CHROOT=[%s]" "$BSDINSTALL_CHROOT" f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC" -f_dprintf "PRINTF_FSTAB=[%s]" "$PRINTF_FSTAB" +f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # # Loop over the main menu until we've accomplished what we came here to do @@ -1296,11 +1302,11 @@ while :; do # Make sure each disk will be at least 50% ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize then minsize=$swapsize teeny_disks= - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - minsize=$(( $minsize + $gelisize )) + [ "$ZFSBOOT_BOOT_POOL" ] && + minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do device_$disk get capacity disksize || continue *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 19:15:24 2013 Return-Path: Delivered-To: svn-src-all@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 D6D2161D; Thu, 19 Dec 2013 19:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B677A1F56; Thu, 19 Dec 2013 19:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJJFOSC065839; Thu, 19 Dec 2013 19:15:24 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJJFOsK065838; Thu, 19 Dec 2013 19:15:24 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312191915.rBJJFOsK065838@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 19 Dec 2013 19:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259622 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 19:15:24 -0000 Author: np Date: Thu Dec 19 19:15:24 2013 New Revision: 259622 URL: http://svnweb.freebsd.org/changeset/base/259622 Log: MFC r259569: cxgbe.4: Belated update to the man page to reflect T5 support. Modified: stable/10/share/man/man4/cxgbe.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Thu Dec 19 18:52:41 2013 (r259621) +++ stable/10/share/man/man4/cxgbe.4 Thu Dec 19 19:15:24 2013 (r259622) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012, Chelsio Inc +.\" Copyright (c) 2011-2013, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd December 18, 2013 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,13 +50,14 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent t4fw_cfg_load="YES" +t5fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 (T4) ASIC. +the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,11 +66,50 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp +Note that ports of T5 cards are named cxl and attach to a t5nex parent device +(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). +Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. +The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and +dev.cxgbe for T4 cards. + +.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC +(ports will be named cxl): +.Pp +.Bl -bullet -compact +.It +Chelsio T580-CR +.It +Chelsio T580-LP-CR +.It +Chelsio T580-LP-SO-CR +.It +Chelsio T560-CR +.It +Chelsio T540-CR +.It +Chelsio T540-LP-CR +.It +Chelsio T522-CR +.It +Chelsio T520-LL-CR +.It +Chelsio T520-CR +.It +Chelsio T520-SO +.It +Chelsio T520-BT +.It +Chelsio T504-BT +.El +.Pp +The +.Nm driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: .Pp .Bl -bullet -compact @@ -139,8 +179,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. -Different cxgbe interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx sysctl. +Different interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -149,8 +189,8 @@ and the index selects a value from this The default value is -1 for both 10Gb and 1Gb ports, which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -161,16 +201,16 @@ software queuing. See .Xr ifnet 9 . The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -231,6 +271,10 @@ The .Nm device driver first appeared in .Fx 9.0 . +Support for T5 cards first appeared in +.Fx 9.2 +and +.Fx 10.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 19:32:04 2013 Return-Path: Delivered-To: svn-src-all@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 0CC3BFD1; Thu, 19 Dec 2013 19:32:04 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 133CA1167; Thu, 19 Dec 2013 19:32:02 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa03.fnfis.com (8.14.5/8.14.5) with ESMTP id rBJJW1kL009643 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 19 Dec 2013 13:32:01 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT05.FNFIS.com ([10.132.206.16]) with mapi id 14.03.0158.001; Thu, 19 Dec 2013 13:32:00 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259479 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO+qdwM2JIT2GF3kyccjUlXq6l7JpcUT6A Date: Thu, 19 Dec 2013 19:31:59 +0000 Message-ID: References: <201312161947.rBGJl4Jh087762@svn.freebsd.org> <52AF6FF6.1030909@freebsd.org> <7BF56E5D-CDE7-4E57-BA47-3565CD07236C@fisglobal.com> <52AF75C1.9040502@freebsd.org> <52AF78B6.20706@freebsd.org> <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> In-Reply-To: <34980C34-1D4F-458E-8931-8080E0395D8E@fisglobal.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <7F811FCEB0BA29448D3CC115A9058813@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-19_07:2013-12-19,2013-12-19,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , Devin Teske , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 19:32:04 -0000 On Dec 18, 2013, at 10:08 PM, Teske, Devin wrote: >=20 > On Dec 16, 2013, at 2:03 PM, Nathan Whitehorn wrote: >=20 >> On 12/16/13 15:55, Teske, Devin wrote: >>> On Dec 16, 2013, at 1:50 PM, Nathan Whitehorn wrote: >>>=20 >>>> On 12/16/13 15:48, Teske, Devin wrote: >>>>> On Dec 16, 2013, at 1:40 PM, Teske, Devin wrote: >>>>>=20 >>>>>> On Dec 16, 2013, at 1:26 PM, Nathan Whitehorn wrote: >>>>>>=20 >>>>>>> On 12/16/13 13:47, Devin Teske wrote: >>>>>>>> Author: dteske >>>>>>>> Date: Mon Dec 16 19:47:04 2013 >>>>>>>> New Revision: 259479 >>>>>>>> URL: http://svnweb.freebsd.org/changeset/base/259479 >>>>>>>>=20 >>>>>>>> Log: >>>>>>>> Add kern.geom.label.disk_ident.enable=3D"0" to loader.conf(5). >>>>>>>> Discussed on: -current, -stable >>>>>>>> MFC after: 3 days >>>>>>>>=20 >>>>>>>> Modified: >>>>>>>> head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>>=20 >>>>>>>> Modified: head/usr.sbin/bsdinstall/scripts/zfsboot >>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >>>>>>>> --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:44:45 2= 013 (r259478) >>>>>>>> +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 16 19:47:04 2= 013 (r259479) >>>>>>>> @@ -1159,6 +1159,9 @@ zfs_create_boot() >>>>>>>> $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE >>>>>>>> f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=3D\"YES\"' \ >>>>>>>> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILU= RE >>>>>>>> + f_eval_catch $funcname echo "$ECHO_APPEND" \ >>>>>>>> + 'kern.geom.label.disk_ident.enable=3D\"0\"' \ >>>>>>>> + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAIL= URE >>>>>>>> # We're all done unless we should go on for boot pool >>>>>>>> [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS >>>>>>> Uh -- what is all of this? Why are we disabling kernel functions de= pending on what the root filesystem is? Please don't MFC this. >>>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.or= g/pipermail/freebsd-stable/2013-December/076365.html&k=3D%2FbkpAUdJWZuiTILC= q%2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D4f16f0d6399e3a3c= 5e105a7869c580884327a8721c2f44c1711b319212a23db7 >>>>>> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://lists.freebsd.or= g/pipermail/freebsd-stable/2013-December/076471.html&k=3D%2FbkpAUdJWZuiTILC= q%2FFnQg%3D%3D%0A&r=3DLTzUWWrRnz2iN3PtHDubWRSAh9itVJ%2BMUcNBCQ4tyeo%3D%0A&m= =3DWCmXzB4036KuOzNScbJsBQLKdo%2BAo15QWLYq4A7DKis%3D%0A&s=3D17882f97e3633c1e= 3ebd45f332e62d2212dc53d1f0577acc4ae15d8234d09c7f >>>>>>=20 >>>>>> NB: Happy to rip it out... but want something in-reply to those thre= ads (pretty please). >>>>> Basically... the logic is... >>>>>=20 >>>>> The ZFS pool is built on vdevs of a specific name. The names that are= used >>>>> should remain the same. Adding this to the loader.conf ensures that t= he names >>>>> that the pool(s) was/were built upon do not change. >>>>>=20 >>>>> This goes beyond just a swap partition I imagine. For example... copy= ing the >>>>> data to a new drive using a duplicator. I'm sure there are other case= s too. >>>> Thanks for the explanation! I wonder if we should just turn off the di= sk ident stuff by default globally -- it was causing problems for me as wel= l without ZFS root. >>> As I was making the commit to zfsboot... the very thought had occurred = to me. >>>=20 >>> I'm happy to rip this out in favor of a new global default. The end-res= ult is that >>> what Johan experienced won't be repeated. >>>=20 >>> I think there's an urgency to get something to solve this into 10. >>=20 >> Yeah, I can see that. Let me bring this up on -CURRENT, with a short tim= eout, and see what the options are. >=20 > Any updates on this? As requested, I have held-back SVN r259479 from the merge process. However, as I'm sure RC3 is approaching, wanted to know if we should continue to look into changing the default (otherwise, we have r259479 available). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 19:39:25 2013 Return-Path: Delivered-To: svn-src-all@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 1C56E3AF; Thu, 19 Dec 2013 19:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFEF311B9; Thu, 19 Dec 2013 19:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJJdO4V073570; Thu, 19 Dec 2013 19:39:24 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJJdOGs073569; Thu, 19 Dec 2013 19:39:24 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312191939.rBJJdOGs073569@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 19 Dec 2013 19:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259623 - releng/10.0/share/man/man4 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 19:39:25 -0000 Author: np Date: Thu Dec 19 19:39:24 2013 New Revision: 259623 URL: http://svnweb.freebsd.org/changeset/base/259623 Log: Merge r259622: cxgbe.4: Belated update to the man page to reflect T5 support. Approved by: re (gjb) Modified: releng/10.0/share/man/man4/cxgbe.4 Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/share/man/man4/cxgbe.4 ============================================================================== --- releng/10.0/share/man/man4/cxgbe.4 Thu Dec 19 19:15:24 2013 (r259622) +++ releng/10.0/share/man/man4/cxgbe.4 Thu Dec 19 19:39:24 2013 (r259623) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2012, Chelsio Inc +.\" Copyright (c) 2011-2013, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd December 18, 2013 .Dt CXGBE 4 .Os .Sh NAME .Nm cxgbe -.Nd "Chelsio T4 10Gb and 1Gb Ethernet adapter driver" +.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,13 +50,14 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent t4fw_cfg_load="YES" +t5fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCI Express Ethernet adapters based on -the Chelsio Terminator 4 (T4) ASIC. +the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN tag insertion/extraction, VLAN checksum offload, VLAN TSO, and @@ -65,11 +66,50 @@ For further hardware information and que requirements, see .Pa http://www.chelsio.com/ . .Pp +Note that ports of T5 cards are named cxl and attach to a t5nex parent device +(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card). +Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards. +The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and +dev.cxgbe for T4 cards. + +.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE The .Nm +driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC +(ports will be named cxl): +.Pp +.Bl -bullet -compact +.It +Chelsio T580-CR +.It +Chelsio T580-LP-CR +.It +Chelsio T580-LP-SO-CR +.It +Chelsio T560-CR +.It +Chelsio T540-CR +.It +Chelsio T540-LP-CR +.It +Chelsio T522-CR +.It +Chelsio T520-LL-CR +.It +Chelsio T520-CR +.It +Chelsio T520-SO +.It +Chelsio T520-BT +.It +Chelsio T504-BT +.El +.Pp +The +.Nm driver supports 10Gb and 1Gb Ethernet adapters based on the T4 ASIC: .Pp .Bl -bullet -compact @@ -139,8 +179,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. -Different cxgbe interfaces can be assigned different values at any time via the -dev.cxgbe.X.holdoff_tmr_idx sysctl. +Different interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -149,8 +189,8 @@ and the index selects a value from this The default value is -1 for both 10Gb and 1Gb ports, which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.holdoff_pktc_idx sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq @@ -161,16 +201,16 @@ software queuing. See .Xr ifnet 9 . The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_txq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl or dev.cxl.X.qsize_txq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. -Different cxgbe interfaces can be assigned different values via the -dev.cxgbe.X.qsize_rxq sysctl. +Different interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq or dev.cxl.X.qsize_rxq sysctl. This sysctl works only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.interrupt_types @@ -231,6 +271,10 @@ The .Nm device driver first appeared in .Fx 9.0 . +Support for T5 cards first appeared in +.Fx 9.2 +and +.Fx 10.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:15:50 2013 Return-Path: Delivered-To: svn-src-all@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 5CB499CA; Thu, 19 Dec 2013 20:15:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4871F151B; Thu, 19 Dec 2013 20:15:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKFojc088298; Thu, 19 Dec 2013 20:15:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKFnTO088296; Thu, 19 Dec 2013 20:15:49 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192015.rBJKFnTO088296@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259624 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:15:50 -0000 Author: edwin Date: Thu Dec 19 20:15:49 2013 New Revision: 259624 URL: http://svnweb.freebsd.org/changeset/base/259624 Log: Vendor import of tzdata2013i: Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Obtained from: ftp://ftp.iana.org/tz/releases/ Deleted: vendor/tzdata/dist/solar87 vendor/tzdata/dist/solar88 vendor/tzdata/dist/solar89 Modified: vendor/tzdata/dist/asia vendor/tzdata/dist/northamerica Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Thu Dec 19 19:39:24 2013 (r259623) +++ vendor/tzdata/dist/asia Thu Dec 19 20:15:49 2013 (r259624) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Thu Dec 19 19:39:24 2013 (r259623) +++ vendor/tzdata/dist/northamerica Thu Dec 19 20:15:49 2013 (r259624) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:18:22 2013 Return-Path: Delivered-To: svn-src-all@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 7EA93B3F; Thu, 19 Dec 2013 20:18:22 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 527F21537; Thu, 19 Dec 2013 20:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKIMOH088612; Thu, 19 Dec 2013 20:18:22 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKIMbU088611; Thu, 19 Dec 2013 20:18:22 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192018.rBJKIMbU088611@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259625 - vendor/tzdata/tzdata2013i X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:18:22 -0000 Author: edwin Date: Thu Dec 19 20:18:21 2013 New Revision: 259625 URL: http://svnweb.freebsd.org/changeset/base/259625 Log: Tag of tzdata2013i sources Added: vendor/tzdata/tzdata2013i/ - copied from r259624, vendor/tzdata/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:19:58 2013 Return-Path: Delivered-To: svn-src-all@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 2AAFCC92; Thu, 19 Dec 2013 20:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 163731553; Thu, 19 Dec 2013 20:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKJv7S088806; Thu, 19 Dec 2013 20:19:57 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKJvkI088804; Thu, 19 Dec 2013 20:19:57 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192019.rBJKJvkI088804@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259626 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:19:58 -0000 Author: edwin Date: Thu Dec 19 20:19:57 2013 New Revision: 259626 URL: http://svnweb.freebsd.org/changeset/base/259626 Log: MFV of r259624, tzdata2013i Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: head/contrib/tzdata/asia head/contrib/tzdata/northamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Dec 19 20:18:21 2013 (r259625) +++ head/contrib/tzdata/asia Thu Dec 19 20:19:57 2013 (r259626) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Thu Dec 19 20:18:21 2013 (r259625) +++ head/contrib/tzdata/northamerica Thu Dec 19 20:19:57 2013 (r259626) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:25:50 2013 Return-Path: Delivered-To: svn-src-all@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 654BAE53; Thu, 19 Dec 2013 20:25:50 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5076E15E1; Thu, 19 Dec 2013 20:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKPoRO091995; Thu, 19 Dec 2013 20:25:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKPnl6091993; Thu, 19 Dec 2013 20:25:49 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192025.rBJKPnl6091993@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r259627 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:25:50 -0000 Author: edwin Date: Thu Dec 19 20:25:49 2013 New Revision: 259627 URL: http://svnweb.freebsd.org/changeset/base/259627 Log: MFC of 259626, tzdata2013i: Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Modified: stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/northamerica Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Thu Dec 19 20:19:57 2013 (r259626) +++ stable/6/share/zoneinfo/asia Thu Dec 19 20:25:49 2013 (r259627) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: stable/6/share/zoneinfo/northamerica ============================================================================== --- stable/6/share/zoneinfo/northamerica Thu Dec 19 20:19:57 2013 (r259626) +++ stable/6/share/zoneinfo/northamerica Thu Dec 19 20:25:49 2013 (r259627) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:26:01 2013 Return-Path: Delivered-To: svn-src-all@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 38A6DF34; Thu, 19 Dec 2013 20:26:01 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2473D15E4; Thu, 19 Dec 2013 20:26:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKQ1mS092104; Thu, 19 Dec 2013 20:26:01 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKQ0h0092099; Thu, 19 Dec 2013 20:26:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192026.rBJKQ0h0092099@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:26:00 +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: r259629 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:26:01 -0000 Author: edwin Date: Thu Dec 19 20:26:00 2013 New Revision: 259629 URL: http://svnweb.freebsd.org/changeset/base/259629 Log: MFC of 259626, tzdata2013i: Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/northamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Thu Dec 19 20:25:55 2013 (r259628) +++ stable/8/share/zoneinfo/asia Thu Dec 19 20:26:00 2013 (r259629) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Thu Dec 19 20:25:55 2013 (r259628) +++ stable/8/share/zoneinfo/northamerica Thu Dec 19 20:26:00 2013 (r259629) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:26:07 2013 Return-Path: Delivered-To: svn-src-all@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 4C044F4; Thu, 19 Dec 2013 20:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 375BC15E7; Thu, 19 Dec 2013 20:26:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKQ75s092163; Thu, 19 Dec 2013 20:26:07 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKQ6uR092161; Thu, 19 Dec 2013 20:26:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192026.rBJKQ6uR092161@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:26: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: r259630 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:26:07 -0000 Author: edwin Date: Thu Dec 19 20:26:06 2013 New Revision: 259630 URL: http://svnweb.freebsd.org/changeset/base/259630 Log: MFC of 259626, tzdata2013i: Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/northamerica Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Thu Dec 19 20:26:00 2013 (r259629) +++ stable/9/contrib/tzdata/asia Thu Dec 19 20:26:06 2013 (r259630) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Thu Dec 19 20:26:00 2013 (r259629) +++ stable/9/contrib/tzdata/northamerica Thu Dec 19 20:26:06 2013 (r259630) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:25:56 2013 Return-Path: Delivered-To: svn-src-all@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 124B4E56; Thu, 19 Dec 2013 20:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F171F15E2; Thu, 19 Dec 2013 20:25:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJKPt48092042; Thu, 19 Dec 2013 20:25:55 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJKPtPp092040; Thu, 19 Dec 2013 20:25:55 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192025.rBJKPtPp092040@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 20:25:55 +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: r259628 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:25:56 -0000 Author: edwin Date: Thu Dec 19 20:25:55 2013 New Revision: 259628 URL: http://svnweb.freebsd.org/changeset/base/259628 Log: MFC of 259626, tzdata2013i: Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Modified: stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/northamerica Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Thu Dec 19 20:25:49 2013 (r259627) +++ stable/7/share/zoneinfo/asia Thu Dec 19 20:25:55 2013 (r259628) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: stable/7/share/zoneinfo/northamerica ============================================================================== --- stable/7/share/zoneinfo/northamerica Thu Dec 19 20:25:49 2013 (r259627) +++ stable/7/share/zoneinfo/northamerica Thu Dec 19 20:25:55 2013 (r259628) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 20:47:07 2013 Return-Path: Delivered-To: svn-src-all@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 EE8BA8FD; Thu, 19 Dec 2013 20:47:07 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFEF175E; Thu, 19 Dec 2013 20:47:06 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBJKklVI054671; Thu, 19 Dec 2013 21:47:02 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B35B37.5070809@FreeBSD.org> Date: Thu, 19 Dec 2013 21:46:47 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Stefan Esser , Bruce Evans Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> In-Reply-To: <52B32647.2030008@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:47:08 -0000 On 19.12.13 18:00, Stefan Esser wrote: > I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the > missing empty line: > > static __inline sbintime_t > timer2sbintime(intptr_t data) > { > > if (data > INT64_MAX / SBT_1MS) > return INT64_MAX; > return (SBT_1MS * data); > } > > If you can show evidence that a limit of INT64_MAX/2 is more appropriate > (2^30 seconds or 34 years), the limit could be of course be reduced to > that value. > > I could not find any code that would not tolerate INT64_MAX, though ... Aehm, what about 32-bit systems where intptr_t == __int32_t? cc1: warnings being treated as errors /export/devel/fbsd/src/sys/kern/kern_event.c: In function 'timer2sbintime': /export/devel/fbsd/src/sys/kern/kern_event.c:529: warning: comparison is always false due to limited range of data type Andreas From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 21:03:09 2013 Return-Path: Delivered-To: svn-src-all@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 3F1B71A4; Thu, 19 Dec 2013 21:03: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7BF18D9; Thu, 19 Dec 2013 21:03:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJL396Z006403; Thu, 19 Dec 2013 21:03:09 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJL39fS006402; Thu, 19 Dec 2013 21:03:09 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312192103.rBJL39fS006402@svn.freebsd.org> From: Peter Wemm Date: Thu, 19 Dec 2013 21:03: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: r259631 - stable/10/contrib/jemalloc/include/jemalloc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 21:03:09 -0000 Author: peter Date: Thu Dec 19 21:03:08 2013 New Revision: 259631 URL: http://svnweb.freebsd.org/changeset/base/259631 Log: MF9: Don't fail to build if MALLOC_PRODUCTION is defined in make.conf Modified: stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Dec 19 20:26:06 2013 (r259630) +++ stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Dec 19 21:03:08 2013 (r259631) @@ -4,7 +4,9 @@ #undef JEMALLOC_OVERRIDE_VALLOC +#ifndef MALLOC_PRODUCTION #define MALLOC_PRODUCTION +#endif #ifndef MALLOC_PRODUCTION #define JEMALLOC_DEBUG From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 21:16:07 2013 Return-Path: Delivered-To: svn-src-all@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 68A0F6EB for ; Thu, 19 Dec 2013 21:16:07 +0000 (UTC) Received: from nm10.bullet.mail.ir2.yahoo.com (nm10.bullet.mail.ir2.yahoo.com [212.82.96.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B73F119FB for ; Thu, 19 Dec 2013 21:16:06 +0000 (UTC) Received: from [212.82.98.53] by nm10.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 Received: from [46.228.39.67] by tm6.bullet.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 Received: from [127.0.0.1] by smtp104.mail.ir2.yahoo.com with NNFMP; 19 Dec 2013 21:16:01 -0000 X-Yahoo-Newman-Id: 711372.81079.bm@smtp104.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 7aN3Mn4VM1keX5aDXr7VNkRUBScDk8.pf_IIEuMfCl7XShC 4ilJGLJ7fKbB8lntFGHoy5lzAEjlOjxqbeGI.96v4pIN5kJflooZPIiJ34rn S_xgDDNG0GiUzU0H7NO.mLTkQ5w4ZAihlGneb0FmXbXUCi7W9ljxxkyr_j_C FBo2f0c20tkgobljYR1feHUyIZmMngX6aQckGSalQVD7HFbltWqlda7os43y qu._zY9i8RQNYLO.9vcRLODzt7u4SA6rst2Yf8ZihwmN4gabmcpaapJ3tFnL s0Vvpv5LFI_2Kyqp.re6ZDP3D44.4hhh8XbG_D2Za470Ugm.5VPrStFShNlJ ROcnOi_us32YeC2XFA7Afaoi1bq74zAUl9RBSIVUcBnmT9K9PmD1dfL4g43p 37i6dPrBb7qSx2Fuywcw0wYw2fzURqZ8isuSUIPk8_FnN6Lyyz1THl4Edp01 7._ekJdYVQpEWkfUSP9JWZDyHXfueLMMzIZN1sHD_gdqDqkjsXGfnMDUX7NI aHPk_X3.T49eLE1CIDy.MJC0PdOWAeA-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.11] (se@84.154.112.54 with plain [188.125.69.59]) by smtp104.mail.ir2.yahoo.com with SMTP; 19 Dec 2013 21:16:01 +0000 UTC Message-ID: <52B3620A.8050603@freebsd.org> Date: Thu, 19 Dec 2013 22:15:54 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Andreas Tobler , Bruce Evans Subject: Re: svn commit: r259609 - head/sys/kern References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> <52B35B37.5070809@FreeBSD.org> In-Reply-To: <52B35B37.5070809@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 21:16:07 -0000 Am 19.12.2013 21:46, schrieb Andreas Tobler: > On 19.12.13 18:00, Stefan Esser wrote: > >> I'd replace the two occurances of LLONG_MAX with INT64_MAX and add the >> missing empty line: >> >> static __inline sbintime_t >> timer2sbintime(intptr_t data) >> { >> >> if (data > INT64_MAX / SBT_1MS) >> return INT64_MAX; >> return (SBT_1MS * data); >> } >> >> If you can show evidence that a limit of INT64_MAX/2 is more appropriate >> (2^30 seconds or 34 years), the limit could be of course be reduced to >> that value. >> >> I could not find any code that would not tolerate INT64_MAX, though ... > > Aehm, what about 32-bit systems where intptr_t == __int32_t? > > cc1: warnings being treated as errors > /export/devel/fbsd/src/sys/kern/kern_event.c: In function 'timer2sbintime': > /export/devel/fbsd/src/sys/kern/kern_event.c:529: warning: comparison is > always false due to limited range of data type You are right, this needs to be fixed, too :( I see two possibilities: 1) Conditional compilation: There is no need to check an upper bound on ILP32 architectures. INT32_MAX seconds can be expressed as sbintime. Architectures where intptr_t has at least 48 bits will support the maximum time that can be expressed in sbintime and the comparison can be left as is for them. 2) Calculate the upper bound in such a way, that it is guaranteed to be lower than the highest value that can be expressed as intptr_t. This value is (INT32_MAX - 1) on 32 bit architectures, while it remains (INT64_MAX / SBT_1MS) on 64 bit architectures. I'm afraid that the warning emitted for 32 bit architectures will cause tinderbox build failures, but I haven't seen a failure message, yet. Should I back-out the commit that added the range check? As long as -fno-strict-overflow is not put back into CFLAGS, the test is not strictly required (only for the extremely unlikely case that a number > 1000 * MAX32_INT results in an extremely short remainder after multiplication with SBT_1MS modulo 32 ...). Regards, STefan NB: I should have known better and should have asked for a review of this change before it wa committed. Sorry for the inconvenience caused :( From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 21:31:29 2013 Return-Path: Delivered-To: svn-src-all@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 01ACF981; Thu, 19 Dec 2013 21:31:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D60411AFE; Thu, 19 Dec 2013 21:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJLVS8Q017206; Thu, 19 Dec 2013 21:31:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJLVSZr017205; Thu, 19 Dec 2013 21:31:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312192131.rBJLVSZr017205@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Dec 2013 21:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259632 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 21:31:29 -0000 Author: mav Date: Thu Dec 19 21:31:28 2013 New Revision: 259632 URL: http://svnweb.freebsd.org/changeset/base/259632 Log: Rework flow control for connection-oriented (TCP) RPC server. When processing receive buffer, write the amount of data, expected in present request record, into socket's so_rcv.sb_lowat to make stack aware about our needs. When processing following upcalls, ignore them until socket collect enough data to be read and processed in one turn. This change reduces number of context switches and other operations in RPC stack during large NFS writes (especially via non-Jumbo networks) by order of magnitude. After precessing current packet, take another look into the pending buffer to find out whether the next packet had been already received. If not, deactivate this port right there without making RPC code to push this port to another thread just to find that there is nothing. If the next packet is received partially, also deactivate the port, but also update socket's so_rcv.sb_lowat to not be woken up prematurely. This change additionally reduces number of context switches per NFS request about in half. Modified: head/sys/rpc/svc_vc.c Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Thu Dec 19 21:03:08 2013 (r259631) +++ head/sys/rpc/svc_vc.c Thu Dec 19 21:31:28 2013 (r259632) @@ -381,15 +381,11 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st * We must re-test for new connections after taking * the lock to protect us in the case where a new * connection arrives after our call to accept fails - * with EWOULDBLOCK. The pool lock protects us from - * racing the upcall after our TAILQ_EMPTY() call - * returns false. + * with EWOULDBLOCK. */ ACCEPT_LOCK(); - mtx_lock(&xprt->xp_pool->sp_lock); if (TAILQ_EMPTY(&xprt->xp_socket->so_comp)) - xprt_inactive_locked(xprt); - mtx_unlock(&xprt->xp_pool->sp_lock); + xprt_inactive(xprt); ACCEPT_UNLOCK(); sx_xunlock(&xprt->xp_lock); return (FALSE); @@ -526,35 +522,14 @@ static enum xprt_stat svc_vc_stat(SVCXPRT *xprt) { struct cf_conn *cd; - struct mbuf *m; - size_t n; cd = (struct cf_conn *)(xprt->xp_p1); if (cd->strm_stat == XPRT_DIED) return (XPRT_DIED); - /* - * Return XPRT_MOREREQS if we have buffered data and we are - * mid-record or if we have enough data for a record - * marker. Since this is only a hint, we read mpending and - * resid outside the lock. We do need to take the lock if we - * have to traverse the mbuf chain. - */ - if (cd->mpending) { - if (cd->resid) - return (XPRT_MOREREQS); - n = 0; - sx_xlock(&xprt->xp_lock); - m = cd->mpending; - while (m && n < sizeof(uint32_t)) { - n += m->m_len; - m = m->m_next; - } - sx_xunlock(&xprt->xp_lock); - if (n >= sizeof(uint32_t)) - return (XPRT_MOREREQS); - } + if (cd->mreq != NULL && cd->resid == 0 && cd->eor) + return (XPRT_MOREREQS); if (soreadable(xprt->xp_socket)) return (XPRT_MOREREQS); @@ -575,6 +550,78 @@ svc_vc_backchannel_stat(SVCXPRT *xprt) return (XPRT_IDLE); } +/* + * If we have an mbuf chain in cd->mpending, try to parse a record from it, + * leaving the result in cd->mreq. If we don't have a complete record, leave + * the partial result in cd->mreq and try to read more from the socket. + */ +static void +svc_vc_process_pending(SVCXPRT *xprt) +{ + struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; + struct socket *so = xprt->xp_socket; + struct mbuf *m; + + /* + * If cd->resid is non-zero, we have part of the + * record already, otherwise we are expecting a record + * marker. + */ + if (!cd->resid && cd->mpending) { + /* + * See if there is enough data buffered to + * make up a record marker. Make sure we can + * handle the case where the record marker is + * split across more than one mbuf. + */ + size_t n = 0; + uint32_t header; + + m = cd->mpending; + while (n < sizeof(uint32_t) && m) { + n += m->m_len; + m = m->m_next; + } + if (n < sizeof(uint32_t)) { + so->so_rcv.sb_lowat = sizeof(uint32_t) - n; + return; + } + m_copydata(cd->mpending, 0, sizeof(header), + (char *)&header); + header = ntohl(header); + cd->eor = (header & 0x80000000) != 0; + cd->resid = header & 0x7fffffff; + m_adj(cd->mpending, sizeof(uint32_t)); + } + + /* + * Start pulling off mbufs from cd->mpending + * until we either have a complete record or + * we run out of data. We use m_split to pull + * data - it will pull as much as possible and + * split the last mbuf if necessary. + */ + while (cd->mpending && cd->resid) { + m = cd->mpending; + if (cd->mpending->m_next + || cd->mpending->m_len > cd->resid) + cd->mpending = m_split(cd->mpending, + cd->resid, M_WAITOK); + else + cd->mpending = NULL; + if (cd->mreq) + m_last(cd->mreq)->m_next = m; + else + cd->mreq = m; + while (m) { + cd->resid -= m->m_len; + m = m->m_next; + } + } + + so->so_rcv.sb_lowat = imax(1, imin(cd->resid, so->so_rcv.sb_hiwat / 2)); +} + static bool_t svc_vc_recv(SVCXPRT *xprt, struct rpc_msg *msg, struct sockaddr **addrp, struct mbuf **mp) @@ -582,6 +629,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1; struct uio uio; struct mbuf *m; + struct socket* so = xprt->xp_socket; XDR xdrs; int error, rcvflag; @@ -592,99 +640,40 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms sx_xlock(&xprt->xp_lock); for (;;) { - /* - * If we have an mbuf chain in cd->mpending, try to parse a - * record from it, leaving the result in cd->mreq. If we don't - * have a complete record, leave the partial result in - * cd->mreq and try to read more from the socket. - */ - if (cd->mpending) { - /* - * If cd->resid is non-zero, we have part of the - * record already, otherwise we are expecting a record - * marker. - */ - if (!cd->resid) { - /* - * See if there is enough data buffered to - * make up a record marker. Make sure we can - * handle the case where the record marker is - * split across more than one mbuf. - */ - size_t n = 0; - uint32_t header; - - m = cd->mpending; - while (n < sizeof(uint32_t) && m) { - n += m->m_len; - m = m->m_next; - } - if (n < sizeof(uint32_t)) - goto readmore; - m_copydata(cd->mpending, 0, sizeof(header), - (char *)&header); - header = ntohl(header); - cd->eor = (header & 0x80000000) != 0; - cd->resid = header & 0x7fffffff; - m_adj(cd->mpending, sizeof(uint32_t)); - } - - /* - * Start pulling off mbufs from cd->mpending - * until we either have a complete record or - * we run out of data. We use m_split to pull - * data - it will pull as much as possible and - * split the last mbuf if necessary. - */ - while (cd->mpending && cd->resid) { - m = cd->mpending; - if (cd->mpending->m_next - || cd->mpending->m_len > cd->resid) - cd->mpending = m_split(cd->mpending, - cd->resid, M_WAITOK); - else - cd->mpending = NULL; - if (cd->mreq) - m_last(cd->mreq)->m_next = m; - else - cd->mreq = m; - while (m) { - cd->resid -= m->m_len; - m = m->m_next; - } + /* If we have no request ready, check pending queue. */ + while (cd->mpending && + (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) + svc_vc_process_pending(xprt); + + /* Process and return complete request in cd->mreq. */ + if (cd->mreq != NULL && cd->resid == 0 && cd->eor) { + + xdrmbuf_create(&xdrs, cd->mreq, XDR_DECODE); + cd->mreq = NULL; + + /* Check for next request in a pending queue. */ + svc_vc_process_pending(xprt); + if (cd->mreq == NULL || cd->resid != 0) { + SOCKBUF_LOCK(&so->so_rcv); + if (!soreadable(so)) + xprt_inactive(xprt); + SOCKBUF_UNLOCK(&so->so_rcv); } - /* - * If cd->resid is zero now, we have managed to - * receive a record fragment from the stream. Check - * for the end-of-record mark to see if we need more. - */ - if (cd->resid == 0) { - if (!cd->eor) - continue; - - /* - * Success - we have a complete record in - * cd->mreq. - */ - xdrmbuf_create(&xdrs, cd->mreq, XDR_DECODE); - cd->mreq = NULL; - sx_xunlock(&xprt->xp_lock); - - if (! xdr_callmsg(&xdrs, msg)) { - XDR_DESTROY(&xdrs); - return (FALSE); - } + sx_xunlock(&xprt->xp_lock); - *addrp = NULL; - *mp = xdrmbuf_getall(&xdrs); + if (! xdr_callmsg(&xdrs, msg)) { XDR_DESTROY(&xdrs); - - return (TRUE); + return (FALSE); } + + *addrp = NULL; + *mp = xdrmbuf_getall(&xdrs); + XDR_DESTROY(&xdrs); + + return (TRUE); } - readmore: /* * The socket upcall calls xprt_active() which will eventually * cause the server to call us here. We attempt to @@ -697,8 +686,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms uio.uio_td = curthread; m = NULL; rcvflag = MSG_DONTWAIT; - error = soreceive(xprt->xp_socket, NULL, &uio, &m, NULL, - &rcvflag); + error = soreceive(so, NULL, &uio, &m, NULL, &rcvflag); if (error == EWOULDBLOCK) { /* @@ -706,25 +694,23 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_ms * taking the lock to protect us in the case * where a new packet arrives on the socket * after our call to soreceive fails with - * EWOULDBLOCK. The pool lock protects us from - * racing the upcall after our soreadable() - * call returns false. + * EWOULDBLOCK. */ - mtx_lock(&xprt->xp_pool->sp_lock); - if (!soreadable(xprt->xp_socket)) - xprt_inactive_locked(xprt); - mtx_unlock(&xprt->xp_pool->sp_lock); + SOCKBUF_LOCK(&so->so_rcv); + if (!soreadable(so)) + xprt_inactive(xprt); + SOCKBUF_UNLOCK(&so->so_rcv); sx_xunlock(&xprt->xp_lock); return (FALSE); } if (error) { - SOCKBUF_LOCK(&xprt->xp_socket->so_rcv); + SOCKBUF_LOCK(&so->so_rcv); if (xprt->xp_upcallset) { xprt->xp_upcallset = 0; - soupcall_clear(xprt->xp_socket, SO_RCV); + soupcall_clear(so, SO_RCV); } - SOCKBUF_UNLOCK(&xprt->xp_socket->so_rcv); + SOCKBUF_UNLOCK(&so->so_rcv); xprt_inactive(xprt); cd->strm_stat = XPRT_DIED; sx_xunlock(&xprt->xp_lock); @@ -908,7 +894,8 @@ svc_vc_soupcall(struct socket *so, void { SVCXPRT *xprt = (SVCXPRT *) arg; - xprt_active(xprt); + if (soreadable(xprt->xp_socket)) + xprt_active(xprt); return (SU_OK); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 21:35:34 2013 Return-Path: Delivered-To: svn-src-all@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 1BFCFCC8; Thu, 19 Dec 2013 21:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 086E41B2A; Thu, 19 Dec 2013 21:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJLZXlJ018294; Thu, 19 Dec 2013 21:35:33 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJLZX77018293; Thu, 19 Dec 2013 21:35:33 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201312192135.rBJLZX77018293@svn.freebsd.org> From: Stefan Esser Date: Thu, 19 Dec 2013 21:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259633 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 21:35:34 -0000 Author: se Date: Thu Dec 19 21:35:33 2013 New Revision: 259633 URL: http://svnweb.freebsd.org/changeset/base/259633 Log: Fix compilation on 32 bit architectures and use INT64_MAX instead of LONG_MAX for the upper bound check. Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Dec 19 21:31:28 2013 (r259632) +++ head/sys/kern/kern_event.c Thu Dec 19 21:35:33 2013 (r259633) @@ -523,11 +523,14 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ -static __inline sbintime_t +static __inline sbintime_t timer2sbintime(intptr_t data) { - if (data > LLONG_MAX / SBT_1MS) - return LLONG_MAX; + +#ifdef __LP64__ + if (data > INT64_MAX / SBT_1MS) + return INT64_MAX; +#endif return (SBT_1MS * data); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 22:13:12 2013 Return-Path: Delivered-To: svn-src-all@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 E915153E; Thu, 19 Dec 2013 22:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D51831E89; Thu, 19 Dec 2013 22:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJMDCYC033047; Thu, 19 Dec 2013 22:13:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJMDCYZ033046; Thu, 19 Dec 2013 22:13:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312192213.rBJMDCYZ033046@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 19 Dec 2013 22:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259634 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 22:13:13 -0000 Author: ae Date: Thu Dec 19 22:13:12 2013 New Revision: 259634 URL: http://svnweb.freebsd.org/changeset/base/259634 Log: Prevent users from deactivating the last component of a mirror. PR: 184985 MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 19 21:35:33 2013 (r259633) +++ head/sys/geom/mirror/g_mirror_ctl.c Thu Dec 19 22:13:12 2013 (r259634) @@ -695,7 +695,7 @@ g_mirror_ctl_deactivate(struct gctl_req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -716,6 +716,7 @@ g_mirror_ctl_deactivate(struct gctl_req gctl_error(req, "No such device: %s.", name); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -728,6 +729,16 @@ g_mirror_ctl_deactivate(struct gctl_req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't deactivate the " + "last ACTIVE component %s.", + sc->sc_geom->name, name); + continue; + } + } disk->d_flags |= G_MIRROR_DISK_FLAG_INACTIVE; disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; g_mirror_update_metadata(disk); From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 22:27:29 2013 Return-Path: Delivered-To: svn-src-all@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 5BD929F8; Thu, 19 Dec 2013 22:27:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0C51F68; Thu, 19 Dec 2013 22:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJMRTRO037102; Thu, 19 Dec 2013 22:27:29 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJMRS0O037097; Thu, 19 Dec 2013 22:27:28 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312192227.rBJMRS0O037097@svn.freebsd.org> From: Neel Natu Date: Thu, 19 Dec 2013 22:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259635 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 22:27:29 -0000 Author: neel Date: Thu Dec 19 22:27:28 2013 New Revision: 259635 URL: http://svnweb.freebsd.org/changeset/base/259635 Log: Add an option to ignore accesses by the guest to unimplemented MSRs. Also, ignore a couple of SandyBridge uncore PMC MSRs that Centos 6.4 writes to during boot. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/xmsr.c head/usr.sbin/bhyve/xmsr.h Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/bhyve.8 Thu Dec 19 22:27:28 2013 (r259635) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehAHPW +.Op Fl aehwAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu @@ -229,6 +229,8 @@ Force .Nm to exit when a guest issues an access to an I/O port that is not emulated. This is intended for debug purposes. +.It Fl w +Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl h Print help message and exit. .It Ar vmname Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/bhyverun.c Thu Dec 19 22:27:28 2013 (r259635) @@ -87,6 +87,7 @@ static int guest_vmexit_on_hlt, guest_vm static int virtio_msix = 1; static int strictio; +static int strictmsr = 1; static int acpi; @@ -122,7 +123,7 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-S ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" @@ -137,7 +138,8 @@ usage(int code) " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -l: LPC device configuration\n" - " -m: memory size in MB\n", + " -m: memory size in MB\n" + " -w: ignore unimplemented MSRs\n", progname, (int)strlen(progname), ""); exit(code); @@ -310,20 +312,43 @@ vmexit_inout(struct vmctx *ctx, struct v static int vmexit_rdmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - fprintf(stderr, "vm exit rdmsr 0x%x, cpu %d\n", vme->u.msr.code, - *pvcpu); - return (VMEXIT_ABORT); + uint64_t val; + uint32_t eax, edx; + int error; + + val = 0; + error = emulate_rdmsr(ctx, *pvcpu, vme->u.msr.code, &val); + if (error != 0) { + fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", + vme->u.msr.code, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + + eax = val; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RAX, eax); + assert(error == 0); + + edx = val >> 32; + error = vm_set_register(ctx, *pvcpu, VM_REG_GUEST_RDX, edx); + assert(error == 0); + + return (VMEXIT_CONTINUE); } static int vmexit_wrmsr(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { - int newcpu; - int retval = VMEXIT_CONTINUE; - - newcpu = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code,vme->u.msr.wval); + int error; - return (retval); + error = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code, vme->u.msr.wval); + if (error != 0) { + fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", + vme->u.msr.code, vme->u.msr.wval, *pvcpu); + if (strictmsr) + return (VMEXIT_ABORT); + } + return (VMEXIT_CONTINUE); } static int @@ -577,7 +602,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:S:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -636,6 +661,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'w': + strictmsr = 0; + break; case 'W': virtio_msix = 0; break; Modified: head/usr.sbin/bhyve/xmsr.c ============================================================================== --- head/usr.sbin/bhyve/xmsr.c Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/xmsr.c Thu Dec 19 22:27:28 2013 (r259635) @@ -43,6 +43,19 @@ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val) { - printf("Unknown WRMSR code %x, val %lx, cpu %d\n", code, val, vcpu); - exit(1); + switch (code) { + case 0xd04: /* Sandy Bridge uncore PMC MSRs */ + case 0xc24: + return (0); + default: + break; + } + return (-1); +} + +int +emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val) +{ + + return (-1); } Modified: head/usr.sbin/bhyve/xmsr.h ============================================================================== --- head/usr.sbin/bhyve/xmsr.h Thu Dec 19 22:13:12 2013 (r259634) +++ head/usr.sbin/bhyve/xmsr.h Thu Dec 19 22:27:28 2013 (r259635) @@ -30,5 +30,6 @@ #define _XMSR_H_ int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val); +int emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 22:36:02 2013 Return-Path: Delivered-To: svn-src-all@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 9F465CF4; Thu, 19 Dec 2013 22:36:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 566C51020; Thu, 19 Dec 2013 22:36:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 26C6AB94C; Thu, 19 Dec 2013 17:36:01 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Date: Thu, 19 Dec 2013 15:52:03 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> In-Reply-To: <20131219115735.GN29088@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312191552.04202.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 19 Dec 2013 17:36:01 -0500 (EST) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 22:36:02 -0000 On Thursday, December 19, 2013 6:57:35 am Gleb Smirnoff wrote: > On Wed, Dec 18, 2013 at 04:40:52PM -0500, John Baldwin wrote: > J> On Wednesday, December 18, 2013 3:07:58 pm Alexander V. Chernikov wrote: > J> > On 18.12.2013 22:45, John-Mark Gurney wrote: > J> > > Alexander V. Chernikov wrote this message on Wed, Dec 18, 2013 at 18:25 +0000: > J> > >> Author: melifaro > J> > >> Date: Wed Dec 18 18:25:27 2013 > J> > >> New Revision: 259562 > J> > >> URL: http://svnweb.freebsd.org/changeset/base/259562 > J> > >> > J> > >> Log: > J> > >> Switch netstat -rn to use standard API for retrieving list of routes > J> > >> instead of peeking inside in-kernel radix via kget. > J> > >> This permits us to change kernel structures without breaking userland. > J> > >> Additionally, this change provide more reliable and faster output. > J> > >> > J> > >> `Refs` and `Use` fields available in IPv4 by default (and via -W > J> > >> for other families) were removed. `Refs` is radix-specific thing > J> > >> which is not informative for users. `Use` field value is handy sometimes, > J> > >> but a) current API does not support it and b) I'm not sure we will > J> > >> support per-rte pcpu counters in near future. > J> > >> > J> > >> Old method of retrieving data is still supported (either by defining > J> > >> NewTree=0 or running netstat with -A). However, Refs/Use fields are > J> > >> hidden. > J> > >> > J> > >> Sponsored by: Yandex LLC > J> > >> MFC after: 4 weeks > J> > >> PR: kern/167204 > J> > > > J> > > How will this impact the use of netstat -rn -M vmcore -N kernel ? Will > J> > > this change make it not usable, or will you still automatically use > J> > Well. It will probably break in (maybe, near) future. > J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's > J> fine if kvm mode is fragile and requires the binary to be in sync with the > J> kernel and is only used for crash dumps, but it is very useful to extract > J> all sorts of info out of a crash dump. > > The problem is that these tools (netstat, and some others) prevent us from > improving the kernel network stack. We can't make improvements that are > mergeable to stable/x branch, since the tools would be broken. No, I explicitly said "it's fine if the kvm mode is fragile and requires the binary to be in sync and is only used for crash dumps". That means it's fine to merge changes as long as you merge the whole thing together. It also means you don't have to support all possible internal kernel ABIs in a branch. > Moreover > any improvement in head/, requires from developer additional work in netstat > code, which I must admit isn't a pleasure to work with. Well, yes, there all sorts of things like, say, documentation that one has to do beyond the original hacking in order to make a logical change more complete. Plus, if you think writing netstat stuff in C is bad, try writing the equivalent in kgdb scripts instead (which is what you'd need to do to provide equivalent functionality) > I agree that usage of tools on vmcores is useful. But we all should agree that > it has very limited use. Only kernel hackers and developers are expected to > do this. If users enable crashinfo then they all run this for each crash, so not just developers. Having worked in an environment with hundreds of crashes per day, having some post-processed output to dig through rather than firing up kgdb every time is quite valuable. > My suggestion is that all this code is deleted from src/usr.bin/netstat, and > moved to src/tools, and we relax assertion that src/tools must be compatible > with any kernel within the branch. So, any person who wants this functionality, > needs to keep his src/tools in sync with kernel and compile a tool when he > desires to dump routing table from a vmcore. That is mostly what I suggested in terms of not having the same ABI guarantees, but I still want crashinfo to provide a comprehensive set of details to developers so that users can just mail that file to a developer without having to be walked through intricate gdb gymnastics. > Finally, when we remove all the kvm(3) usage from a tool, then we can remove > the sugid bit from it, which would be a another fine point. That is 100% irrelevant to crash dumps. I only ask that the KVM mode needs to work for crash dumps. I am more than happy for all "live" access to use sysctls instead of kvm and to not need the set-gid bit as a result. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 23:29:35 2013 Return-Path: Delivered-To: svn-src-all@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 ED4ECB0E; Thu, 19 Dec 2013 23:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D70701354; Thu, 19 Dec 2013 23:29:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJNTY15058975; Thu, 19 Dec 2013 23:29:34 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJNTYwP058973; Thu, 19 Dec 2013 23:29:34 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201312192329.rBJNTYwP058973@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Dec 2013 23:29: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: r259636 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 23:29:35 -0000 Author: edwin Date: Thu Dec 19 23:29:34 2013 New Revision: 259636 URL: http://svnweb.freebsd.org/changeset/base/259636 Log: MFC of 259626, tzdata2013i Removed support for solar-time-based time zones Jordan stays at summer time this year. Fix historical data for Cuba Modified: stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/northamerica Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Thu Dec 19 22:27:28 2013 (r259635) +++ stable/10/contrib/tzdata/asia Thu Dec 19 23:29:34 2013 (r259636) @@ -1380,12 +1380,22 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # switch back to standard time this winter, so the will stay on DST # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 -# -# From Paul Eggert (2013-09-21): -# It's looking like this change will be permanent; see -# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) -# . -# So move Jordan to UTC+3 as of the abovementioned date. + +# From Steffen Thorsen (2013-12-11): +# Jordan Times and other sources say that Jordan is going back to +# UTC+2 on 2013-12-19 at midnight: +# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime +# Official, in Arabic: +# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14 +# ... Our background/permalink about it +# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html +# ... +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P +# ... says midnight for the coming one and 1:00 for the ones in the future +# (and they will use DST again next year, using the normal schedule). + +# From Paul Eggert (2013-12-11): +# As Steffen suggested, consider the past 21-month experiment to be DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,11 +1425,13 @@ Rule Jordan 2002 2012 - Mar lastThu 24:0 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 only - Dec 20 0:00 0 - +Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2014 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT 2012 Oct 26 0:00s - 3:00 - AST + 2:00 Jordan EE%sT # Kazakhstan Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Thu Dec 19 22:27:28 2013 (r259635) +++ stable/10/contrib/tzdata/northamerica Thu Dec 19 23:29:34 2013 (r259636) @@ -2665,6 +2665,11 @@ Zone America/Costa_Rica -5:36:13 - LMT 1 # to DST--and one more hour on 1999-04-04--when the announcers will have # returned to Baltimore, which switches on that date.) +# From Steffen Thorsen (2013-11-11): +# DST start in Cuba in 2004 ... does not follow the same rules as the +# years before. The correct date should be Sunday 2004-03-28 00:00 ... +# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html + # From Evert van der Veer via Steffen Thorsen (2004-10-28): # Cuba is not going back to standard time this year. # From Paul Eggert (2006-03-22): @@ -2854,7 +2859,8 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S Rule Cuba 1997 only - Oct 12 0:00s 0 S Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S -Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D +Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 00:09:15 2013 Return-Path: Delivered-To: svn-src-all@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 B71094D4; Fri, 20 Dec 2013 00:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A130F1688; Fri, 20 Dec 2013 00:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK09FLP074124; Fri, 20 Dec 2013 00:09:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK09EB6074119; Fri, 20 Dec 2013 00:09:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312200009.rBK09EB6074119@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 00:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259637 - in releng/10.0/sys: amd64/conf dev/xen/netback dev/xen/netfront X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 00:09:15 -0000 Author: glebius Date: Fri Dec 20 00:09:14 2013 New Revision: 259637 URL: http://svnweb.freebsd.org/changeset/base/259637 Log: Merge r259541 from stable/10: Merge r256868,257276-257277,257515,257913 from head. These are fixes required to make Xen buildable w/o INET. Approved by: re (delphij) Modified: releng/10.0/sys/amd64/conf/NOTES releng/10.0/sys/dev/xen/netback/netback.c releng/10.0/sys/dev/xen/netback/netback_unit_tests.c releng/10.0/sys/dev/xen/netfront/netfront.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/amd64/conf/NOTES ============================================================================== --- releng/10.0/sys/amd64/conf/NOTES Thu Dec 19 23:29:34 2013 (r259636) +++ releng/10.0/sys/amd64/conf/NOTES Fri Dec 20 00:09:14 2013 (r259637) @@ -473,6 +473,12 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device hyperv # HyperV drivers + +# Xen HVM Guest Optimizations +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver + ##################################################################### # Modified: releng/10.0/sys/dev/xen/netback/netback.c ============================================================================== --- releng/10.0/sys/dev/xen/netback/netback.c Thu Dec 19 23:29:34 2013 (r259636) +++ releng/10.0/sys/dev/xen/netback/netback.c Fri Dec 20 00:09:14 2013 (r259637) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * from this FreeBSD domain to other domains. */ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_global.h" #include "opt_sctp.h" @@ -183,7 +184,6 @@ static int xnb_rxpkt2gnttab(const struct static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, const gnttab_copy_table gnttab, int n_entries, netif_rx_back_ring_t *ring); -static void xnb_add_mbuf_cksum(struct mbuf *mbufc); static void xnb_stop(struct xnb_softc*); static int xnb_ioctl(struct ifnet*, u_long, caddr_t); static void xnb_start_locked(struct ifnet*); @@ -194,6 +194,9 @@ static void xnb_ifinit(void*); static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +#if defined(INET) || defined(INET6) +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +#endif /*------------------------------ Data Structures -----------------------------*/ @@ -1778,7 +1781,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con } mbufc->m_pkthdr.len = total_size; +#if defined(INET) || defined(INET6) xnb_add_mbuf_cksum(mbufc); +#endif } /** @@ -2121,6 +2126,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt, return n_responses; } +#if defined(INET) || defined(INET6) /** * Add IP, TCP, and/or UDP checksums to every mbuf in a chain. The first mbuf * in the chain must start with a struct ether_header. @@ -2175,6 +2181,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc) break; } } +#endif /* INET || INET6 */ static void xnb_stop(struct xnb_softc *xnb) @@ -2191,8 +2198,8 @@ static int xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct xnb_softc *xnb = ifp->if_softc; -#ifdef INET struct ifreq *ifr = (struct ifreq*) data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr*)data; #endif int error = 0; Modified: releng/10.0/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- releng/10.0/sys/dev/xen/netback/netback_unit_tests.c Thu Dec 19 23:29:34 2013 (r259636) +++ releng/10.0/sys/dev/xen/netback/netback_unit_tests.c Fri Dec 20 00:09:14 2013 (r259637) @@ -104,10 +104,6 @@ struct test_fixture { typedef struct test_fixture test_fixture_t; -static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, - uint16_t ip_id, uint16_t ip_p, - uint16_t ip_off, uint16_t ip_sum); -static void xnb_fill_tcp(struct mbuf *m); static int xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags); static int xnb_unit_test_runner(test_fixture_t const tests[], int ntests, char *buffer, size_t buflen); @@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra; static testcase_t xnb_rxpkt2rsp_2short; static testcase_t xnb_rxpkt2rsp_2slots; static testcase_t xnb_rxpkt2rsp_copyerror; +static testcase_t xnb_sscanf_llu; +static testcase_t xnb_sscanf_lld; +static testcase_t xnb_sscanf_hhu; +static testcase_t xnb_sscanf_hhd; +static testcase_t xnb_sscanf_hhn; + +#if defined(INET) || defined(INET6) /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */ static testcase_t xnb_add_mbuf_cksum_arp; static testcase_t xnb_add_mbuf_cksum_tcp; static testcase_t xnb_add_mbuf_cksum_udp; static testcase_t xnb_add_mbuf_cksum_icmp; static testcase_t xnb_add_mbuf_cksum_tcp_swcksum; -static testcase_t xnb_sscanf_llu; -static testcase_t xnb_sscanf_lld; -static testcase_t xnb_sscanf_hhu; -static testcase_t xnb_sscanf_hhd; -static testcase_t xnb_sscanf_hhn; +static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, + uint16_t ip_id, uint16_t ip_p, + uint16_t ip_off, uint16_t ip_sum); +static void xnb_fill_tcp(struct mbuf *m); +#endif /* INET || INET6 */ /** Private data used by unit tests */ static struct { @@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) {setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data}, +#if defined(INET) || defined(INET6) {null_setup, xnb_add_mbuf_cksum_arp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_icmp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown}, {null_setup, xnb_add_mbuf_cksum_udp, null_teardown}, +#endif {null_setup, xnb_sscanf_hhd, null_teardown}, {null_setup, xnb_sscanf_hhu, null_teardown}, {null_setup, xnb_sscanf_lld, null_teardown}, @@ -2066,6 +2071,7 @@ xnb_rxpkt2rsp_copyerror(char *buffer, si safe_m_freem(&mbuf); } +#if defined(INET) || defined(INET6) /** * xnb_add_mbuf_cksum on an ARP request packet */ @@ -2430,6 +2436,7 @@ xnb_add_mbuf_cksum_tcp_swcksum(char *buf m_freem(mbufc); } +#endif /* INET || INET6 */ /** * sscanf on unsigned chars Modified: releng/10.0/sys/dev/xen/netfront/netfront.c ============================================================================== --- releng/10.0/sys/dev/xen/netfront/netfront.c Thu Dec 19 23:29:34 2013 (r259636) +++ releng/10.0/sys/dev/xen/netfront/netfront.c Fri Dec 20 00:09:14 2013 (r259637) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -165,7 +166,6 @@ static int xn_configure_features(struct static void xn_watchdog(struct ifnet *); #endif -static void show_device(struct netfront_info *sc); #ifdef notyet static void netfront_closing(device_t dev); #endif @@ -644,8 +644,6 @@ setup_device(device_t dev, struct netfro goto fail; } - show_device(info); - return (0); fail: @@ -967,7 +965,7 @@ static void xn_rxeof(struct netfront_info *np) { struct ifnet *ifp; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) struct lro_ctrl *lro = &np->xn_lro; struct lro_entry *queued; #endif @@ -1064,7 +1062,7 @@ xn_rxeof(struct netfront_info *np) * Do we really need to drop the rx lock? */ XN_RX_UNLOCK(np); -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* Use LRO if possible */ if ((ifp->if_capenable & IFCAP_LRO) == 0 || lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) { @@ -1082,7 +1080,7 @@ xn_rxeof(struct netfront_info *np) np->rx.rsp_cons = i; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* * Flush any outstanding LRO work */ @@ -1969,25 +1967,6 @@ network_connect(struct netfront_info *np return (0); } -static void -show_device(struct netfront_info *sc) -{ -#ifdef DEBUG - if (sc) { - IPRINTK("\n", - sc->xn_ifno, - be_state_name[sc->xn_backend_state], - sc->xn_user_state ? "open" : "closed", - sc->xn_evtchn, - sc->xn_irq, - sc->xn_tx_if, - sc->xn_rx_if); - } else { - IPRINTK("\n"); - } -#endif -} - static void xn_query_features(struct netfront_info *np) { @@ -2024,14 +2003,14 @@ xn_configure_features(struct netfront_in int err; err = 0; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) tcp_lro_free(&np->xn_lro); #endif np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); np->xn_ifp->if_hwassist &= ~CSUM_TSO; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { err = tcp_lro_init(&np->xn_lro); if (err) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 00:17:28 2013 Return-Path: Delivered-To: svn-src-all@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 926A37CD; Fri, 20 Dec 2013 00:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC58171C; Fri, 20 Dec 2013 00:17:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK0HS5b077628; Fri, 20 Dec 2013 00:17:28 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK0HR3T077621; Fri, 20 Dec 2013 00:17:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312200017.rBK0HR3T077621@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 20 Dec 2013 00:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259638 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 00:17:28 -0000 Author: melifaro Date: Fri Dec 20 00:17:26 2013 New Revision: 259638 URL: http://svnweb.freebsd.org/changeset/base/259638 Log: Use more fine-grained kvm(3) symbol lookup: routing code retrieves only necessary symbols needed per subsystem. Main kvm(3) init is now delayed as much as possbile. This finally fixes performance issues reported in kern/167204. Some non-working code (ng_socket.ko symbol addresses calculation) removed. Some global variables eliminated. PR: kern/167204 MFC after: 4 weeks Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mroute.c head/usr.bin/netstat/mroute6.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/if.c Fri Dec 20 00:17:26 2013 (r259638) @@ -223,7 +223,7 @@ next_ifma(struct ifmaddrs *ifma, const c * Print a description of the network interfaces. */ void -intpr(int interval, void (*pfunc)(char *)) +intpr(int interval, void (*pfunc)(char *), int af) { struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/main.c Fri Dec 20 00:17:26 2013 (r259638) @@ -319,7 +319,6 @@ int gflag; /* show group (multicast) ro int hflag; /* show counters in human readable format */ int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ -int Mflag; /* read statistics from core */ int mflag; /* show memory stats */ int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ @@ -425,7 +424,6 @@ main(int argc, char *argv[]) Lflag = 1; break; case 'M': - Mflag = 1; memf = optarg; break; case 'm': @@ -554,40 +552,40 @@ main(int argc, char *argv[]) * used for the queries, which is slower. */ #endif - kread(0, NULL, 0); if (iflag && !sflag) { - intpr(interval, NULL); + intpr(interval, NULL, af); exit(0); } if (rflag) { if (sflag) - rt_stats(nl[N_RTSTAT].n_value, nl[N_RTTRASH].n_value); + rt_stats(); else - routepr(nl[N_RTREE].n_value, fib); + routepr(fib, af); exit(0); } + if (gflag) { if (sflag) { if (af == AF_INET || af == AF_UNSPEC) - mrt_stats(nl[N_MRTSTAT].n_value); + mrt_stats(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mrt6_stats(nl[N_MRT6STAT].n_value); + mrt6_stats(); #endif } else { if (af == AF_INET || af == AF_UNSPEC) - mroutepr(nl[N_MFCHASHTBL].n_value, - nl[N_MFCTABLESIZE].n_value, - nl[N_VIFTABLE].n_value); + mroutepr(); #ifdef INET6 if (af == AF_INET6 || af == AF_UNSPEC) - mroute6pr(nl[N_MF6CTABLE].n_value, - nl[N_MIF6TABLE].n_value); + mroute6pr(); #endif } exit(0); } + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (tp) { printproto(tp, tp->pr_name); exit(0); @@ -640,7 +638,7 @@ printproto(struct protox *tp, const char if (sflag) { if (iflag) { if (tp->pr_istats) - intpr(interval, tp->pr_istats); + intpr(interval, tp->pr_istats, af); else if (pflag) printf("%s: no per-interface stats routine\n", tp->pr_name); @@ -703,7 +701,23 @@ kvmd_init(void) return (-1); } - if (kvm_nlist(kvmd, nl) < 0) { + return (0); +} + +/* + * Resolve symbol list, return 0 on success. + */ +int +kresolve_list(struct nlist *_nl) +{ + + if ((kvmd == NULL) && (kvmd_init() != 0)) + return (-1); + + if (_nl[0].n_type != 0) + return (0); + + if (kvm_nlist(kvmd, _nl) < 0) { if (nlistf) errx(1, "%s: kvm_nlist: %s", nlistf, kvm_geterr(kvmd)); @@ -711,13 +725,6 @@ kvmd_init(void) errx(1, "kvm_nlist: %s", kvm_geterr(kvmd)); } - if (nl[0].n_type == 0) { - if (nlistf) - errx(1, "%s: no namelist", nlistf); - else - errx(1, "no namelist"); - } - return (0); } Modified: head/usr.bin/netstat/mroute.c ============================================================================== --- head/usr.bin/netstat/mroute.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/mroute.c Fri Dec 20 00:17:26 2013 (r259638) @@ -65,11 +65,26 @@ __FBSDID("$FreeBSD$"); #undef _KERNEL #include +#include #include #include #include #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MRTSTAT 0 + { .n_name = "_mrtstat" }, +#define N_MFCHASHTBL 1 + { .n_name = "_mfchashtbl" }, +#define N_VIFTABLE 2 + { .n_name = "_viftable" }, +#define N_MFCTABLESIZE 3 + { .n_name = "_mfctablesize" }, + { .n_name = NULL }, +}; static void print_bw_meter(struct bw_meter *, int *); static void print_mfc(struct mfc *, int, int *); @@ -193,11 +208,12 @@ print_mfc(struct mfc *m, int maxvif, int } void -mroutepr(u_long pmfchashtbl, u_long pmfctablesize, u_long pviftbl) +mroutepr() { struct vif viftable[MAXVIFS]; struct vif *v; struct mfc *m; + u_long pmfchashtbl, pmfctablesize, pviftbl; int banner_printed; int saved_numeric_addr; size_t len; @@ -221,6 +237,16 @@ mroutepr(u_long pmfchashtbl, u_long pmfc */ maxvif = 0; + kresolve_list(mrl); + pmfchashtbl = mrl[N_MFCHASHTBL].n_value; + pmfctablesize = mrl[N_MFCTABLESIZE].n_value; + pviftbl = mrl[N_VIFTABLE].n_value; + + if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } + len = sizeof(viftable); if (live) { if (sysctlbyname("net.inet.ip.viftable", viftable, &len, NULL, @@ -338,15 +364,24 @@ mroutepr(u_long pmfchashtbl, u_long pmfc } void -mrt_stats(u_long mstaddr) +mrt_stats() { struct mrtstat mrtstat; - size_t len = sizeof mrtstat; + u_long mstaddr; + size_t len = sizeof(mrtstat); + + kresolve_list(mrl); + mstaddr = mrl[N_MRTSTAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } if (live) { if (sysctlbyname("net.inet.ip.mrtstat", &mrtstat, &len, NULL, 0) < 0) { - warn("sysctl: net.inet.ip.mrtstat"); + warn("sysctl: net.inet.ip.mrtstat failed."); return; } } else Modified: head/usr.bin/netstat/mroute6.c ============================================================================== --- head/usr.bin/netstat/mroute6.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/mroute6.c Fri Dec 20 00:17:26 2013 (r259638) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -95,17 +96,32 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist mrl[] = { +#define N_MF6CTABLE 0 + { .n_name = "_mf6ctable" }, +#define N_MIF6TABLE 1 + { .n_name = "_mif6table" }, +#define N_MRT6STAT 2 + { .n_name = "_mrt6stat" }, + { .n_name = NULL }, +}; + + #define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */ #define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ void -mroute6pr(u_long mfcaddr, u_long mifaddr) +mroute6pr() { struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp; struct mif6 mif6table[MAXMIFS]; struct mf6c mfc; struct rtdetq rte, *rtep; struct mif6 *mifp; + u_long mfcaddr, mifaddr; mifi_t mifi; int i; int banner_printed; @@ -114,6 +130,15 @@ mroute6pr(u_long mfcaddr, u_long mifaddr long int waitings; size_t len; + kresolve_list(mrl); + mfcaddr = mrl[N_MF6CTABLE].n_value; + mifaddr = mrl[N_MIF6TABLE].n_value; + + if (mfcaddr == 0 || mifaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + len = sizeof(mif6table); if (live) { if (sysctlbyname("net.inet6.ip6.mif6table", mif6table, &len, @@ -217,11 +242,20 @@ mroute6pr(u_long mfcaddr, u_long mifaddr } void -mrt6_stats(u_long mstaddr) +mrt6_stats() { struct mrt6stat mrtstat; + u_long mstaddr; size_t len = sizeof mrtstat; + kresolve_list(mrl); + mstaddr = mrl[N_MRT6STAT].n_value; + + if (mstaddr == 0) { + fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); + return; + } + if (live) { if (sysctlbyname("net.inet6.ip6.mrt6stat", &mrtstat, &len, NULL, 0) < 0) { Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/netgraph.c Fri Dec 20 00:17:26 2013 (r259638) @@ -72,53 +72,10 @@ netgraphprotopr(u_long off, const char * /* If symbol not found, try looking in the KLD module */ if (off == 0) { - const char *const modname = "ng_socket.ko"; -/* XXX We should get "mpath" from "sysctl kern.module_path" */ - const char *mpath[] = { "/", "/boot/", "/modules/", NULL }; - struct nlist sym[] = { { .n_name = "_ngsocklist" }, - { .n_name = NULL } }; - const char **pre; - struct kld_file_stat ks; - int fileid; - - /* Can't do this for core dumps. */ - if (!live) - return; - - /* See if module is loaded */ - if ((fileid = kldfind(modname)) < 0) { - if (debug) - warn("kldfind(%s)", modname); - return; - } - - /* Get module info */ - memset(&ks, 0, sizeof(ks)); - ks.version = sizeof(struct kld_file_stat); - if (kldstat(fileid, &ks) < 0) { - if (debug) - warn("kldstat(%d)", fileid); - return; - } - - /* Get symbol table from module file */ - for (pre = mpath; *pre; pre++) { - char path[MAXPATHLEN]; - - snprintf(path, sizeof(path), "%s%s", *pre, modname); - if (nlist(path, sym) == 0) - break; - } - - /* Did we find it? */ - if (sym[0].n_value == 0) { - if (debug) - warnx("%s not found", modname); - return; - } - - /* Symbol found at load address plus symbol offset */ - off = (u_long) ks.address + sym[0].n_value; + if (debug) + fprintf(stderr, + "Error reading symbols from ng_socket.ko"); + return; } /* Get pointer to first socket */ Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/netstat.h Fri Dec 20 00:17:26 2013 (r259638) @@ -40,7 +40,6 @@ extern int gflag; /* show group (multica extern int hflag; /* show counters in human readable format */ extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ -extern int Mflag; /* read statistics from core */ extern int mflag; /* show memory stats */ extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ @@ -57,11 +56,12 @@ extern int interval; /* repeat interval extern char *interface; /* desired i/f for stats, or NULL for all i/fs */ extern int unit; /* unit number for above */ -extern int af; /* address family */ extern int live; /* true if we are examining a live system */ +struct nlist; int kread(u_long addr, void *buf, size_t size); int kread_counters(u_long addr, void *buf, size_t size); +int kresolve_list(struct nlist *); const char *plural(uintmax_t); const char *plurales(uintmax_t); const char *pluralies(uintmax_t); @@ -98,8 +98,8 @@ void icmp6_stats(u_long, const char *, i void icmp6_ifstats(char *); void pim6_stats(u_long, const char *, int, int); void rip6_stats(u_long, const char *, int, int); -void mroute6pr(u_long, u_long); -void mrt6_stats(u_long); +void mroute6pr(void); +void mrt6_stats(void); struct sockaddr_in6; struct in6_addr; @@ -120,11 +120,11 @@ void netisr_stats(void *); void hostpr(u_long, u_long); void impstats(u_long, u_long); -void intpr(int, void (*)(char *)); +void intpr(int, void (*)(char *), int); void pr_rthdr(int); void pr_family(int); -void rt_stats(u_long, u_long); +void rt_stats(void); char *ipx_pnet(struct sockaddr *); char *ipx_phost(struct sockaddr *); char *ns_phost(struct sockaddr *); @@ -136,7 +136,7 @@ char *atalk_print(struct sockaddr *, int char *atalk_print2(struct sockaddr *, struct sockaddr *, int); char *ipx_print(struct sockaddr *); char *ns_print(struct sockaddr *); -void routepr(u_long, int); +void routepr(int, int); void ipxprotopr(u_long, const char *, int, int); void spx_stats(u_long, const char *, int, int); @@ -166,6 +166,6 @@ void tp_protopr(u_long, const char *, in void tp_inproto(u_long); void tp_stats(caddr_t, caddr_t); -void mroutepr(u_long, u_long, u_long); -void mrt_stats(u_long); +void mroutepr(void); +void mrt_stats(void); void bpf_stats(char *); Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Fri Dec 20 00:09:14 2013 (r259637) +++ head/usr.bin/netstat/route.c Fri Dec 20 00:17:26 2013 (r259638) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -106,6 +107,19 @@ struct bits { { 0 , 0 } }; +/* + * kvm(3) bindings for every needed symbol + */ +static struct nlist rl[] = { +#define N_RTSTAT 0 + { .n_name = "_rtstat" }, +#define N_RTREE 1 + { .n_name = "_rt_tables"}, +#define N_RTTRASH 2 + { .n_name = "_rttrash" }, + { .n_name = NULL }, +}; + typedef union { long dummy; /* Helps align structure. */ struct sockaddr u_sa; @@ -151,9 +165,10 @@ static void domask(char *, in_addr_t, u_ * Print routing tables. */ void -routepr(u_long rtree, int fibnum) +routepr(int fibnum, int af) { struct radix_node_head **rnhp, *rnh, head; + u_long rtree; size_t intsize; int fam, numfibs; @@ -165,10 +180,6 @@ routepr(u_long rtree, int fibnum) numfibs = 1; if (fibnum < 0 || fibnum > numfibs - 1) errx(EX_USAGE, "%d: invalid fib", fibnum); - rt_tables = calloc(numfibs * (AF_MAX+1), - sizeof(struct radix_node_head *)); - if (rt_tables == NULL) - err(EX_OSERR, "memory allocation failed"); /* * Since kernel & userland use different timebase * (time_uptime vs time_second) and we are reading kernel memory @@ -182,14 +193,20 @@ routepr(u_long rtree, int fibnum) printf(" (fib: %d)", fibnum); printf("\n"); - if (Aflag == 0 && Mflag == 0 && NewTree) + if (Aflag == 0 && live != 0 && NewTree) ntreestuff(fibnum, af); else { - if (rtree == 0) { + kresolve_list(rl); + if ((rtree = rl[N_RTREE].n_value) == 0) { printf("rt_tables: symbol not in namelist\n"); return; } + rt_tables = calloc(numfibs * (AF_MAX + 1), + sizeof(struct radix_node_head *)); + if (rt_tables == NULL) + err(EX_OSERR, "memory allocation failed"); + if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) return; @@ -572,14 +589,14 @@ ntreestuff(int fibnum, int af) mib[5] = 0; mib[6] = fibnum; if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump estimate"); + err(1, "sysctl: net.route.0.%d.dump.%d estimate", af, fibnum); } if ((buf = malloc(needed)) == 0) { errx(2, "malloc(%lu)", (unsigned long)needed); } if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.0.dump"); + err(1, "sysctl: net.route.0.%d.dump.%d", af, fibnum); } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { @@ -1071,16 +1088,19 @@ routename6(struct sockaddr_in6 *sa6) * Print routing statistics */ void -rt_stats(u_long rtsaddr, u_long rttaddr) +rt_stats(void) { struct rtstat rtstat; + u_long rtsaddr, rttaddr; int rttrash; - if (rtsaddr == 0) { + kresolve_list(rl); + + if ((rtsaddr = rl[N_RTSTAT].n_value) == 0) { printf("rtstat: symbol not in namelist\n"); return; } - if (rttaddr == 0) { + if ((rttaddr = rl[N_RTTRASH].n_value) == 0) { printf("rttrash: symbol not in namelist\n"); return; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 00:28:53 2013 Return-Path: Delivered-To: svn-src-all@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 34FDCB28; Fri, 20 Dec 2013 00:28:53 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF1217D4; Fri, 20 Dec 2013 00:28:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBK0SoMg073864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 04:28:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBK0Sooh073863; Fri, 20 Dec 2013 04:28:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 04:28:50 +0400 From: Gleb Smirnoff To: John Baldwin Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220002849.GH71033@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312191552.04202.jhb@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 00:28:53 -0000 John, On Thu, Dec 19, 2013 at 03:52:03PM -0500, John Baldwin wrote: J> > J> Please don't gratuitiously break things that /usr/sbin/crashinfo runs. It's J> > J> fine if kvm mode is fragile and requires the binary to be in sync with the J> > J> kernel and is only used for crash dumps, but it is very useful to extract J> > J> all sorts of info out of a crash dump. J> > J> > The problem is that these tools (netstat, and some others) prevent us from J> > improving the kernel network stack. We can't make improvements that are J> > mergeable to stable/x branch, since the tools would be broken. J> J> No, I explicitly said "it's fine if the kvm mode is fragile and requires the J> binary to be in sync and is only used for crash dumps". That means it's J> fine to merge changes as long as you merge the whole thing together. It also J> means you don't have to support all possible internal kernel ABIs in a branch. Sorry but this is not true. Yeah, I'm grateful that you personally allow me to break ABIs, but the general FreeBSD project policy doesn't allow that anymore in stable branches. I don't have strong opinion on this, I really think that running kernel and world out of sync is a bad idea, so I may agree with you. But the project as a whole have established a policy that within a stable branch newer kernel can run tools from x.0-RELEASE. And agree or not, I abide. J> > Moreover J> > any improvement in head/, requires from developer additional work in netstat J> > code, which I must admit isn't a pleasure to work with. J> J> Well, yes, there all sorts of things like, say, documentation that one has to J> do beyond the original hacking in order to make a logical change more complete. J> Plus, if you think writing netstat stuff in C is bad, try writing the equivalent J> in kgdb scripts instead (which is what you'd need to do to provide equivalent J> functionality) Actually I do that often, and find it easier to make kgdb scripts. J> > I agree that usage of tools on vmcores is useful. But we all should agree that J> > it has very limited use. Only kernel hackers and developers are expected to J> > do this. J> J> If users enable crashinfo then they all run this for each crash, so not just J> developers. Having worked in an environment with hundreds of crashes per day, J> having some post-processed output to dig through rather than firing up kgdb J> every time is quite valuable. I've fixed quite a lot of PRs in network stack and never payed attention to the routing table or ifnet stats provided by netstat in that long submissions attached to PRs. As said, w/o addresses this output is quite useless for debugging. J> > My suggestion is that all this code is deleted from src/usr.bin/netstat, and J> > moved to src/tools, and we relax assertion that src/tools must be compatible J> > with any kernel within the branch. So, any person who wants this functionality, J> > needs to keep his src/tools in sync with kernel and compile a tool when he J> > desires to dump routing table from a vmcore. J> J> That is mostly what I suggested in terms of not having the same ABI guarantees, J> but I still want crashinfo to provide a comprehensive set of details to developers J> so that users can just mail that file to a developer without having to be walked J> through intricate gdb gymnastics. Good, then this stuff just needs to migrate to a special crashdump tool. And probably its output shouldn't resemble netstat(1), since there is no reason for that. Perfectly if structures are just dumped as a whole. Yeah, here gdb scripting comes into mind. J> > Finally, when we remove all the kvm(3) usage from a tool, then we can remove J> > the sugid bit from it, which would be a another fine point. J> J> That is 100% irrelevant to crash dumps. I only ask that the KVM mode needs J> to work for crash dumps. I am more than happy for all "live" access to use J> sysctls instead of kvm and to not need the set-gid bit as a result. Looks like we are coming to agreement. The way to go is to remove kvm access from netstat, substituting it with proper APIs. The better crashdump utility needs to be started. Not yet sure that C + kvm(3) is a proper framework for it. I don't understand the plan with dtrace based tool well, but reading John-Marks' email I find it interesting. gdb scripting is also an option. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 00:47:55 2013 Return-Path: Delivered-To: svn-src-all@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 77139F3E; Fri, 20 Dec 2013 00:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 559FC192E; Fri, 20 Dec 2013 00:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK0ltHf088084; Fri, 20 Dec 2013 00:47:55 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK0lson088082; Fri, 20 Dec 2013 00:47:54 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201312200047.rBK0lson088082@svn.freebsd.org> From: Peter Grehan Date: Fri, 20 Dec 2013 00:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259639 - releng/10.0/usr.sbin/bhyve X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 00:47:55 -0000 Author: grehan Date: Fri Dec 20 00:47:54 2013 New Revision: 259639 URL: http://svnweb.freebsd.org/changeset/base/259639 Log: MFStable r259536 MFC r259302,r259413 r259302 bhyve(8) man page r259413 mdoc: sort SEE ALSO Approved by: re@ (glebius) Added: releng/10.0/usr.sbin/bhyve/bhyve.8 - copied unchanged from r259536, stable/10/usr.sbin/bhyve/bhyve.8 Modified: releng/10.0/usr.sbin/bhyve/Makefile Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/bhyve/Makefile ============================================================================== --- releng/10.0/usr.sbin/bhyve/Makefile Fri Dec 20 00:17:26 2013 (r259638) +++ releng/10.0/usr.sbin/bhyve/Makefile Fri Dec 20 00:47:54 2013 (r259639) @@ -6,6 +6,7 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 +MAN= bhyve.8 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c SRCS+= inout.c ioapic.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c @@ -15,8 +16,6 @@ SRCS+= uart_emul.c virtio.c xmsr.c spinu .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c -NO_MAN= - DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} LDADD= -lvmmapi -lmd -lutil -lpthread Copied: releng/10.0/usr.sbin/bhyve/bhyve.8 (from r259536, stable/10/usr.sbin/bhyve/bhyve.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/10.0/usr.sbin/bhyve/bhyve.8 Fri Dec 20 00:47:54 2013 (r259639, copy of r259536, stable/10/usr.sbin/bhyve/bhyve.8) @@ -0,0 +1,299 @@ +.\" Copyright (c) 2013 Peter Grehan +.\" 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 AUTHORS 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 AUTHORS 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 December 12, 2013 +.Dt BHYVE 8 +.Os +.Sh NAME +.Nm bhyve +.Nd "run a guest operating system inside a virtual machine" +.Sh SYNOPSIS +.Nm +.Op Fl aehAHPW +.Op Fl c Ar numcpus +.Op Fl g Ar gdbport +.Op Fl p Ar pinnedcpu +.Op Fl s Ar slot,emulation Ns Op , Ns Ar conf +.Op Fl S Ar slot,emulation Ns Op , Ns Ar conf +.Op Fl l Ar lpcdev Ns Op , Ns Ar conf +.Ar vmname +.Sh DESCRIPTION +.Nm +is an experimental hypervisor that runs guest operating systems inside a +virtual machine. +.Pp +Parameters such as the number of virtual CPUs, amount of guest memory, and +I/O connectivity can be specified with command-line parameters. +.Pp +The guest operating system must be loaded with +.Xr bhyveload 4 +or a similar boot loader before running +.Nm . +.Pp +.Nm +runs until the guest operating system reboots or an unhandled hypervisor +exit is detected. +.Sh OPTIONS +.Bl -tag -width 10n +.It Fl a +Disallow use of the local APIC in X2APIC mode. +.It Fl A +Generate ACPI tables. +Required for +.Fx Ns /amd64 +guests. +.It Fl c Ar numcpus +Number of guest virtual CPUs. +The default is 1 and the maximum is 16. +.It Fl H +Yield the virtual CPU thread when a HLT instruction is detected. +If this option is not specified, virtual CPUs will use 100% of a host CPU. +.It Fl g Ar gdbport +For +.Fx Ns /amd64 kernels compiled with +.Cd "option bvmdebug" , +allow a remote kernel kgdb to be relayed to the guest kernel gdb stub +via a local IPv4 address and this port. +This option will be deprecated in a future version. +.It Fl p Ar pinnedcpu +Force guest virtual CPUs to be pinned to host CPUs. +Virtual CPU +.Em n +is pinned to host CPU +.Em pinnedcpu+n . +.It Fl P +Force the guest virtual CPU to exit when a PAUSE instruction is detected. +.It Fl W +Force virtio PCI device emulations to use MSI interrupts instead of MSI-X +interrupts. +.It Fl s Ar slot,emulation Ns Op , Ns Ar conf +Configure a virtual PCI slot and function. +.Pp +.Nm bhyve +provides PCI bus emulation and virtual devices that can be attached to +slots on the bus. +There are 32 available slots, with the option of providing up to 8 functions +per slot. +.Bl -tag -width 10n +.It Ar slot +.Ar pcislot Ns Op Ar :function +.Pp +The +.Ar pcislot +value is 0 to 31 and the optional function value is 0 to 7. +If not specified, the function value defaults to 0. +.It Ar emulation +.Bl -tag -width 10n +.It Li hostbridge | Li amd_hostbridge +.Pp +Provide a simple host bridge. +This is usually configured at slot 0, and is required by most guest +operating systems. +The +.Li amd_hostbridge +emulation is identical but uses a PCI vendor ID of +.Li AMD . +.It Li passthru +PCI pass-through device. +.It Li virtio-net +Virtio network interface. +.It Li virtio-block +Virtio block storage interface. +.It Li ahci-cd +AHCI controller attached to an ATAPI CD/DVD. +.It Li ahci-hd +AHCI controller attached to a SATA hard-drive. +.It Li uart +PCI 16550 serial device. +.It Li lpc +LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports. +.El +.It Op Ar conf +This optional parameter describes the backend for device emulations. +If +.Ar conf +is not specified, the device emulation has no backend and can be +considered unconnected. +.Pp +Network devices: +.Bl -tag -width 10n +.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx +.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx +.Pp +If +.Ar mac +is not specified, the MAC address is derived from a fixed OUI and the +remaining bytes from an MD5 hash of the slot and function numbers and +the device name. +.Pp +The MAC address is an ASCII string in +.Xr ethers 5 +format. +.El +.Pp +Block storage devices: +.Bl -tag -width 10n +.It Pa /filename Ns Oo , Ns Li nocache Oc Ns Oo , Ns Li direct Oc Ns Oo , Ns Li ro Oc +.It Pa /dev/xxx Ns Oo , Ns Ar nocache Oc Ns Oo , Ns Ar direct Oc Ns Oo , Ns Ar ro Oc +.Bl -tag -width 8n +.It Li nocache +Open the file with +.Dv O_DIRECT . +.It Li direct +Open the file using +.Dv O_SYNC . +.It Li ro +Force the file to be opened read-only. +.El +.Pp +The +.Li nocache , +.Li direct , +and +.Li ro +options are not available for virtio block devices. +.El +.Pp +TTY devices: +.Bl -tag -width 10n +.It Li stdio +Connect the serial port to the standard input and output of +the bhyve process. +.It Pa /dev/xxx +Use the host TTY device for serial port I/O. +.El +.Pp +Pass-through devices: +.Bl -tag -width 10n +.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function +Connect to a PCI device on the host at the selector described by +.Ar slot , +.Ar bus , +and +.Ar function +numbers. +.El +.Pp +The host device must have been reserved at boot-time using the +.Va pptdev +loader variable as described in +.Xr vmm 4 . +.El +.It Fl S Ar slot , Ns Ar emulation Ns Op , Ns Ar conf +Identical to the -s option except the device is instructed to use legacy +ISA addresses if possible. +Currently this only has an effect with the +.Li uart +device emulation. +This option will be deprecated in a future version. +.It Fl l Ar lpcdev Ns Op , Ns Ar conf +Allow devices behind the LPC PCI-ISA bridge to be configured. +The only supported devices are the TTY-class devices, +.Li com1 +and +.Li com2 . +.It Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t +Guest physical memory size in bytes. +This must be the same size that was given to +.Xr bhyveload 8 . +.Pp +The size argument may be suffixed with one of K, M, G or T (either upper +or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, +or terabytes. +If no suffix is given, the value is assumed to be in megabytes. +.It Fl e +Force +.Nm +to exit when a guest issues an access to an I/O port that is not emulated. +This is intended for debug purposes. +.It Fl h +Print help message and exit. +.It Ar vmname +Alphanumeric name of the guest. +This should be the same as that created by +.Xr bhyveload 8 . +.El +.Sh EXAMPLES +The guest operating system must have been loaded with +.Xr bhyveload 4 +or a similar boot loader before +.Xr bhyve 4 +can be run. +.Pp +To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio +block device backed by the +.Pa /my/image +filesystem image, and a serial port for the console: +.Bd -literal -offset indent +bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\ + -l com1,stdio -A -H -P -m 1G vm1 +.Ed +.Pp +Run a 24GB single-CPU virtual machine with three network ports, one of which +has a MAC address specified: +.Bd -literal -offset indent +bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\ + -s 2:1,virtio-net,tap1 \\ + -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\ + -s 3,virtio-blk,/my/image -l com1,stdio \\ + -A -H -P -m 24G bigvm +.Ed +.Pp +Run an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI +CD-ROM, a single virtio network port, an AMD hostbridge, and the console +port connected to an +.Xr nmdm 4 +null-model device. +.Bd -literal -offset indent +bhyve -c 4 \e\ + -s 0,amd_hostbridge -s 1,lpc \\ + -s 1:0,ahci-hd,/images/disk.1 \\ + -s 1:1,ahci-hd,/images/disk.2 \\ + -s 1:2,ahci-hd,/images/disk.3 \\ + -s 1:3,ahci-hd,/images/disk.4 \\ + -s 1:4,ahci-hd,/images/disk.5 \\ + -s 1:5,ahci-hd,/images/disk.6 \\ + -s 1:6,ahci-hd,/images/disk.7 \\ + -s 1:7,ahci-hd,/images/disk.8 \\ + -s 2,ahci-cd,/images.install.iso \\ + -s 3,virtio-net,tap0 \\ + -l com1,/dev/nmdm0A \\ + -A -H -P -m 8G +.Ed +.Sh SEE ALSO +.Xr bhyve 4 , +.Xr nmdm 4 , +.Xr vmm 4 , +.Xr ethers 5 , +.Xr bhyvectl 8 , +.Xr bhyveload 8 +.Sh HISTORY +.Nm +first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An Neel Natu Aq neel@freebsd.org +.An Peter Grehan Aq grehan@freebsd.org From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 00:56:26 2013 Return-Path: Delivered-To: svn-src-all@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 A88D4179; Fri, 20 Dec 2013 00:56:26 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88A8119DA; Fri, 20 Dec 2013 00:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK0uQ59091450; Fri, 20 Dec 2013 00:56:26 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK0uO2H091437; Fri, 20 Dec 2013 00:56:24 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201312200056.rBK0uO2H091437@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Fri, 20 Dec 2013 00:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259640 - in head/sys: arm/arm arm/include conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 00:56:26 -0000 Author: ganbold (doc committer) Date: Fri Dec 20 00:56:23 2013 New Revision: 259640 URL: http://svnweb.freebsd.org/changeset/base/259640 Log: Add identification and necessary type checks for Krait CPU cores. Krait CPU is used in Qualcomm Snapdragon S4 and Snapdragon 400/600/800 SoCs and has architectural similarities to ARM Cortex-A15. As for development boards IFC6400 series embedded boards from Inforce Computing uses Snapdragon S4 Pro/APQ8064. Approved by: stas (mentor) Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/identcpu.c head/sys/arm/arm/locore.S head/sys/arm/arm/swtch.S head/sys/arm/include/armreg.h head/sys/arm/include/cpuconf.h head/sys/arm/include/cpufunc.h head/sys/arm/include/intr.h head/sys/arm/include/md_var.h head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/cpufunc.c Fri Dec 20 00:56:23 2013 (r259640) @@ -1038,7 +1038,7 @@ struct cpu_functions arm1176_cpufuncs = }; #endif /*CPU_ARM1176 */ -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) struct cpu_functions cortexa_cpufuncs = { /* CPU functions */ @@ -1118,7 +1118,7 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_FA526) || defined(CPU_FA626TE) || defined(CPU_MV_PJ4B) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_CORTEXA) + defined(CPU_CORTEXA) || defined(CPU_KRAIT) static void get_cachetype_cp15(void); @@ -1416,7 +1416,7 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM1136 || CPU_ARM1176 */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) if (cputype == CPU_ID_CORTEXA5 || cputype == CPU_ID_CORTEXA7 || cputype == CPU_ID_CORTEXA8R1 || @@ -1425,7 +1425,8 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA15 ) { + cputype == CPU_ID_CORTEXA15 || + cputype == CPU_ID_KRAIT ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); @@ -2407,7 +2408,7 @@ pj4bv7_setup(args) } #endif /* CPU_MV_PJ4B */ -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) void cortexa_setup(char *args) Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/elf_trampoline.c Fri Dec 20 00:56:23 2013 (r259640) @@ -102,7 +102,7 @@ extern void xscalec3_l2cache_purge(void) #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all extern void sheeva_l2cache_wbinv_all(void); -#elif defined(CPU_CORTEXA) +#elif defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define cpu_idcache_wbinv_all armv7_idcache_wbinv_all #define cpu_l2cache_wbinv_all() #else Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/identcpu.c Fri Dec 20 00:56:23 2013 (r259640) @@ -254,6 +254,8 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA15, CPU_CLASS_CORTEXA, "Cortex A15", generic_steppings }, + { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait", + generic_steppings }, { CPU_ID_SA110, CPU_CLASS_SA1, "SA-110", sa110_steppings }, @@ -353,6 +355,7 @@ const struct cpu_classtab cpu_classes[] { "ARM10E", "CPU_ARM10" }, /* CPU_CLASS_ARM10E */ { "ARM10EJ", "CPU_ARM10" }, /* CPU_CLASS_ARM10EJ */ { "Cortex-A", "CPU_CORTEXA" }, /* CPU_CLASS_CORTEXA */ + { "Krait", "CPU_KRAIT" }, /* CPU_CLASS_KRAIT */ { "SA-1", "CPU_SA110" }, /* CPU_CLASS_SA1 */ { "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */ { "ARM11J", "CPU_ARM11" }, /* CPU_CLASS_ARM11J */ Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/locore.S Fri Dec 20 00:56:23 2013 (r259640) @@ -170,7 +170,7 @@ Lunmapped: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -377,7 +377,7 @@ Ltag: mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif @@ -389,7 +389,7 @@ Ltag: mcr p15, 0, r0, c3, c0, 0 /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE orr r0, r0, #CPU_CONTROL_AF_ENABLE #endif Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/arm/swtch.S Fri Dec 20 00:56:23 2013 (r259640) @@ -131,7 +131,7 @@ ENTRY(cpu_throw) /* Switch to lwp0 context */ ldr r9, .Lcpufuncs -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) mov lr, pc ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] #endif @@ -361,7 +361,7 @@ ENTRY(cpu_switch) cmpeq r0, r5 /* Same DACR? */ beq .Lcs_context_switched /* yes! */ -#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) +#if !defined(CPU_ARM11) && !defined(CPU_CORTEXA) && !defined(CPU_MV_PJ4B) && !defined(CPU_KRAIT) /* * Definately need to flush the cache. */ Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/armreg.h Fri Dec 20 00:56:23 2013 (r259640) @@ -158,6 +158,7 @@ #define CPU_ID_CORTEXA15 0x410fc0f0 #define CPU_ID_SA110 0x4401a100 #define CPU_ID_SA1100 0x4401a110 +#define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ #define CPU_ID_MV88FR331 0x56153310 /* Marvell Feroceon 88FR331 Core */ Modified: head/sys/arm/include/cpuconf.h ============================================================================== --- head/sys/arm/include/cpuconf.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/cpuconf.h Fri Dec 20 00:56:23 2013 (r259640) @@ -66,6 +66,7 @@ defined(CPU_FA626TE) + \ defined(CPU_XSCALE_IXP425)) + \ defined(CPU_CORTEXA) + \ + defined(CPU_KRAIT) + \ defined(CPU_MV_PJ4B) /* @@ -97,7 +98,7 @@ #endif #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_ARCH_7A 1 #else #define ARM_ARCH_7A 0 @@ -156,7 +157,7 @@ #define ARM_MMU_V6 0 #endif -#if defined(CPU_CORTEXA) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) #define ARM_MMU_V7 1 #else #define ARM_MMU_V7 0 Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/cpufunc.h Fri Dec 20 00:56:23 2013 (r259640) @@ -188,7 +188,7 @@ extern u_int cputype; #else void tlb_broadcast(int); -#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) #define TLB_BROADCAST /* No need to explicitely send an IPI */ #else #define TLB_BROADCAST tlb_broadcast(7) @@ -463,7 +463,7 @@ void sheeva_l2cache_wbinv_all (void); #endif #if defined(CPU_ARM1136) || defined(CPU_ARM1176) || \ - defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) + defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) void arm11_setttb (u_int); void arm11_sleep (int); Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/intr.h Fri Dec 20 00:56:23 2013 (r259640) @@ -52,6 +52,8 @@ #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 160 +#elif defined(CPU_KRAIT) +#define NIRQ 288 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) #define NIRQ 128 #elif defined(SOC_MV_ARMADAXP) Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/arm/include/md_var.h Fri Dec 20 00:56:23 2013 (r259640) @@ -63,6 +63,7 @@ enum cpu_class { CPU_CLASS_ARM10E, CPU_CLASS_ARM10EJ, CPU_CLASS_CORTEXA, + CPU_CLASS_KRAIT, CPU_CLASS_SA1, CPU_CLASS_XSCALE, CPU_CLASS_ARM11J, Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/conf/files.arm Fri Dec 20 00:56:23 2013 (r259640) @@ -6,7 +6,7 @@ arm/arm/blockio.S standard arm/arm/bootconfig.c standard arm/arm/bus_space_asm_generic.S standard arm/arm/busdma_machdep.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/busdma_machdep-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard @@ -36,7 +36,7 @@ arm/arm/nexus.c standard arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 -arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b +arm/arm/pmap-v6.c optional cpu_arm1136 | cpu_arm1176 | cpu_cortexa | cpu_mv_pj4b | cpu_krait arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Fri Dec 20 00:47:54 2013 (r259639) +++ head/sys/conf/options.arm Fri Dec 20 00:56:23 2013 (r259640) @@ -12,6 +12,7 @@ CPU_ARM9E opt_global.h CPU_ARM1136 opt_global.h CPU_ARM1176 opt_global.h CPU_CORTEXA opt_global.h +CPU_KRAIT opt_global.h CPU_FA526 opt_global.h CPU_FA626TE opt_global.h CPU_MV_PJ4B opt_global.h From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 02:14:03 2013 Return-Path: Delivered-To: svn-src-all@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 89D0DA50; Fri, 20 Dec 2013 02:14:03 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 440441F68; Fri, 20 Dec 2013 02:14:02 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBK2E1NH051428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Dec 2013 18:14:02 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBK2E1It051427; Thu, 19 Dec 2013 18:14:01 -0800 (PST) (envelope-from jmg) Date: Thu, 19 Dec 2013 18:14:01 -0800 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220021401.GX99167@funkthat.com> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220002849.GH71033@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 19 Dec 2013 18:14:02 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Alexander V. Chernikov" , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 02:14:03 -0000 Gleb Smirnoff wrote this message on Fri, Dec 20, 2013 at 04:28 +0400: > Looks like we are coming to agreement. The way to go is to remove kvm access > from netstat, substituting it with proper APIs. The better crashdump utility > needs to be started. Not yet sure that C + kvm(3) is a proper framework for > it. I don't understand the plan with dtrace based tool well, but reading > John-Marks' email I find it interesting. gdb scripting is also an option. So, CTF contains all the type information necessary and the members of the struct... For example: ctfdump -t /boot/kernel/kernel contains: <919> POINTER (anon) refers to 1556 [...] [1377] POINTER (anon) refers to 919 [1378] STRUCT (anon) (16 bytes) le_next type=919 off=0 le_prev type=1377 off=64 [...] <1556> STRUCT proc (1208 bytes) p_list type=1378 off=0 [...] So, we can now, assuming we don't repurpose field names, have a "copy kernel struct to userland struct" function that uses CTF to make the proper mappings... Obviously if userland has a field that is missing in the kernel or vise versa, or size/type doesn't match, then some handling will be needed, but for the most part we could ignore the new fields as that's often what the tools have to do when we change a padded field to not be padding... The interesting thing about this also is that it would mean we could also remove the need for padding, since the CTF would describe the struct size, etc. I have not looked at the internals of CTF, so I don't know how easy it would be to just extract the parts that we need for the struct, or if we'd need a sysctl to fetch all CTF data, or fetch it from the kernel.. Having the data split may be better so the kernel wouldn't have to fetch it all out each time, etc, plus it could be cached in the library... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 03:32:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 407577B9; Fri, 20 Dec 2013 03:32:49 +0000 (UTC) Date: Fri, 20 Dec 2013 03:32:49 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Subject: Re: svn commit: r259562 - head/usr.bin/netstat Message-ID: <20131220033249.GA38281@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220002849.GH71033@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: src-committers@freebsd.org, "Alexander V. Chernikov" , John Baldwin , John-Mark Gurney , svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 03:32:49 -0000 On Fri, Dec 20, 2013 at 04:28:50AM +0400, Gleb Smirnoff wrote: > in stable branches. I don't have strong opinion on this, I really think that > running kernel and world out of sync is a bad idea, so I may agree with you. This notorious requirement (or strong recommendation) of keeping one's world and kernel in sync is a pain in the ass and an indication of certain design (or implementation) deficiencies. Linux does not have this problem, for instance. It should be perfectly OK to run any kernel and userland within reasonable time frame, instead of it being a bad idea. > Looks like we are coming to agreement. The way to go is to remove kvm access > from netstat, substituting it with proper APIs. Correct. Proper APIs. This would definitely help to decouple kernel and userland. ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 04:46:59 2013 Return-Path: Delivered-To: svn-src-all@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 79ACF847; Fri, 20 Dec 2013 04:46:59 +0000 (UTC) Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com [IPv6:2607:f8b0:400d:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3B67197E; Fri, 20 Dec 2013 04:46:58 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id i13so2278155qae.2 for ; Thu, 19 Dec 2013 20:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=89ePiRYMafFVVSrYCHo/BcvdbtCfVTrPuyJep49RQ8Q=; b=l0hX54+OuFLtvDiG+gmKDKNTou0mJRLPdNCspwOO1o8tjTM1LiJyhtva/sqC+xz2G5 5MWRjcjcjvXJdtbcEMmM3cHWa2PCZhwPqzrLiHSxar1AfbJA1uPmkLAbKELerg3l169H OMDH1dmdIqx9hl/bNKb66xa/vxLThEfzYWCTjyfFddR5pP3X234qosLZQ789quoj3b6o P7vez9zDVTxbu9XsqIA17BUE0Xq9tXCgjHPSgXwKkYKOKfAWbCJ60tLmn96mz2y1cD5D 6SEgn+Vyvsgt/+g3+PZ2LxjyEveAGpJO4GZchzkAOeeWRqhlfNwpZHmL3Ul9AMPwVQ/S 2VHA== MIME-Version: 1.0 X-Received: by 10.229.56.200 with SMTP id z8mr10213809qcg.1.1387514818158; Thu, 19 Dec 2013 20:46:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Thu, 19 Dec 2013 20:46:58 -0800 (PST) In-Reply-To: <52B3620A.8050603@freebsd.org> References: <201312190901.rBJ91ko3036881@svn.freebsd.org> <20131219204903.V24189@besplex.bde.org> <52B32647.2030008@freebsd.org> <52B35B37.5070809@FreeBSD.org> <52B3620A.8050603@freebsd.org> Date: Thu, 19 Dec 2013 20:46:58 -0800 X-Google-Sender-Auth: TeffFGI9SevtEAGLaI4IBOIWFOs Message-ID: Subject: Re: svn commit: r259609 - head/sys/kern From: Adrian Chadd To: Stefan Esser Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andreas Tobler , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 04:46:59 -0000 On 19 December 2013 13:15, Stefan Esser wrote: > NB: I should have known better and should have asked for a review of > this change before it wa committed. Sorry for the inconvenience > caused :( Hey, don't be (too) sorry - you chased down and debugged a substantially annoying bug that's been around since forever. Great work. :) -a From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 05:26:28 2013 Return-Path: Delivered-To: svn-src-all@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 65045306; Fri, 20 Dec 2013 05:26:28 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAAA71D73; Fri, 20 Dec 2013 05:26:27 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so1860112qcv.15 for ; Thu, 19 Dec 2013 21:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=3JOOEd9V1CXSpEwmO2s8pvmsqjegroVffDZfI3SPYs4=; b=SS8yox9aeUAnoe4IpkJ830d/LMGyOxerT01CuSmL91bf+044ypjLwWLNKQAT3Y1fLB fIOtwSbffAPSHTk9blrqW3xqDfK2W+G2wMzXFI9ivo/SUaBu0/mP9709PvL2/FFSVzwQ pmsTfgsa92KH7XU6j+MvoMPYXSU1k01Hd+dbhGMvu9sFGeurCRKKwICXbWA8o1jZZXla VPxZ86s1jWvntQH1S9kSHW26/8Gsj+e3cvOJK6sLwcKguGZbMCNq+OSJOAyYToVKstop Z2EgZyy2OLL3tcn0QszVC4j9pdXQPnznrhkK4cTTU1J0ACqxNxb3nmgwZCUUsuHka7O4 lMkQ== MIME-Version: 1.0 X-Received: by 10.224.13.141 with SMTP id c13mr2723599qaa.76.1387517186881; Thu, 19 Dec 2013 21:26:26 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Thu, 19 Dec 2013 21:26:26 -0800 (PST) In-Reply-To: <20131220033249.GA38281@FreeBSD.org> References: <201312181825.rBIIPR25014515@svn.freebsd.org> <201312181640.52147.jhb@freebsd.org> <20131219115735.GN29088@FreeBSD.org> <201312191552.04202.jhb@freebsd.org> <20131220002849.GH71033@FreeBSD.org> <20131220033249.GA38281@FreeBSD.org> Date: Thu, 19 Dec 2013 21:26:26 -0800 X-Google-Sender-Auth: ucbTBGbuJY8i8j3Ne-3aGSyO1Mc Message-ID: Subject: Re: svn commit: r259562 - head/usr.bin/netstat From: Adrian Chadd To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , "Alexander V. Chernikov" , John Baldwin , John-Mark Gurney , Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 05:26:28 -0000 Linux doesn't have this problem because debugging LInux is a wildly different thing. Maybe it's time we actually just bit the bullet and made libkvm much more fleshed out for pulling out stuff like this from core files. -a From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 05:50:24 2013 Return-Path: Delivered-To: svn-src-all@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 0A554BC6; Fri, 20 Dec 2013 05:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFB391F4B; Fri, 20 Dec 2013 05:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK5oNEk098490; Fri, 20 Dec 2013 05:50:23 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK5oNmw098487; Fri, 20 Dec 2013 05:50:23 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312200550.rBK5oNmw098487@svn.freebsd.org> From: Neel Natu Date: Fri, 20 Dec 2013 05:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 05:50:24 -0000 Author: neel Date: Fri Dec 20 05:50:22 2013 New Revision: 259641 URL: http://svnweb.freebsd.org/changeset/base/259641 Log: Re-arrange bits in the amd64/pmap 'pm_flags' field. The least significant 8 bits of 'pm_flags' are now used for the IPI vector to use for nested page table TLB shootdown. Previously we used IPI_AST to interrupt the host cpu which is functionally correct but could lead to misleading interrupt counts for AST handler. The AST handler was also doing a lot more than what is required for the nested page table TLB shootdown (EOI and IRET). Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/vmm/intel/ept.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/amd64/pmap.c Fri Dec 20 05:50:22 2013 (r259641) @@ -1295,6 +1295,7 @@ pmap_invalidate_page_pcid(pmap_t pmap, v static __inline void pmap_invalidate_ept(pmap_t pmap) { + int ipinum; sched_pin(); KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active), @@ -1319,11 +1320,9 @@ pmap_invalidate_ept(pmap_t pmap) /* * Force the vcpu to exit and trap back into the hypervisor. - * - * XXX this is not optimal because IPI_AST builds a trapframe - * whereas all we need is an 'eoi' followed by 'iret'. */ - ipi_selected(pmap->pm_active, IPI_AST); + ipinum = pmap->pm_flags & PMAP_NESTED_IPIMASK; + ipi_selected(pmap->pm_active, ipinum); sched_unpin(); } Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/include/pmap.h Fri Dec 20 05:50:22 2013 (r259641) @@ -312,9 +312,10 @@ struct pmap { }; /* flags */ -#define PMAP_PDE_SUPERPAGE (1 << 0) /* supports 2MB superpages */ -#define PMAP_EMULATE_AD_BITS (1 << 1) /* needs A/D bits emulation */ -#define PMAP_SUPPORTS_EXEC_ONLY (1 << 2) /* execute only mappings ok */ +#define PMAP_NESTED_IPIMASK 0xff +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ +#define PMAP_EMULATE_AD_BITS (1 << 9) /* needs A/D bits emulation */ +#define PMAP_SUPPORTS_EXEC_ONLY (1 << 10) /* execute only mappings ok */ typedef struct pmap *pmap_t; Modified: head/sys/amd64/vmm/intel/ept.c ============================================================================== --- head/sys/amd64/vmm/intel/ept.c Fri Dec 20 00:56:23 2013 (r259640) +++ head/sys/amd64/vmm/intel/ept.c Fri Dec 20 05:50:22 2013 (r259641) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include "vmx_cpufunc.h" +#include "vmm_ipi.h" #include "vmx_msr.h" #include "ept.h" @@ -98,6 +99,8 @@ ept_init(void) !INVEPT_ALL_TYPES_SUPPORTED(cap)) return (EINVAL); + ept_pmap_flags = vmm_ipinum & PMAP_NESTED_IPIMASK; + use_superpages = 1; TUNABLE_INT_FETCH("hw.vmm.ept.use_superpages", &use_superpages); if (use_superpages && EPT_PDE_SUPERPAGE(cap)) From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 07:41:04 2013 Return-Path: Delivered-To: svn-src-all@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 4559E6E6; Fri, 20 Dec 2013 07:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 187E516E3; Fri, 20 Dec 2013 07:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBK7f3JC038124; Fri, 20 Dec 2013 07:41:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBK7f3tL038123; Fri, 20 Dec 2013 07:41:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312200741.rBK7f3tL038123@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Dec 2013 07:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259642 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 07:41:04 -0000 Author: adrian Date: Fri Dec 20 07:41:03 2013 New Revision: 259642 URL: http://svnweb.freebsd.org/changeset/base/259642 Log: Disable the now unpredicably bogus check for whether we have eneough queue space before queuing a bunch of IP fragments. As the comment in the committed change says, in the post-if_transmit(), post-SMP, post-preemption world, there's just too much overlapping concurrent code paths and different approaches to driver transmit queue management to have this code even remotely be effective. The only specific place it could be useful is if ALTQ is enabled but again it doesn't at all promise that all the fragments will be transmitted anyway. The main reason for committing this change is to disable a parallel place where the drops counter is incremented. This is a side effect of an upcoming change to ixgbe/cxgbe to handle the queue drops counter slightly better. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Dec 20 05:50:22 2013 (r259641) +++ head/sys/netinet/ip_output.c Fri Dec 20 07:41:03 2013 (r259642) @@ -123,7 +123,9 @@ ip_output(struct mbuf *m, struct mbuf *o struct mbuf *m0; int hlen = sizeof (struct ip); int mtu; +#if 0 int n; /* scratchpad */ +#endif int error = 0; struct sockaddr_in *dst; const struct sockaddr_in *gw; @@ -431,6 +433,25 @@ again: } /* + * Both in the SMP world, pre-emption world if_transmit() world, + * the following code doesn't really function as intended any further. + * + * + There can and will be multiple CPUs running this code path + * in parallel, and we do no lock holding when checking the + * queue depth; + * + And since other threads can be running concurrently, even if + * we do pass this check, another thread may queue some frames + * before this thread does and it will end up partially or fully + * failing to send anyway; + * + if_transmit() based drivers don't necessarily set ifq_len + * at all. + * + * This should be replaced with a method of pushing an entire list + * of fragment frames to the driver and have the driver decide + * whether it can queue or not queue the entire set. + */ +#if 0 + /* * Verify that we have any chance at all of being able to queue the * packet or packet fragments, unless ALTQ is enabled on the given * interface in which case packetdrop should be done by queueing. @@ -446,6 +467,7 @@ again: ifp->if_snd.ifq_drops += n; goto bad; } +#endif /* * Look for broadcast address and From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 08:44:37 2013 Return-Path: Delivered-To: svn-src-all@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 A024A7F2; Fri, 20 Dec 2013 08:44:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1741CBB; Fri, 20 Dec 2013 08:44:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBK8iJGq075862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 12:44:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBK8iJnG075861; Fri, 20 Dec 2013 12:44:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 12:44:19 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259642 - head/sys/netinet Message-ID: <20131220084419.GK71033@FreeBSD.org> References: <201312200741.rBK7f3tL038123@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312200741.rBK7f3tL038123@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 08:44:37 -0000 On Fri, Dec 20, 2013 at 07:41:03AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Fri Dec 20 07:41:03 2013 A> New Revision: 259642 A> URL: http://svnweb.freebsd.org/changeset/base/259642 A> A> Log: A> Disable the now unpredicably bogus check for whether we have A> eneough queue space before queuing a bunch of IP fragments. A> A> As the comment in the committed change says, in the post-if_transmit(), A> post-SMP, post-preemption world, there's just too much overlapping A> concurrent code paths and different approaches to driver transmit A> queue management to have this code even remotely be effective. A> A> The only specific place it could be useful is if ALTQ is enabled A> but again it doesn't at all promise that all the fragments will be A> transmitted anyway. A> A> The main reason for committing this change is to disable a parallel A> place where the drops counter is incremented. This is a side effect A> of an upcoming change to ixgbe/cxgbe to handle the queue drops A> counter slightly better. I didn't get to review of actual patch, but IMO it would be better just to remove the code, not ifdef 0 it. The code ifdefed has zero probability to be enabled in its current form. If we ever fix it, code would look very different. No reason to do followup commit, that was just me muttering. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 10:49:58 2013 Return-Path: Delivered-To: svn-src-all@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 70045656; Fri, 20 Dec 2013 10:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA4F16F6; Fri, 20 Dec 2013 10:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKAnwCm006915; Fri, 20 Dec 2013 10:49:58 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKAnwLQ006913; Fri, 20 Dec 2013 10:49:58 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201312201049.rBKAnwLQ006913@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 20 Dec 2013 10:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259643 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 10:49:58 -0000 Author: stas Date: Fri Dec 20 10:49:57 2013 New Revision: 259643 URL: http://svnweb.freebsd.org/changeset/base/259643 Log: - Welcome Ganbold Tsagaankhuu (ganbold) to the team of src committers. He's done a great job working on FreeBSD support for numerous ARM SoCs and now will be able to submit his work directly. I will be his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Dec 20 07:41:03 2013 (r259642) +++ svnadmin/conf/access Fri Dec 20 10:49:57 2013 (r259643) @@ -84,6 +84,7 @@ fjoe gabor gad gallatin +ganbold gavin gber ghelmer Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Dec 20 07:41:03 2013 (r259642) +++ svnadmin/conf/mentors Fri Dec 20 10:49:57 2013 (r259643) @@ -20,6 +20,7 @@ cy andre Co-mentor: glebius edavis davidch eri mlaier Co-mentor: thompsa erwin delphij +ganbold stas jceel wkoszek Co-mentor: cognet jkh rwatson jmmv rpaulo From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 10:57:47 2013 Return-Path: Delivered-To: svn-src-all@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 CF3D592F; Fri, 20 Dec 2013 10:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB6BB1780; Fri, 20 Dec 2013 10:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKAvlvs010158; Fri, 20 Dec 2013 10:57:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKAvlpg010156; Fri, 20 Dec 2013 10:57:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201057.rBKAvlpg010156@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 10:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259644 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 10:57:47 -0000 Author: glebius Date: Fri Dec 20 10:57:47 2013 New Revision: 259644 URL: http://svnweb.freebsd.org/changeset/base/259644 Log: ixgbe(4) takes packet counters from hardware in ixgbe_update_stats_counters(), so we don't need to do a per packet increment, which trashes cache line. Submitted by: oleg Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:49:57 2013 (r259643) +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:57:47 2013 (r259644) @@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr) } ++txr->packets; ++processed; - ++ifp->if_opackets; txr->watchdog_time = ticks; /* Try the next packet */ @@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que) mp->m_next = nbuf->buf; } else { /* Sending this frame */ sendmp->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; rxr->rx_packets++; /* capture data for AIM */ rxr->bytes += sendmp->m_pkthdr.len; From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 12:08:37 2013 Return-Path: Delivered-To: svn-src-all@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 34713E46; Fri, 20 Dec 2013 12:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF6F1DED; Fri, 20 Dec 2013 12:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKC8a6o036130; Fri, 20 Dec 2013 12:08:36 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKC8ab3036129; Fri, 20 Dec 2013 12:08:36 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201312201208.rBKC8ab3036129@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 20 Dec 2013 12:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259645 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 12:08:37 -0000 Author: melifaro Date: Fri Dec 20 12:08:36 2013 New Revision: 259645 URL: http://svnweb.freebsd.org/changeset/base/259645 Log: Further split kvm(3) and sysctl interfaces for route table printing. MFC after: 4 weeks Sponsored by: Yandex LLC Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Fri Dec 20 10:57:47 2013 (r259644) +++ head/usr.bin/netstat/route.c Fri Dec 20 12:08:36 2013 (r259645) @@ -139,7 +139,6 @@ int do_rtent = 0; struct rtentry rtentry; struct radix_node rnode; struct radix_mask rmask; -struct radix_node_head **rt_tables; int NewTree = 1; @@ -149,16 +148,17 @@ static struct sockaddr *kgetsa(struct so static void size_cols(int ef, struct radix_node *rn); static void size_cols_tree(struct radix_node *rn); static void size_cols_rtentry(struct rtentry *rt); -static void p_tree(struct radix_node *); -static void p_rtnode(void); -static void ntreestuff(int fibnum, int af); -static void np_rtentry(struct rt_msghdr *); +static void p_rtnode_kvm(void); +static void p_rtable_sysctl(int, int); +static void p_rtable_kvm(int, int ); +static void p_rtree_kvm(struct radix_node *); +static void p_rtentry_sysctl(struct rt_msghdr *); static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags); static void p_flags(int, const char *); static const char *fmt_flags(int f); -static void p_rtentry(struct rtentry *); +static void p_rtentry_kvm(struct rtentry *); static void domask(char *, in_addr_t, u_long); /* @@ -167,10 +167,8 @@ static void domask(char *, in_addr_t, u_ void routepr(int fibnum, int af) { - struct radix_node_head **rnhp, *rnh, head; - u_long rtree; size_t intsize; - int fam, numfibs; + int numfibs; intsize = sizeof(int); if (fibnum == -1 && @@ -194,60 +192,12 @@ routepr(int fibnum, int af) printf("\n"); if (Aflag == 0 && live != 0 && NewTree) - ntreestuff(fibnum, af); - else { - kresolve_list(rl); - if ((rtree = rl[N_RTREE].n_value) == 0) { - printf("rt_tables: symbol not in namelist\n"); - return; - } - - rt_tables = calloc(numfibs * (AF_MAX + 1), - sizeof(struct radix_node_head *)); - if (rt_tables == NULL) - err(EX_OSERR, "memory allocation failed"); - - if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs * - (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0) - return; - for (fam = 0; fam <= AF_MAX; fam++) { - int tmpfib; - - switch (fam) { - case AF_INET6: - case AF_INET: - tmpfib = fibnum; - break; - default: - tmpfib = 0; - } - rnhp = (struct radix_node_head **)*rt_tables; - /* Calculate the in-kernel address. */ - rnhp += tmpfib * (AF_MAX+1) + fam; - /* Read the in kernel rhn pointer. */ - if (kget(rnhp, rnh) != 0) - continue; - if (rnh == NULL) - continue; - /* Read the rnh data. */ - if (kget(rnh, head) != 0) - continue; - if (fam == AF_UNSPEC) { - if (Aflag && af == 0) { - printf("Netmasks:\n"); - p_tree(head.rnh_treetop); - } - } else if (af == AF_UNSPEC || af == fam) { - size_cols(fam, head.rnh_treetop); - pr_family(fam); - do_rtent = 1; - pr_rthdr(fam); - p_tree(head.rnh_treetop); - } - } - } + p_rtable_sysctl(fibnum, af); + else + p_rtable_kvm(fibnum, af); } + /* * Print address family header before a section of the routing table. */ @@ -451,8 +401,75 @@ kgetsa(struct sockaddr *dst) return (&pt_u.u_sa); } +/* + * Print kernel routing tables for given fib + * using debugging kvm(3) interface. + */ +static void +p_rtable_kvm(int fibnum, int af) +{ + struct radix_node_head **rnhp, *rnh, head; + struct radix_node_head **rt_tables; + u_long rtree; + int fam, af_size; + + kresolve_list(rl); + if ((rtree = rl[N_RTREE].n_value) == 0) { + printf("rt_tables: symbol not in namelist\n"); + return; + } + + af_size = (AF_MAX + 1) * sizeof(struct radix_node_head *); + rt_tables = calloc(1, af_size); + if (rt_tables == NULL) + err(EX_OSERR, "memory allocation failed"); + + if (kread((u_long)(rtree), (char *)(rt_tables) + fibnum * af_size, + af_size) != 0) + return; + for (fam = 0; fam <= AF_MAX; fam++) { + int tmpfib; + + switch (fam) { + case AF_INET6: + case AF_INET: + tmpfib = fibnum; + break; + default: + tmpfib = 0; + } + rnhp = (struct radix_node_head **)*rt_tables; + /* Calculate the in-kernel address. */ + rnhp += tmpfib * (AF_MAX + 1) + fam; + /* Read the in kernel rhn pointer. */ + if (kget(rnhp, rnh) != 0) + continue; + if (rnh == NULL) + continue; + /* Read the rnh data. */ + if (kget(rnh, head) != 0) + continue; + if (fam == AF_UNSPEC) { + if (Aflag && af == 0) { + printf("Netmasks:\n"); + p_rtree_kvm(head.rnh_treetop); + } + } else if (af == AF_UNSPEC || af == fam) { + size_cols(fam, head.rnh_treetop); + pr_family(fam); + do_rtent = 1; + pr_rthdr(fam); + p_rtree_kvm(head.rnh_treetop); + } + } +} + +/* + * Print given kernel radix tree using + * debugging kvm(3) interface. + */ static void -p_tree(struct radix_node *rn) +p_rtree_kvm(struct radix_node *rn) { again: @@ -469,9 +486,9 @@ again: rnode.rn_dupedkey ? " =>\n" : "\n"); } else if (do_rtent) { if (kget(rn, rtentry) == 0) { - p_rtentry(&rtentry); + p_rtentry_kvm(&rtentry); if (Aflag) - p_rtnode(); + p_rtnode_kvm(); } } else { p_sockaddr(kgetsa((struct sockaddr *)rnode.rn_key), @@ -483,18 +500,18 @@ again: } else { if (Aflag && do_rtent) { printf("%-8.8lx ", (u_long)rn); - p_rtnode(); + p_rtnode_kvm(); } rn = rnode.rn_right; - p_tree(rnode.rn_left); - p_tree(rn); + p_rtree_kvm(rnode.rn_left); + p_rtree_kvm(rn); } } char nbuf[20]; static void -p_rtnode(void) +p_rtnode_kvm(void) { struct radix_mask *rm = rnode.rn_mklist; @@ -534,7 +551,7 @@ p_rtnode(void) } static void -ntreestuff(int fibnum, int af) +p_rtable_sysctl(int fibnum, int af) { size_t needed; int mib[7]; @@ -611,12 +628,12 @@ ntreestuff(int fibnum, int af) pr_family(fam); pr_rthdr(fam); } - np_rtentry(rtm); + p_rtentry_sysctl(rtm); } } static void -np_rtentry(struct rt_msghdr *rtm) +p_rtentry_sysctl(struct rt_msghdr *rtm) { struct sockaddr *sa = (struct sockaddr *)(rtm + 1); char buffer[128]; @@ -833,7 +850,7 @@ fmt_flags(int f) } static void -p_rtentry(struct rtentry *rt) +p_rtentry_kvm(struct rtentry *rt) { static struct ifnet ifnet, *lastif; static char buffer[128]; From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 13:12:46 2013 Return-Path: Delivered-To: svn-src-all@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 77372E1; Fri, 20 Dec 2013 13:12:46 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09E52134A; Fri, 20 Dec 2013 13:12:46 +0000 (UTC) Received: from [192.168.1.200] (p508F063C.dip0.t-ipconnect.de [80.143.6.60]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 343411C0C0693; Fri, 20 Dec 2013 14:12:44 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r259644 - head/sys/dev/ixgbe From: Michael Tuexen In-Reply-To: <201312201057.rBKAvlpg010156@svn.freebsd.org> Date: Fri, 20 Dec 2013 14:12:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> References: <201312201057.rBKAvlpg010156@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1510) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 13:12:46 -0000 On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff wrote: I think you need something like [bsd5:~/head] tuexen% svn diff Index: sys/dev/ixgbe/ixgbe.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/ixgbe/ixgbe.c (revision 259645) +++ sys/dev/ixgbe/ixgbe.c (working copy) @@ -3592,8 +3592,10 @@ static void ixgbe_txeof(struct tx_ring *txr) { +#ifdef DEV_NETMAP struct adapter *adapter =3D txr->adapter; struct ifnet *ifp =3D adapter->ifp; +#endif u32 work, processed =3D 0; u16 limit =3D txr->process_limit; struct ixgbe_tx_buf *buf; to get it compiling if DEV_NETMAP is not defined. Best regards Michael > Author: glebius > Date: Fri Dec 20 10:57:47 2013 > New Revision: 259644 > URL: http://svnweb.freebsd.org/changeset/base/259644 >=20 > Log: > ixgbe(4) takes packet counters from hardware in = ixgbe_update_stats_counters(), > so we don't need to do a per packet increment, which trashes cache = line. >=20 > Submitted by: oleg >=20 > Modified: > head/sys/dev/ixgbe/ixgbe.c >=20 > Modified: head/sys/dev/ixgbe/ixgbe.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:49:57 2013 = (r259643) > +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 10:57:47 2013 = (r259644) > @@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr) > } > ++txr->packets; > ++processed; > - ++ifp->if_opackets; > txr->watchdog_time =3D ticks; >=20 > /* Try the next packet */ > @@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que) > mp->m_next =3D nbuf->buf; > } else { /* Sending this frame */ > sendmp->m_pkthdr.rcvif =3D ifp; > - ifp->if_ipackets++; > rxr->rx_packets++; > /* capture data for AIM */ > rxr->bytes +=3D sendmp->m_pkthdr.len; >=20 From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 13:17:02 2013 Return-Path: Delivered-To: svn-src-all@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 D260F497; Fri, 20 Dec 2013 13:17:02 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD011387; Fri, 20 Dec 2013 13:17:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBKDGxm6077345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 20 Dec 2013 17:16:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBKDGx7c077344; Fri, 20 Dec 2013 17:16:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Dec 2013 17:16:59 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r259644 - head/sys/dev/ixgbe Message-ID: <20131220131659.GQ71033@FreeBSD.org> References: <201312201057.rBKAvlpg010156@svn.freebsd.org> <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79AC6A0A-D8DC-4AFC-8699-5E9D6E437C20@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 13:17:02 -0000 On Fri, Dec 20, 2013 at 02:12:42PM +0100, Michael Tuexen wrote: M> On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff wrote: M> M> I think you need something like M> M> [bsd5:~/head] tuexen% svn diff M> Index: sys/dev/ixgbe/ixgbe.c M> =================================================================== M> --- sys/dev/ixgbe/ixgbe.c (revision 259645) M> +++ sys/dev/ixgbe/ixgbe.c (working copy) M> @@ -3592,8 +3592,10 @@ M> static void M> ixgbe_txeof(struct tx_ring *txr) M> { M> +#ifdef DEV_NETMAP M> struct adapter *adapter = txr->adapter; M> struct ifnet *ifp = adapter->ifp; M> +#endif M> u32 work, processed = 0; M> u16 limit = txr->process_limit; M> struct ixgbe_tx_buf *buf; M> M> to get it compiling if DEV_NETMAP is not defined. Thanks, Michael. And sorry for broken build. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 13:18:51 2013 Return-Path: Delivered-To: svn-src-all@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 7957A68C; Fri, 20 Dec 2013 13:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6544B139F; Fri, 20 Dec 2013 13:18:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKDIpge061898; Fri, 20 Dec 2013 13:18:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKDIpI9061897; Fri, 20 Dec 2013 13:18:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201318.rBKDIpI9061897@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 13:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259646 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 13:18:51 -0000 Author: glebius Date: Fri Dec 20 13:18:50 2013 New Revision: 259646 URL: http://svnweb.freebsd.org/changeset/base/259646 Log: Fix build broken in r259644. Submitted by: tuexen Pointy hat to: glebius Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 12:08:36 2013 (r259645) +++ head/sys/dev/ixgbe/ixgbe.c Fri Dec 20 13:18:50 2013 (r259646) @@ -3592,8 +3592,10 @@ ixgbe_atr(struct tx_ring *txr, struct mb static void ixgbe_txeof(struct tx_ring *txr) { +#ifdef DEV_NETMAP struct adapter *adapter = txr->adapter; struct ifnet *ifp = adapter->ifp; +#endif u32 work, processed = 0; u16 limit = txr->process_limit; struct ixgbe_tx_buf *buf; From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 14:03:57 2013 Return-Path: Delivered-To: svn-src-all@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 9A9C93BC; Fri, 20 Dec 2013 14:03:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 863D91741; Fri, 20 Dec 2013 14:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKE3vPW079027; Fri, 20 Dec 2013 14:03:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKE3ubm079021; Fri, 20 Dec 2013 14:03:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201312201403.rBKE3ubm079021@svn.freebsd.org> From: Attilio Rao Date: Fri, 20 Dec 2013 14:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259647 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 14:03:57 -0000 Author: attilio Date: Fri Dec 20 14:03:56 2013 New Revision: 259647 URL: http://svnweb.freebsd.org/changeset/base/259647 Log: o Remove assertions on ipa_version as sometimes the version detection using cpuid can be quirky (this is the case of VMWare without the vPMC support) but fail to probe hwpmc. o Apply the fix for XEON family of processors as established by 315338-020 document (bug AJ85). Sponsored by: EMC / Isilon storage division Reviewed by: fabient Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 14:03:56 2013 (r259647) @@ -2627,35 +2627,33 @@ core2_intr(int cpu, struct trapframe *tf } int -pmc_core_initialize(struct pmc_mdep *md, int maxcpu) +pmc_core_initialize(struct pmc_mdep *md, int maxcpu, int version_override) { int cpuid[CORE_CPUID_REQUEST_SIZE]; int ipa_version, flags, nflags; do_cpuid(CORE_CPUID_REQUEST, cpuid); - ipa_version = cpuid[CORE_CPUID_EAX] & 0xFF; + ipa_version = (version_override > 0) ? version_override : + cpuid[CORE_CPUID_EAX] & 0xFF; + core_cputype = md->pmd_cputype; PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", - md->pmd_cputype, maxcpu, ipa_version); + core_cputype, maxcpu, ipa_version); - if (ipa_version < 1 || ipa_version > 3) { + if (ipa_version < 1 || ipa_version > 3 || + (core_cputype != PMC_CPU_INTEL_CORE && ipa_version == 1)) { /* Unknown PMC architecture. */ printf("hwpc_core: unknown PMC architecture: %d\n", ipa_version); return (EPROGMISMATCH); } - core_cputype = md->pmd_cputype; - core_pmcmask = 0; /* * Initialize programmable counters. */ - KASSERT(ipa_version >= 1, - ("[core,%d] ipa_version %d too small", __LINE__, ipa_version)); - core_iap_npmc = (cpuid[CORE_CPUID_EAX] >> 8) & 0xFF; core_iap_width = (cpuid[CORE_CPUID_EAX] >> 16) & 0xFF; @@ -2670,10 +2668,6 @@ pmc_core_initialize(struct pmc_mdep *md, * Initialize fixed function counters, if present. */ if (core_cputype != PMC_CPU_INTEL_CORE) { - KASSERT(ipa_version >= 2, - ("[core,%d] ipa_version %d too small", __LINE__, - ipa_version)); - core_iaf_ri = core_iap_npmc; core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F; core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF; Modified: head/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 14:03:56 2013 (r259647) @@ -175,7 +175,8 @@ struct pmc_md_iap_pmc { * Prototypes. */ -int pmc_core_initialize(struct pmc_mdep *_md, int _maxcpu); +int pmc_core_initialize(struct pmc_mdep *_md, int _maxcpu, + int _version_override); void pmc_core_finalize(struct pmc_mdep *_md); void pmc_core_mark_started(int _cpu, int _pmc); Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 13:18:50 2013 (r259646) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 14:03:56 2013 (r259647) @@ -78,7 +78,7 @@ pmc_intel_initialize(void) { struct pmc_mdep *pmc_mdep; enum pmc_cputype cputype; - int error, model, nclasses, ncpus; + int error, model, nclasses, ncpus, stepping, verov; KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[intel,%d] Initializing non-intel processor", __LINE__)); @@ -88,7 +88,9 @@ pmc_intel_initialize(void) cputype = -1; nclasses = 2; error = 0; + verov = 0; model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); + stepping = cpu_id & 0xF; switch (cpu_id & 0xF00) { #if defined(__i386__) @@ -119,8 +121,14 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_CORE; break; case 0xF: - cputype = PMC_CPU_INTEL_CORE2; - nclasses = 3; + /* Per Intel document 315338-020. */ + if (stepping == 0x7) { + cputype = PMC_CPU_INTEL_CORE; + verov = 1; + } else { + cputype = PMC_CPU_INTEL_CORE2; + nclasses = 3; + } break; case 0x17: cputype = PMC_CPU_INTEL_CORE2EXTREME; @@ -210,7 +218,7 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: case PMC_CPU_INTEL_HASWELL: - error = pmc_core_initialize(pmc_mdep, ncpus); + error = pmc_core_initialize(pmc_mdep, ncpus, verov); break; /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 14:43:34 2013 Return-Path: Delivered-To: svn-src-all@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 4B192E23; Fri, 20 Dec 2013 14:43:34 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D03301A18; Fri, 20 Dec 2013 14:43:32 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBKEgsNG092114; Fri, 20 Dec 2013 15:43:23 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52B4576E.7030203@FreeBSD.org> Date: Fri, 20 Dec 2013 15:42:54 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r259619 - in head/contrib/gcc: . cp doc References: <201312191827.rBJIRWPc047314@svn.freebsd.org> In-Reply-To: <201312191827.rBJIRWPc047314@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 14:43:34 -0000 On 19.12.13 19:27, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 19 18:27:32 2013 > New Revision: 259619 > URL: http://svnweb.freebsd.org/changeset/base/259619 > > Log: > gcc: backport upstream fix for issue with C++'s placement new > > Fixes GCC libstdc++/29286 > > Obtained from: gcc 4.3 (rev. 125603, 125653; GPLv2) > MFC after: 2 weeks Pedro, is this commit complete? If so, please revert. I get a compiler on powerpc64 which immediately segfaults. Thanks, Andreas From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 14:56:55 2013 Return-Path: Delivered-To: svn-src-all@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 B76AC80D; Fri, 20 Dec 2013 14:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96F201AE7; Fri, 20 Dec 2013 14:56:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKEutiY098389; Fri, 20 Dec 2013 14:56:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKEurZW098371; Fri, 20 Dec 2013 14:56:53 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201456.rBKEurZW098371@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 14:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259649 - in head/contrib/gcc: . config cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 14:56:55 -0000 Author: pfg Date: Fri Dec 20 14:56:52 2013 New Revision: 259649 URL: http://svnweb.freebsd.org/changeset/base/259649 Log: gcc: more diff reductions against Apple GCC. Mostly cosmetical changes to aid further merges. Obtained from: gcc 4.3 (rev. 120611, 124839; GPLv2) MFC after: 1 week Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/config/darwin.h head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/Make-lang.in head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/rtti.c head/contrib/gcc/doc/tm.texi head/contrib/gcc/dwarf2out.c head/contrib/gcc/sched-vis.c head/contrib/gcc/target-def.h head/contrib/gcc/target.h head/contrib/gcc/tree-dump.c Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 14:56:52 2013 (r259649) @@ -150,6 +150,14 @@ regs_invalidated_by_call, rather than just checking the membership of REGNO (REG). +2007-05-18 Geoffrey Keating (r124839) + + * dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'. + (output_die): Use 'unsigned long' with %x. + * sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and + HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT. + * tree-dump.c (dump_pointer): Use 'unsigned long' for %lx. + 2007-05-16 Eric Christopher (r124763) * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register @@ -470,6 +478,14 @@ * c-common.c (vector_types_convertible_p): Treat opaque types as always convertible if they have the same size, but not otherwise. +2007-01-08 Geoffrey Keating (r120611) + + * target.h (struct gcc_target): New field library_rtti_comdat. + * target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New. + (TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT. + * doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT. + * config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define. + 2007-01-08 Mark Shinwell (r120572) * c.opt: Add -flax-vector-conversions. Modified: head/contrib/gcc/config/darwin.h ============================================================================== --- head/contrib/gcc/config/darwin.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/config/darwin.h Fri Dec 20 14:56:52 2013 (r259649) @@ -467,6 +467,10 @@ extern GTY(()) int darwin_ms_struct; with names, so it's safe to make the class data not comdat. */ #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false +/* For efficiency, on Darwin the RTTI information that is always + emitted in the standard C++ library should not be COMDAT. */ +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false + /* We make exception information linkonce. */ #undef TARGET_USES_WEAK_UNWIND_INFO #define TARGET_USES_WEAK_UNWIND_INFO 1 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:56:52 2013 (r259649) @@ -35,6 +35,10 @@ * typeck.c (build_binary_op): Include types in error. +2007-05-18 Geoffrey Keating (r124839) + + * mangle.c (write_real_cst): Use 'unsigned long' for %lx. + 2007-05-05 Geoffrey Keating (r124467) PR 31775 Modified: head/contrib/gcc/cp/Make-lang.in ============================================================================== --- head/contrib/gcc/cp/Make-lang.in Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/Make-lang.in Fri Dec 20 14:56:52 2013 (r259649) @@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_ $(TARGET_H) debug.h cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ - gt-cp-rtti.h + $(TARGET_H) gt-cp-rtti.h cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 14:56:52 2013 (r259649) @@ -1340,7 +1340,7 @@ write_real_cst (const tree value) for (; i != limit; i += dir) { - sprintf (buffer, "%08lx", target_real[i]); + sprintf (buffer, "%08lx", (unsigned long) target_real[i]); write_chars (buffer, 8); } } Modified: head/contrib/gcc/cp/rtti.c ============================================================================== --- head/contrib/gcc/cp/rtti.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/cp/rtti.c Fri Dec 20 14:56:52 2013 (r259649) @@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA. */ #include "assert.h" #include "toplev.h" #include "convert.h" +#include "target.h" /* C++ returns type information to the user in struct type_info objects. We also use type information to implement dynamic_cast and @@ -1427,8 +1428,11 @@ emit_support_tinfos (void) comdat_linkage for details.) Since we want these objects to have external linkage so that copies do not have to be emitted in code outside the runtime library, we make them - non-COMDAT here. */ - if (!flag_weak) + non-COMDAT here. + + It might also not be necessary to follow this detail of the + ABI. */ + if (!flag_weak || ! targetm.cxx.library_rtti_comdat ()) { gcc_assert (TREE_PUBLIC (tinfo) && !DECL_COMDAT (tinfo)); DECL_INTERFACE_KNOWN (tinfo) = 1; Modified: head/contrib/gcc/doc/tm.texi ============================================================================== --- head/contrib/gcc/doc/tm.texi Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/doc/tm.texi Fri Dec 20 14:56:52 2013 (r259649) @@ -8953,6 +8953,12 @@ classes whose virtual table will be emit unit will not be COMDAT. @end deftypefn +@deftypefn {Target Hook} bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void) +This hook returns true (the default) if the RTTI information for +the basic types which is defined in the C++ runtime should always +be COMDAT, false if it should not be COMDAT. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void) This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI) should be used to register static destructors when @option{-fuse-cxa-atexit} Modified: head/contrib/gcc/dwarf2out.c ============================================================================== --- head/contrib/gcc/dwarf2out.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/dwarf2out.c Fri Dec 20 14:56:52 2013 (r259649) @@ -5741,11 +5741,11 @@ print_die (dw_die_ref die, FILE *outfile unsigned ix; print_spaces (outfile); - fprintf (outfile, "DIE %4lu: %s\n", + fprintf (outfile, "DIE %4ld: %s\n", die->die_offset, dwarf_tag_name (die->die_tag)); print_spaces (outfile); fprintf (outfile, " abbrev id: %lu", die->die_abbrev); - fprintf (outfile, " offset: %lu\n", die->die_offset); + fprintf (outfile, " offset: %ld\n", die->die_offset); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -5793,7 +5793,7 @@ print_die (dw_die_ref die, FILE *outfile if (AT_ref (a)->die_symbol) fprintf (outfile, "die -> label: %s", AT_ref (a)->die_symbol); else - fprintf (outfile, "die -> %lu", AT_ref (a)->die_offset); + fprintf (outfile, "die -> %ld", AT_ref (a)->die_offset); } else fprintf (outfile, "die -> "); @@ -7063,7 +7063,8 @@ output_die (dw_die_ref die) output_die_symbol (die); dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (0x%lx) %s)", - die->die_offset, dwarf_tag_name (die->die_tag)); + (unsigned long)die->die_offset, + dwarf_tag_name (die->die_tag)); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -7245,7 +7246,7 @@ output_die (dw_die_ref die) /* Add null byte to terminate sibling list. */ if (die->die_child != NULL) dw2_asm_output_data (1, 0, "end of children of DIE 0x%lx", - die->die_offset); + (unsigned long) die->die_offset); } /* Output the compilation unit that appears at the beginning of the Modified: head/contrib/gcc/sched-vis.c ============================================================================== --- head/contrib/gcc/sched-vis.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/sched-vis.c Fri Dec 20 14:56:52 2013 (r259649) @@ -430,7 +430,10 @@ print_value (char *buf, rtx x, int verbo if (FLOAT_MODE_P (GET_MODE (x))) real_to_decimal (t, CONST_DOUBLE_REAL_VALUE (x), sizeof (t), 0, 1); else - sprintf (t, "<0x%lx,0x%lx>", (long) CONST_DOUBLE_LOW (x), (long) CONST_DOUBLE_HIGH (x)); + sprintf (t, + "<" HOST_WIDE_INT_PRINT_HEX "," HOST_WIDE_INT_PRINT_HEX ">", + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x), + (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x)); cur = safe_concat (buf, cur, t); break; case CONST_STRING: Modified: head/contrib/gcc/target-def.h ============================================================================== --- head/contrib/gcc/target-def.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/target-def.h Fri Dec 20 14:56:52 2013 (r259649) @@ -587,6 +587,10 @@ Foundation, 51 Franklin Street, Fifth Fl #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_true #endif +#ifndef TARGET_CXX_LIBRARY_RTTI_COMDAT +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_true +#endif + #ifndef TARGET_CXX_USE_AEABI_ATEXIT #define TARGET_CXX_USE_AEABI_ATEXIT hook_bool_void_false #endif @@ -606,6 +610,7 @@ Foundation, 51 Franklin Street, Fifth Fl TARGET_CXX_KEY_METHOD_MAY_BE_INLINE, \ TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY, \ TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT, \ + TARGET_CXX_LIBRARY_RTTI_COMDAT, \ TARGET_CXX_USE_AEABI_ATEXIT, \ TARGET_CXX_ADJUST_CLASS_AT_DEFINITION \ } Modified: head/contrib/gcc/target.h ============================================================================== --- head/contrib/gcc/target.h Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/target.h Fri Dec 20 14:56:52 2013 (r259649) @@ -783,6 +783,10 @@ struct gcc_target class data for classes whose virtual table will be emitted in only one translation unit will not be COMDAT. */ bool (*class_data_always_comdat) (void); + /* Returns true (the default) if the RTTI for the basic types, + which is always defined in the C++ runtime, should be COMDAT; + false if it should not be COMDAT. */ + bool (*library_rtti_comdat) (void); /* Returns true if __aeabi_atexit should be used to register static destructors. */ bool (*use_aeabi_atexit) (void); Modified: head/contrib/gcc/tree-dump.c ============================================================================== --- head/contrib/gcc/tree-dump.c Fri Dec 20 14:33:48 2013 (r259648) +++ head/contrib/gcc/tree-dump.c Fri Dec 20 14:56:52 2013 (r259649) @@ -166,7 +166,7 @@ void dump_pointer (dump_info_p di, const char *field, void *ptr) { dump_maybe_newline (di); - fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr); + fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr); di->column += 15; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 15:37:57 2013 Return-Path: Delivered-To: svn-src-all@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 C94924F5; Fri, 20 Dec 2013 15:37:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B556F1EA0; Fri, 20 Dec 2013 15:37:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFbvGO013398; Fri, 20 Dec 2013 15:37:57 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFbv9M013396; Fri, 20 Dec 2013 15:37:57 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312201537.rBKFbv9M013396@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 20 Dec 2013 15:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259650 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 15:37:57 -0000 Author: ray Date: Fri Dec 20 15:37:57 2013 New Revision: 259650 URL: http://svnweb.freebsd.org/changeset/base/259650 Log: Set mouse level per window, instead of global. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Dec 20 14:56:52 2013 (r259649) +++ head/sys/dev/vt/vt.h Fri Dec 20 15:37:57 2013 (r259650) @@ -244,6 +244,7 @@ struct vt_window { int vw_kbdmode; /* (?) Keyboard mode. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ + int vw_mouse_level;/* Mouse op mode. */ #define VWF_BUSY 0x1 /* Busy reconfiguring device. */ #define VWF_OPENED 0x2 /* TTY in use. */ #define VWF_SCROLL 0x4 /* Keys influence scrollback. */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 14:56:52 2013 (r259649) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 15:37:57 2013 (r259650) @@ -633,6 +633,9 @@ vtterm_param(struct terminal *tm, int cm case TP_SHOWCURSOR: vtbuf_cursor_visibility(&vw->vw_buf, arg); break; + case TP_MOUSE: + vw->vw_mouse_level = arg; + break; } } @@ -1206,7 +1209,7 @@ vt_mouse_event(int type, int x, int y, i * under mouse pointer when nothing changed. */ - if (mlevel > 0) + if (vw->vw_mouse_level > 0) vt_mouse_terminput(vd, type, x, y, event, cnt); switch (type) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 15:45:23 2013 Return-Path: Delivered-To: svn-src-all@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 2A8D6783; Fri, 20 Dec 2013 15:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16C511F38; Fri, 20 Dec 2013 15:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFjMQC016905; Fri, 20 Dec 2013 15:45:22 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFjMkG016904; Fri, 20 Dec 2013 15:45:22 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312201545.rBKFjMkG016904@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 20 Dec 2013 15:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259651 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 15:45:23 -0000 Author: ray Date: Fri Dec 20 15:45:22 2013 New Revision: 259651 URL: http://svnweb.freebsd.org/changeset/base/259651 Log: Enable AltGr key by default. Asked by: many Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 15:37:57 2013 (r259650) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 15:45:22 2013 (r259651) @@ -113,7 +113,7 @@ const struct terminal_class vt_termclass int sc_txtmouse_no_retrace_wait; static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "Newcons parameters"); -VT_SYSCTL_INT(enable_altgr, 0, "Enable AltGr key (Do not assume R.Alt as Alt)"); +VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "Newcons debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 15:46:25 2013 Return-Path: Delivered-To: svn-src-all@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 D7E178D2; Fri, 20 Dec 2013 15:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2A021F45; Fri, 20 Dec 2013 15:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFkPUZ017051; Fri, 20 Dec 2013 15:46:25 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFkPg4017047; Fri, 20 Dec 2013 15:46:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312201546.rBKFkPg4017047@svn.freebsd.org> From: Devin Teske Date: Fri, 20 Dec 2013 15:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259652 - releng/10.0/usr.sbin/bsdinstall/scripts X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 15:46:26 -0000 Author: dteske Date: Fri Dec 20 15:46:24 2013 New Revision: 259652 URL: http://svnweb.freebsd.org/changeset/base/259652 Log: MFS10 SVN r259621: MFC r259276,259468-259470,259472,259474,259476-259478,259480-259481,259570, 259572, and 259597-259598... r259276: Fix bug in `services' script in adding dumpdev comment to rc.conf r259468: Ignore spurious escape generated by VMware's Ctrl-Cmd combination r259469: Mask errors in `config' script from newaliases(1) about non-FQHN r259470: Set atime=on for /var/mail zfsboot dataset to support mail server r259472: Accept NULL input for zfsboot SWAP to indicate SWAP of zero bytes r259474: Multiple changes, including bug-fixes and debugging improvements r259476: Change default ZFS disk layout, making it easier to resize r259477: fletcher4 is now the default (zfsboot related) r259478: De-uglify the geli(8)-setup infobox (zfsboot related) r259480: Fix ghosted zroot issue by always performing labelclear on swap r259481: Auto-enable 4k sector alignmet when geli(8) is enabled (zfsboot) r259570: Fix numerical comparison error (zfsboot) r259572: Mask spurious rm error in bsdinstall_log from `auto' script r259597: Fix zfsboot regression when installing to 3+ disks r259598: Set cachefile property of bootpool so it imports to new system Approved by: re (gjb) Modified: releng/10.0/usr.sbin/bsdinstall/scripts/auto releng/10.0/usr.sbin/bsdinstall/scripts/config releng/10.0/usr.sbin/bsdinstall/scripts/services releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/scripts/auto Fri Dec 20 15:45:22 2013 (r259651) +++ releng/10.0/usr.sbin/bsdinstall/scripts/auto Fri Dec 20 15:46:24 2013 (r259652) @@ -49,6 +49,10 @@ error() { ############################################################ MAIN +# Don't send ESC on function-key 62/63 (left/right command key) +f_quietly kbdcontrol -f 62 '' +f_quietly kbdcontrol -f 63 '' + f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC @@ -99,7 +103,7 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then export BSDINSTALL_DISTSITE fi -rm $PATH_FSTAB +rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ @@ -120,8 +124,7 @@ exec 3>&1 PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ --title "Partitioning" \ --menu "How would you like to partition your disk?" \ - 0 0 0 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi + 0 0 0 2>&1 1>&3` || exit 1 exec 3>&- case "$PARTMODE" in Modified: releng/10.0/usr.sbin/bsdinstall/scripts/config ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/scripts/config Fri Dec 20 15:45:22 2013 (r259651) +++ releng/10.0/usr.sbin/bsdinstall/scripts/config Fri Dec 20 15:46:24 2013 (r259652) @@ -42,7 +42,7 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHR [ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/ # Set up other things from installed config -chroot $BSDINSTALL_CHROOT /usr/bin/newaliases +chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 ################################################################################ # END Modified: releng/10.0/usr.sbin/bsdinstall/scripts/services ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/scripts/services Fri Dec 20 15:45:22 2013 (r259651) +++ releng/10.0/usr.sbin/bsdinstall/scripts/services Fri Dec 20 15:46:24 2013 (r259652) @@ -50,13 +50,12 @@ DAEMONS=$(dialog --backtitle "FreeBSD In 2>&1 1>&3) exec 3>&- -local havedump= +havedump= for daemon in $DAEMONS; do if [ "$daemon" == "dumpdev" ]; then havedump=1 - echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \ - \"NO\" to disable >> \ - $BSDINSTALL_TMPETC/rc.conf.services + echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services continue fi Modified: releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Fri Dec 20 15:45:22 2013 (r259651) +++ releng/10.0/usr.sbin/bsdinstall/scripts/zfsboot Fri Dec 20 15:46:24 2013 (r259652) @@ -66,23 +66,30 @@ f_include $BSDCFG_SHARE/variable.subr # # Should we use geli(8) to encrypt the drives? +# NB: Automatically enables ZFSBOOT_BOOT_POOL # : ${ZFSBOOT_GELI_ENCRYPTION=} # -# Default name the unencrypted pool when using geli(8) to encrypt the drives +# Default path to the geli(8) keyfile used in drive encryption # -: ${ZFSBOOT_GELI_POOL_NAME:=bootpool} +: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} # -# Default size for the unencrypted boot pool when using geli(8) +# Create a separate boot pool? +# NB: Automatically set when using geli(8) or MBR # -: ${ZFSBOOT_GELI_BOOT_SIZE:=2g} +: ${ZFSBOOT_BOOT_POOL=} # -# Default path to the geli(8) keyfile used in drive encryption +# Default name for boot pool when enabled (e.g., geli(8) or MBR) # -: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} +: ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} + +# +# Default size for boot pool when enabled (e.g., geli(8) or MBR) +# +: ${ZFSBOOT_BOOT_POOL_SIZE:=2g} # # Default disks to use (always empty unless being scripted) @@ -132,6 +139,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /var mountpoint=/var /var/crash compression=lz4,exec=off,setuid=off /var/log compression=lz4,exec=off,setuid=off + /var/mail compression=lz4,atime=on /var/tmp compression=lz4,exec=on,setuid=off " # END-QUOTE @@ -155,8 +163,10 @@ CHMOD_MODE='chmod %s "%s"' DD_WITH_OPTIONS='dd if="%s" of="%s" %s' ECHO_APPEND='echo "%s" >> "%s"' GELI_ATTACH='geli attach -j - -k "%s" "%s"' +GELI_DETACH_F='geli detach -f "%s"' GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"' GNOP_CREATE='gnop create -S 4096 "%s"' +GNOP_DESTROY='gnop destroy "%s"' GPART_ADD='gpart add -t %s "%s"' GPART_ADD_INDEX='gpart add -i %s -t %s "%s"' GPART_ADD_INDEX_WITH_SIZE='gpart add -i %s -t %s -s %s "%s"' @@ -165,19 +175,23 @@ GPART_ADD_LABEL_WITH_SIZE='gpart add -l GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' +GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' +GRAID_DELETE='graid delete "%s"' LN_SF='ln -sf "%s" "%s"' MKDIR_P='mkdir -p "%s"' MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' +ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' ZPOOL_SET='zpool set %s "%s"' # @@ -201,12 +215,12 @@ msg_force_4k_sectors="Force 4K Sectors?" msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" msg_freebsd_installer="FreeBSD Installer" msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" -msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk" msg_install="Install" msg_install_desc="Proceed with Installation" msg_install_help="Create ZFS boot pool with displayed options" +msg_invalid_boot_pool_size="Invalid boot pool size \`%s'" msg_invalid_disk_argument="Invalid disk argument \`%s'" -msg_invalid_geli_boot_size="Invalid geli(8) boot size \`%s'" msg_invalid_index_argument="Invalid index argument \`%s'" msg_invalid_swap_size="Invalid swap size \`%s'" msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" @@ -610,13 +624,13 @@ dialog_menu_layout() # so we can have some real swap. This also provides wiggle room incase your # replacement drivers do not have the exact same sector counts. # -# NOTE: The MBR layout is more complicated (GPT is preferred). +# NOTE: $swapsize and $bootsize should be defined by the calling function. +# NOTE: Sets $bootpart and $targetpart for the calling function. # zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" - local disksize partsize # Check arguments if [ ! "$disk" ]; then @@ -663,26 +677,18 @@ zfs_create_diskpart() # NOTE: Failure is ok here, blank disk will have nothing to destroy. # f_dprintf "$funcname: Destroying all data/layouts on \`%s'..." "$disk" - f_quietly gpart destroy -F $disk - f_quietly graid destroy $disk - f_quietly zpool labelclear -f /dev/$disk # Kill it with fire + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk + f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" /dev/$disk # Make doubly-sure backup GPT is destroyed - f_quietly gpart create -s gpt $disk - f_quietly gpart destroy -F $disk + f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk - # Calculate partition size given desired amount of swap - f_dprintf "$funcname: Getting disk capactiy for \`%s'" "$disk" - if ! device_$disk get capacity disksize; then - f_dprintf "$funcname: Unable to get disk capacity of \`%s'" \ - "$disk" - msg_error="$msg_error: $funcname" \ - f_show_err "$msg_unable_to_get_disk_capacity" "$disk" - return $FAILURE - fi - partsize=$(( $disksize - $swapsize )) - f_dprintf "$funcname: disksize=[%s] partsize=[%s]" \ - "$disksize" "$partsize" + # + # Enable boot pool if encryption is desired + # + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1 # # Lay down the desired type of partition scheme @@ -693,147 +699,148 @@ zfs_create_diskpart() # # 1. Create GPT layout using labels # - f_eval_catch $funcname gpart "$GPART_CREATE" gpt \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" gpt $disk || return $FAILURE # # 2. Add small freebsd-boot partition labeled `boot#' # f_eval_catch $funcname gpart "$GPART_ADD_LABEL_WITH_SIZE" \ - gptboot\$index freebsd-boot 512k \$disk || + gptboot$index freebsd-boot 512k $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 \$disk || + /boot/pmbr /boot/gptzfsboot 1 $disk || return $FAILURE - # zpool will use the `zfs#' GPT labels + # NB: zpool will use the `zfs#' GPT labels bootpart=p2 targetpart=p2 + [ ${swapsize:-0} -gt 0 ] && targetpart=p3 - # Change things around if we are using geli(8) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # + # Prepare boot pool if enabled (e.g., for geli(8)) + # + if [ "$ZFSBOOT_BOOT_POOL" ]; then bootpart=p2 targetpart=p3 - partsize=$(( $partsize - $gelisize )) - f_dprintf "$funcname: gelisize=[%s]" \ - "gelisize=[$gelisize]" + [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" boot\$index \ - freebsd-zfs \${gelisize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ + freebsd-zfs ${bootsize}b $disk || return $FAILURE - - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart + fi fi # - # 3. Add freebsd-zfs partition labeled `zfs#' for zpool - # NOTE: Using above calculated partsize to leave room for swap. + # 3. Add freebsd-swap partition labeled `swap#' # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: partsize=[%s]" \ - "partsize=[$partsize]" f_eval_catch $funcname gpart \ - "$GPART_ADD_LABEL_WITH_SIZE" zfs\$index \ - freebsd-zfs \${partsize}b \$disk || + "$GPART_ADD_LABEL_WITH_SIZE" swap$index \ + freebsd-swap ${swapsize}b $disk || return $FAILURE - else - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - zfs\$index freebsd-zfs \$disk || + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/gpt/swap$index + # Update fstab(5) + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/gpt/swap$index none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi - f_quietly zpool labelclear -f "/dev/$disk$targetpart" # - # 4. Add freebsd-swap partition labeled `swap#' + # 4. Add freebsd-zfs partition labeled `zfs#' for zroot # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ - swap\$index freebsd-swap \$disk || - return $FAILURE - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap\$index none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || - return $FAILURE - fi + f_eval_catch $funcname gpart "$GPART_ADD_LABEL" \ + zfs$index freebsd-zfs $disk || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart ;; MBR) f_dprintf "$funcname: Creating MBR layout..." # # 1. Create MBR layout (no labels) # - f_eval_catch $funcname gpart "$GPART_CREATE" mbr \$disk || + f_eval_catch $funcname gpart "$GPART_CREATE" mbr $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE" /boot/mbr \ - \$disk || return $FAILURE + $disk || return $FAILURE # # 2. Add freebsd slice with all available space # - f_eval_catch $funcname gpart "$GPART_ADD" freebsd \$disk || + f_eval_catch $funcname gpart "$GPART_ADD" freebsd $disk || return $FAILURE - f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 \$disk || + f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 $disk || return $FAILURE - f_quietly zpool labelclear -f /dev/${disk}s1 # Pedantic - f_quietly gpart destroy -F ${disk}s1 # Pedantic + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1 + # Pedantically nuke any old scheme + f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" ${disk}s1 # # 3. Write BSD scheme to the freebsd slice # - f_eval_catch $funcname gpart "$GPART_CREATE" BSD \${disk}s1 || + f_eval_catch $funcname gpart "$GPART_CREATE" BSD ${disk}s1 || return $FAILURE - # zpool will use s1a (no labels) - bootpart=s1a targetpart=s1a mbrindex=1 + # NB: zpool will use s1a (no labels) + bootpart=s1a targetpart=s1d mbrindex=4 - # Change things around if we are using geli(8) + # + # Always prepare a boot pool on MBR + # + ZFSBOOT_BOOT_POOL=1 + f_eval_catch $funcname gpart \ + "$GPART_ADD_INDEX_WITH_SIZE" \ + 1 freebsd-zfs ${bootsize}b ${disk}s1 || + return $FAILURE + # Pedantically nuke any old labels + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$bootpart if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - bootpart=s1a targetpart=s1d - partsize=$(( $partsize - $gelisize )) - mbrindex=4 # If this is s1a then make the zpool s1d - f_dprintf "$funcname: mbrindex=[%s] gelisize=[%s]" \ - "$mbrindex" "$gelisize" - f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - 1 freebsd-zfs \${gelisize}b \${disk}s1 || - return $FAILURE - # Pedantically nuke any old labels, stop geli - f_quietly zpool labelclear -f "/dev/$disk$bootpart" - f_quietly geli detach -f "/dev/$disk$targetpart" + # Pedantically detach targetpart for later + f_eval_catch -d $funcname geli \ + "$GELI_DETACH_F" \ + /dev/$disk$targetpart fi # - # 4. Partition the BSD slice for ZFS - # NOTE: Using above calculated partsize to leave room for swap. + # 4. Add freebsd-swap partition # if [ ${swapsize:-0} -gt 0 ]; then - f_dprintf "$funcname: mbrindex=[%s] partsize=[%s]" \ - "$mbrindex" "$partsize" f_eval_catch $funcname gpart \ - "$GPART_ADD_INDEX_WITH_SIZE" \ - \$mbrindex freebsd-zfs \${partsize}b \ - \${disk}s1 || return $FAILURE - else - f_dprintf "$funcname: mbrindex=[%s]" "$mbrindex" - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - \$mbrindex freebsd-zfs \${disk}s1 || - return $FAILURE - fi - f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic - - # - # 5. Add freebsd-swap partition - # - if [ $swapsize -gt 0 ]; then - f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ - 2 freebsd-swap \${disk}s1 || + "$GPART_ADD_INDEX_WITH_SIZE" 2 \ + freebsd-swap ${swapsize}b ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels on the swap + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/${disk}s1b # Update fstab(5) f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/\${disk}s1b none swap sw 0 0 \ - \$BSDINSTALL_TMPETC/fstab || + /dev/${disk}s1b none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi + + # + # 5. Add freebsd-zfs partition for zroot + # + f_eval_catch $funcname gpart "$GPART_ADD_INDEX" \ + $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE + f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ + /dev/$disk$targetpart # Pedantic + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /boot/zfsboot /dev/${disk}s1 count=1 || + return $FAILURE ;; esac # $ZFSBOOT_PARTITION_SCHEME @@ -849,16 +856,18 @@ zfs_create_diskpart() zfs_create_boot() { local funcname=zfs_create_boot - local poolname="$1" vdev_type="$2" - local bootpart targetpart - - shift 2 # name vdev_type - - # We may need this later - local disks="$*" + local zroot_name="$1" + local zroot_vdevtype="$2" + local zroot_vdevs= # Calculated below + local boot_vdevs= # Used for geli(8) and/or MBR layouts + shift 2 # poolname vdev_type + local disks="$*" disk + local bootpart targetpart # Set by zfs_create_diskpart() below + # # Pedantic checks; should never be seen - if [ ! "$poolname" ]; then + # + if [ ! "$zroot_name" ]; then f_dprintf "$funcname: NULL poolname" msg_error="$msg_error: $funcname" \ f_show_err "$msg_null_poolname" @@ -871,132 +880,130 @@ zfs_create_boot() return $FAILURE fi f_dprintf "$funcname: poolname=[%s] vdev_type=[%s]" \ - "$poolname" "$vdev_type" + "$zroot_name" "$zroot_vdevtype" + # # Initialize fstab(5) + # f_dprintf "$funcname: Initializing temporary fstab(5) file..." - f_eval_catch $funcname sh \ - "$SHELL_TRUNCATE" \$BSDINSTALL_TMPETC/fstab || + f_eval_catch $funcname sh "$SHELL_TRUNCATE" $BSDINSTALL_TMPETC/fstab || return $FAILURE f_eval_catch $funcname printf "$PRINTF_FSTAB" \ "# Device" Mountpoint FStype Options Dump "Pass#" \ - \$BSDINSTALL_TMPETC/fstab || return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE + # # Expand SI units in desired sizes - f_dprintf "$funcname: Expanding supplied swapsize/gelisize values..." - local swapsize gelisize + # + f_dprintf "$funcname: Expanding supplied size values..." + local swapsize bootsize if ! f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize; then f_dprintf "$funcname: Invalid swap size \`%s'" \ "$ZFSBOOT_SWAP_SIZE" f_show_err "$msg_invalid_swap_size" "$ZFSBOOT_SWAP_SIZE" return $FAILURE fi - if ! f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize; then - f_dprintf "$funcname: Invalid geli(8) boot size \`%s'" \ - "$ZFSBOOT_GELI_BOOT_SIZE" - f_show_err "$msg_invalid_geli_boot_size" \ - "$ZFSBOOT_GELI_BOOT_SIZE" + if ! f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize; then + f_dprintf "$funcname: Invalid boot pool size \`%s'" \ + "$ZFSBOOT_BOOT_POOL_SIZE" + f_show_err "$msg_invalid_boot_pool_size" \ + "$ZFSBOOT_BOOT_POOL_SIZE" return $FAILURE fi f_dprintf "$funcname: ZFSBOOT_SWAP_SIZE=[%s] swapsize=[%s]" \ "$ZFSBOOT_SWAP_SIZE" "$swapsize" - f_dprintf "$funcname: ZFSBOOT_GELI_BOOT_SIZE=[%s] gelisize=[%s]" \ - "$ZFSBOOT_GELI_BOOT_SIZE" "$gelisize" + f_dprintf "$funcname: ZFSBOOT_BOOT_POOL_SIZE=[%s] bootsize=[%s]" \ + "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" - # Prepare the disks + # + # Prepare the disks and build pool device list(s) + # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." + [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && + f_dprintf "$funcname: With 4k alignment using gnop(8)..." local n=0 - for disk in $*; do + for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - n=$(( $n + 1 )) - done - - # MBR boot loader hack part 1 - # We have to do this early because geli gets in the way later - if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then - f_dprintf "$funcname: Copying MBR boot loader to disks..." - f_dprintf "$funcname: disks=[%s]" "$disks" - for disk in $disks; do - f_dprintf "$funcname: disk=[%s]" "$disk" - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\${disk}s1 count=1 || - return $FAILURE - done - fi - - # Forced 4k alignment support provided by Geom NOP (see gnop(8)) - local unenc_list= - if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then - local part="$targetpart" new_list= - - # We don't gnop the encrypted partition because geli will do - # this for us gnop the unencrypted disk - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && part="$bootpart" - - f_dprintf "$funcname: Applying 4k alignment with gnop(8)..." - f_dprintf "$funcname: *=[%s]" "$*" - for disk in $*; do - f_dprintf "$funcname: disk=[%s] part=[%s]" \ - "$disk" "$part" - f_eval_catch $funcname gnop "$GNOP_CREATE" \ - \$disk\$part || return $FAILURE + # Now $bootpart and $targetpart are set (suffix for $disk) + + # Forced 4k alignment support using Geom NOP (see gnop(8)) + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$bootpart || return $FAILURE + fi + # Don't gnop encrypted partition if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - unenc_list="$unenc_list $disk$part.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.eli" else - new_list="$new_list $disk$targetpart.nop" + zroot_vdevs="$zroot_vdevs $disk$targetpart.nop" + f_eval_catch $funcname gnop "$GNOP_CREATE" \ + $disk$targetpart || + return $FAILURE fi - done - set -- $new_list - else - local new_list= - for disk in $*; do - new_list="$new_list $disk$targetpart" - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - unenc_list="$unenc_list $disk$bootpart" - done - set -- $new_list - fi + else + if [ "$ZFSBOOT_BOOT_POOL" ]; then + boot_vdevs="$boot_vdevs $disk$bootpart" + fi + zroot_vdevs="$zroot_vdevs $disk$targetpart" + fi + + n=$(( $n + 1 )) + done # disks # - # If encryption is enabled, we need to create the GEOMs + # If we need/want a boot pool, create it # - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - local bootvdev= options= - local geli_pool="$BSDINSTALL_CHROOT/$ZFSBOOT_GELI_POOL_NAME" - local key="$ZFSBOOT_GELI_KEY_FILE" - - f_dprintf "$funcname: Setting up disk encryption..." + if [ "$ZFSBOOT_BOOT_POOL" ]; then + local bootpool_vdevtype= # Calculated below + local bootpool_options= # Calculated below + local bootpool_name="$ZFSBOOT_BOOT_POOL_NAME" + local bootpool="$BSDINSTALL_CHROOT/$bootpool_name" + local zroot_key="${ZFSBOOT_GELI_KEY_FILE#/}" + + f_dprintf "$funcname: Setting up boot pool..." + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + f_dprintf "$funcname: For encrypted root disk..." - # Create the parent directories for our unencrypted pool - f_quietly umount /mnt + # Create parent directory for boot pool + f_eval_catch -d $funcname umount "$UMOUNT" /mnt f_eval_catch $funcname mount "$MOUNT_TYPE" tmpfs none \ - \$BSDINSTALL_CHROOT || return $FAILURE + $BSDINSTALL_CHROOT || return $FAILURE - # Create mirror across the unencrypted partition on all disks - [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror + # Create mirror across the boot partition on all disks + [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && + bootpool_vdevtype=mirror - f_dprintf "$funcname: %s %s %s" \ - "ZFSBOOT_GELI_POOL_NAME=[$ZFSBOOT_GELI_POOL_NAME]" \ - "bootvdev=[$bootvdev]" "unenc_list=[$unenc_list]" - options="-o altroot=\"\$BSDINSTALL_CHROOT\"" - options="$options -m \"/\$ZFSBOOT_GELI_POOL_NAME\"" - options="$options -f" + bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "$options" \$ZFSBOOT_GELI_POOL_NAME \$bootvdev \ - \$unenc_list || return $FAILURE - - f_dprintf "$funcname: geli_pool=[%s]" "$geli_pool" - f_eval_catch $funcname mkdir "$MKDIR_P" \$geli_pool/boot || + "$bootpool_options" "$bootpool_name" \ + "$bootpool_vdevtype" "$boot_vdevs" || return $FAILURE - # Generate an encryption key using random(4) - f_dprintf "$funcname: key=[%s]" "$key" - f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /dev/random \$geli_pool/\$key "bs=4096 count=1" || + f_eval_catch $funcname mkdir "$MKDIR_P" "$bootpool/boot" || return $FAILURE - # Create the geli(8) GEOMS - local geli_list + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Generate an encryption key using random(4) + f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ + /dev/random "$bootpool/$zroot_key" \ + "bs=4096 count=1" || return $FAILURE + else + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ + "$bootpool_name" || return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs + fi + + fi + + # + # Create the geli(8) GEOMS + # + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # Prompt user for password (twice) if ! msg_enter_new_password="$msg_geli_password" \ f_dialog_input_password then @@ -1004,57 +1011,57 @@ zfs_create_boot() f_show_err "$msg_user_cancelled" return $FAILURE fi - f_dprintf "$funcname: disks=[%s]" "$disks" + + # Initialize geli(8) on each of the target partitions for disk in $disks; do - f_dprintf "$funcname: disk=[%s] targetpart=[%s]" \ - "$disk" "$targetpart" f_dialog_info "$msg_geli_setup" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_PASSWORD_INIT" \ - \$geli_pool/boot/\$disk\$targetpart.eli \ - AES-XTS \$geli_pool/\$key \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_PASSWORD_INIT" \ + "$bootpool/boot/$disk$targetpart.eli" \ + AES-XTS "$bootpool/$zroot_key" \ + $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - if ! echo "$pw_password" | f_eval_catch $funcname \ - geli "$GELI_ATTACH" \$geli_pool/\$key \ - \$disk\$targetpart + if ! echo "$pw_password" | f_eval_catch \ + $funcname geli "$GELI_ATTACH" \ + "$bootpool/$zroot_key" $disk$targetpart then f_interactive || f_die + unset pw_password # Sensitive info return $FAILURE fi - geli_list="$geli_list $disk$targetpart.eli" done - set -- $geli_list - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE - f_quietly umount /mnt # done with tmpfs + unset pw_password # Sensitive info + + # Clean up + f_eval_catch $funcname zfs "$ZFS_UNMOUNT" "$bootpool_name" || + return $FAILURE + f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi # - # Create the ZFS pool with desired type and disk devices + # Create the ZFS root pool with desired type and disk devices # - local vdevs="$*" - f_dprintf "$funcname: Creating boot pool..." - f_dprintf "poolname=[%s] vdev_type=[%s] vdevs=[%s]" \ - "$poolname" "$vdev_type" "$vdevs" + f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\" -m none -f" \ - \$poolname \$vdev_type \$vdevs + "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE - # Customize the zpool a bit... + # Customize the zroot a bit... local option - f_dprintf "$funcname: Setting miscellaneous options on boot pool..." - for option in checksum=fletcher4 atime=off; do - f_dprintf "$funcname: option=[%s]" "$option" - f_eval_catch $funcname zfs "$ZFS_SET" \$option \$poolname || - return $FAILURE + f_dprintf "$funcname: Setting miscellaneous options on root pool..." + for option in atime=off; do + f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || + return $FAILURE done # - # Create ZFS dataset layout within the new boot pool + # Create ZFS dataset layout within the new root pool # f_dprintf "$funcname: Creating ZFS datasets..." echo "$ZFSBOOT_DATASETS" | while read dataset options; do @@ -1073,10 +1080,8 @@ zfs_create_boot() # Replace both commas and spaces with ` -o ' f_replaceall "$options" "[ ,]" " -o " options # Create the dataset with desired options - f_dprintf "$funcname: dataset=[%s] options=[%s]" \ - "$dataset" "$options" f_eval_catch $funcname zfs "$ZFS_CREATE_WITH_OPTIONS" \ - "\${options:+-o \$options}" \$poolname\$dataset || + "${options:+-o $options}" "$zroot_name$dataset" || return $FAILURE done @@ -1084,57 +1089,53 @@ zfs_create_boot() f_dprintf "$funcname: Modifying directory permissions..." local dir for dir in /tmp /var/tmp; do - f_dprintf "$funcname: dir=[%s]" "$dir" f_eval_catch $funcname chmod "$CHMOD_MODE" 1777 \ - \$BSDINSTALL_CHROOTDIR\$dir || return $FAILURE + $BSDINSTALL_CHROOTDIR$dir || return $FAILURE done # Create symlink(s) - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_dprintf "$funcname: Creating /boot symlink for GELI..." - f_eval_catch $funcname ln "$LN_SF" \ - \$ZFSBOOT_GELI_POOL_NAME/boot \ - \$BSDINSTALL_CHROOT/boot || return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_dprintf "$funcname: Creating /boot symlink for boot pool..." + f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \ + $BSDINSTALL_CHROOT/boot || return $FAILURE fi # Set bootfs property + local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" f_dprintf "$funcname: Setting bootfs property..." - f_dprintf "$funcname: %s %s" \ - "ZFSBOOT_BEROOT_NAME=[$ZFSBOOT_BEROOT_NAME]" \ - "ZFSBOOT_BOOTFS_NAME=[$ZFSBOOT_BOOTFS_NAME]" f_eval_catch $funcname zpool "$ZPOOL_SET" \ - bootfs=\"\$poolname/\$ZFSBOOT_BEROOT_NAME/\$ZFSBOOT_BOOTFS_NAME\" \ - \$poolname || return $FAILURE + "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || + return $FAILURE # Export the pool(s) f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \$poolname || + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "$bootpool_name" || return $FAILURE fi # Destroy the gnop devices (if enabled) for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$disks}; do - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then - f_quietly gnop destroy $disk$bootpart.nop - else - f_quietly gnop destroy $disk$targetpart.nop + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$bootpart.nop + fi + if [ ! "$ZFSBOOT_GELI_ENCRYPTION" ]; then + f_eval_catch -d $funcname gnop "$GNOP_DESTROY" \ + $disk$targetpart.nop fi done - # MBR boot loader hack part 2 + # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then f_dprintf "$funcname: Updating MBR boot loader on disks..." - f_dprintf "$funcname: disks=[%s]" # Stick the ZFS boot loader in the "convienient hole" after # the ZFS internal metadata for disk in $disks; do - f_dprintf "$funcname: disk=[%s] bootpart=[%s]" \ - "$disk" "$bootpart" f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ - /boot/zfsboot /dev/\$disk\$bootpart \ + /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done fi @@ -1142,74 +1143,79 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \$poolname || + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || return $FAILURE - if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"\$BSDINSTALL_CHROOT\"" \ - \$ZFSBOOT_GELI_POOL_NAME || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE fi # While this is apparently not needed, it seems to help MBR - f_dprintf "$funcname: Configuring zpool.cache..." - f_eval_catch $funcname mkdir "$MKDIR_P" \$BSDINSTALL_CHROOT/boot/zfs || + f_dprintf "$funcname: Configuring zpool.cache for zroot..." + f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE f_eval_catch $funcname zpool "$ZPOOL_SET" \ - cachefile=\"\$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\" \ - \$poolname || return $FAILURE + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$zroot_name" || return $FAILURE # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ "$funcname" f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_enable=\"YES\"' \ - \$BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE + $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'zfs_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE - # We're all done unless we should go on to do encryption - [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + # We're all done unless we should go on for boot pool + [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS + + # Set cachefile for boot pool so it auto-imports at system start + f_dprintf "$funcname: Configuring zpool.cache for boot pool..." + f_eval_catch $funcname zpool "$ZPOOL_SET" \ + "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ + "$bootpool_name" || return $FAILURE # Some additional geli(8) requirements for loader.conf(5) for option in \ - zpool_cache_load=\"YES\" \ - zpool_cache_type=\"/boot/zfs/zpool.cache\" \ - zpool_cache_name=\"/boot/zfs/zpool.cache\" \ + 'zpool_cache_load=\"YES\"' \ + 'zpool_cache_type=\"/boot/zfs/zpool.cache\"' \ + 'zpool_cache_name=\"/boot/zfs/zpool.cache\"' \ ; do - f_eval_catch $funcname echo "$ECHO_APPEND" \$option \ - \$BSDINSTALL_TMPBOOT/loader.conf.zfs || + f_eval_catch $funcname echo "$ECHO_APPEND" "$option" \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done + f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + + # We're all done unless we should go on to do encryption + [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS # # Configure geli(8)-based encryption # f_dprintf "$funcname: Configuring disk encryption..." f_eval_catch $funcname echo "$ECHO_APPEND" 'aesni_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE + $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - f_dprintf "$funcname: disks=[%s]" "$disks" + $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE for disk in $disks; do - f_dprintf "$funcname: %s %s %s" \ - "disk=[$disk]" "targetpart=[$targetpart]" \ - "ZFSBOOT_GELI_KEY_FILE=[$ZFSBOOT_GELI_KEY_FILE]" f_eval_catch $funcname printf "$PRINTF_CONF" \ - geli_%s_keyfile0_load '"$disk$targetpart" YES' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + geli_%s_keyfile0_load "$disk$targetpart YES" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart $disk$targetpart:geli_keyfile0" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_name \ - '"$disk$targetpart" "$ZFSBOOT_GELI_KEY_FILE"' \ - \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || + "$disk$targetpart \"$ZFSBOOT_GELI_KEY_FILE\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || return $FAILURE done @@ -1258,7 +1264,7 @@ f_dialog_backtitle "$msg_freebsd_install # f_dprintf "BSDINSTALL_CHROOT=[%s]" "$BSDINSTALL_CHROOT" f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC" -f_dprintf "PRINTF_FSTAB=[%s]" "$PRINTF_FSTAB" +f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # # Loop over the main menu until we've accomplished what we came here to do @@ -1296,11 +1302,11 @@ while :; do # Make sure each disk will be at least 50% ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize then minsize=$swapsize teeny_disks= - [ "$ZFSBOOT_GELI_ENCRYPTION" ] && - minsize=$(( $minsize + $gelisize )) + [ "$ZFSBOOT_BOOT_POOL" ] && + minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do device_$disk get capacity disksize || continue *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 16:01:05 2013 Return-Path: Delivered-To: svn-src-all@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 4C08021D; Fri, 20 Dec 2013 16:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36F4110BB; Fri, 20 Dec 2013 16:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKG15lh023605; Fri, 20 Dec 2013 16:01:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKG123g023587; Fri, 20 Dec 2013 16:01:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201601.rBKG123g023587@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 16:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259655 - head/contrib/gcc/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 16:01:05 -0000 Author: pfg Date: Fri Dec 20 16:01:02 2013 New Revision: 259655 URL: http://svnweb.freebsd.org/changeset/base/259655 Log: gcc: merge upstream fix and new feature. Fix for PR c++/29928 Add support for Rvalue references as described here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html Obtained from: gcc 4.3 (rev. 124724, 125211; GPLv2) MFC after: 2 weeks Modified: head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/call.c head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/error.c head/contrib/gcc/cp/except.c head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/parser.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/rtti.c head/contrib/gcc/cp/tree.c head/contrib/gcc/cp/typeck.c Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 16:01:02 2013 (r259655) @@ -35,10 +35,75 @@ * typeck.c (build_binary_op): Include types in error. +2007-05-30 Russell Yanofsky (r125211) + Douglas Gregor + Pedro Lamarao + Howard Hinnant + + PR c++/7412 + PR c++/29939 + * typeck.c (comptypes): Don't consider rvalue and lvalue + reference types to be equivalent. + (check_return_expr): Move from certain lvalues when returning + them. + * decl.c (grokdeclarator): Implement reference collapsing. + (copy_fn_p): Don't consider constructors taking rvalue references + to be copy constructors. + (move_fn_p): New. + * call.c (conversion): New "rvaluedness_matches_p" member. + (convert_class_to_reference): Require reference type as first + parameter instead of base type. + (reference_binding): Add logic to handle rvalue references. + (implicit_conversion): Update inaccurate comment. + (convert_like_real): Disable creation of temporaries that are + impossible to initialize for types with move constructors. + (build_over_call): Elide move constructors when possible. + (maybe_handle_implicit_object): Set "rvaluedness_matches_p". + (maybe_handle_ref_bind): Return conversion instead of type node. + (compare_ics): Add logic to use "rvaluedness_matches_p" values to + determine preferred conversion sequences. + * cp-tree.h (TYPE_REF_IS_RVALUE): New. + (LOOKUP_PREFER_RVALUE): New. + (DECL_MOVE_CONSTRUCTOR_P): New. + (struct cp_declarator): Add "reference" member for reference + types, with new "rvalue_ref" flag. + (cp_build_reference_type): Declare. + (move_fn_p): Declare. + * error.c (dump_type_prefix): Format rvalue reference types + correctly in error messages. + * except.c (build_throw): Move from certain lvalues when + throwing. + * mangle.c (write_type): Mangle rvalue references differently + than regular references. + * parser.c (make_reference_declarator): Add boolean parameter for + rvalue references. + (cp_parser_make_indirect_declarator): New. + (cp_parser_new_declarator_opt): Call + cp_parser_make_indirect_declarator. + (cp_parser_conversion_declarator_opt): Ditto. + (cp_parser_declarator): Ditto. + (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference + declarators. + * pt.c (tsubst): Implement reference collapsing. + (maybe_adjust_types_for_deduction): Implement special template + parameter deduction rule for rvalue references. + (type_unification_real): Update calls to + maybe_adjust_types_for_deduction. + (try_one_overload): Ditto. + (unify_pack_expansion): Ditto. + * tree.c (lvalue_p_1): Handle rvalue reference types. + (cp_build_reference_type): New. + 2007-05-18 Geoffrey Keating (r124839) * mangle.c (write_real_cst): Use 'unsigned long' for %lx. +2007-05-14 Paolo Carlini (r124724) + + PR c++/29928 + * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the + type only if is a class type (5.2.8/4). + 2007-05-05 Geoffrey Keating (r124467) PR 31775 Modified: head/contrib/gcc/cp/call.c ============================================================================== --- head/contrib/gcc/cp/call.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/call.c Fri Dec 20 16:01:02 2013 (r259655) @@ -95,6 +95,10 @@ struct conversion { /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion from a pointer-to-derived to pointer-to-base is being performed. */ BOOL_BITFIELD base_p : 1; + /* If KIND is ck_ref_bind, true when either an lvalue reference is + being bound to an lvalue expression or an rvalue reference is + being bound to an rvalue expression. */ + BOOL_BITFIELD rvaluedness_matches_p: 1; /* The type of the expression resulting from the conversion. */ tree type; union { @@ -174,7 +178,7 @@ static conversion *standard_conversion ( static conversion *reference_binding (tree, tree, tree, bool, int); static conversion *build_conv (conversion_kind, tree, conversion *); static bool is_subseq (conversion *, conversion *); -static tree maybe_handle_ref_bind (conversion **); +static conversion *maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); static struct z_candidate *add_candidate (struct z_candidate **, tree, tree, size_t, @@ -895,12 +899,12 @@ reference_compatible_p (tree t1, tree t2 converted to T as in [over.match.ref]. */ static conversion * -convert_class_to_reference (tree t, tree s, tree expr) +convert_class_to_reference (tree reference_type, tree s, tree expr) { tree conversions; tree arglist; conversion *conv; - tree reference_type; + tree t; struct z_candidate *candidates; struct z_candidate *cand; bool any_viable_p; @@ -934,7 +938,7 @@ convert_class_to_reference (tree t, tree arglist = build_int_cst (build_pointer_type (s), 0); arglist = build_tree_list (NULL_TREE, arglist); - reference_type = build_reference_type (t); + t = TREE_TYPE (reference_type); while (conversions) { @@ -997,6 +1001,9 @@ convert_class_to_reference (tree t, tree cand->second_conv = (direct_reference_binding (reference_type, identity_conv)); + cand->second_conv->rvaluedness_matches_p + = TYPE_REF_IS_RVALUE (TREE_TYPE (TREE_TYPE (cand->fn))) + == TYPE_REF_IS_RVALUE (reference_type); cand->second_conv->bad_p |= cand->convs[0]->bad_p; } } @@ -1123,7 +1130,16 @@ reference_binding (tree rto, tree rfrom, to = build_qualified_type (to, cp_type_quals (from)); compatible_p = reference_compatible_p (to, from); - if (lvalue_p && compatible_p) + /* Directly bind reference when target expression's type is compatible with + the reference and expression is an lvalue. In C++0x, the wording in + [8.5.3/5 dcl.init.ref] is changed to also allow direct bindings for const + and rvalue references to rvalues of compatible class type, as part of + DR391. */ + if (compatible_p + && (lvalue_p + || (flag_cpp0x + && (CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) + && CLASS_TYPE_P (from)))) { /* [dcl.init.ref] @@ -1136,6 +1152,15 @@ reference_binding (tree rto, tree rfrom, lvalue. */ conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); + + if (flags & LOOKUP_PREFER_RVALUE) + /* The top-level caller requested that we pretend that the lvalue + be treated as an rvalue. */ + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); + else + conv->rvaluedness_matches_p + = (TYPE_REF_IS_RVALUE (rto) == !lvalue_p); + if ((lvalue_p & clk_bitfield) != 0 || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to))) /* For the purposes of overload resolution, we ignore the fact @@ -1168,7 +1193,7 @@ reference_binding (tree rto, tree rfrom, the reference is bound to the lvalue result of the conversion in the second case. */ - conv = convert_class_to_reference (to, from, expr); + conv = convert_class_to_reference (rto, from, expr); if (conv) return conv; } @@ -1191,8 +1216,10 @@ reference_binding (tree rto, tree rfrom, /* [dcl.init.ref] - Otherwise, the reference shall be to a non-volatile const type. */ - if (!CP_TYPE_CONST_NON_VOLATILE_P (to)) + Otherwise, the reference shall be to a non-volatile const type. + + Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */ + if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto)) return NULL; /* [dcl.init.ref] @@ -1215,6 +1242,7 @@ reference_binding (tree rto, tree rfrom, { conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)) conv->u.next->check_copy_constructor_p = true; return conv; @@ -1239,6 +1267,7 @@ reference_binding (tree rto, tree rfrom, /* This reference binding, unlike those above, requires the creation of a temporary. */ conv->need_temporary_p = true; + conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); return conv; } @@ -1280,7 +1309,7 @@ implicit_conversion (tree to, tree from, conv = cand->second_conv; /* We used to try to bind a reference to a temporary here, but that - is now handled by the recursive call to this function at the end + is now handled after the recursive call to this function at the end of reference_binding. */ return conv; } @@ -4409,13 +4438,22 @@ convert_like_real (conversion *convs, tr { tree ref_type = totype; - /* If necessary, create a temporary. */ - if (convs->need_temporary_p || !lvalue_p (expr)) + /* If necessary, create a temporary. + + VA_ARG_EXPR and CONSTRUCTOR expressions are special cases + that need temporaries, even when their types are reference + compatible with the type of reference being bound, so the + upcoming call to build_unary_op (ADDR_EXPR, expr, ...) + doesn't fail. */ + if (convs->need_temporary_p + || TREE_CODE (expr) == CONSTRUCTOR + || TREE_CODE (expr) == VA_ARG_EXPR) { tree type = convs->u.next->type; cp_lvalue_kind lvalue = real_lvalue_p (expr); - if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type))) + if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) + && !TYPE_REF_IS_RVALUE (ref_type)) { /* If the reference is volatile or non-const, we cannot create a temporary. */ @@ -4938,7 +4976,9 @@ build_over_call (struct z_candidate *can if (! flag_elide_constructors) /* Do things the hard way. */; - else if (cand->num_convs == 1 && DECL_COPY_CONSTRUCTOR_P (fn)) + else if (cand->num_convs == 1 + && (DECL_COPY_CONSTRUCTOR_P (fn) + || DECL_MOVE_CONSTRUCTOR_P (fn))) { tree targ; arg = skip_artificial_parms_for (fn, converted_args); @@ -5676,28 +5716,28 @@ maybe_handle_implicit_object (conversion t = t->u.next; t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); t = direct_reference_binding (reference_type, t); + t->rvaluedness_matches_p = 1; *ics = t; } } /* If *ICS is a REF_BIND set *ICS to the remainder of the conversion, - and return the type to which the reference refers. Otherwise, - leave *ICS unchanged and return NULL_TREE. */ + and return the initial reference binding conversion. Otherwise, + leave *ICS unchanged and return NULL. */ -static tree +static conversion * maybe_handle_ref_bind (conversion **ics) { if ((*ics)->kind == ck_ref_bind) { conversion *old_ics = *ics; - tree type = TREE_TYPE (old_ics->type); *ics = old_ics->u.next; (*ics)->user_conv_p = old_ics->user_conv_p; (*ics)->bad_p = old_ics->bad_p; - return type; + return old_ics; } - return NULL_TREE; + return NULL; } /* Compare two implicit conversion sequences according to the rules set out in @@ -5721,18 +5761,18 @@ compare_ics (conversion *ics1, conversio conversion_rank rank1, rank2; /* REF_BINDING is nonzero if the result of the conversion sequence - is a reference type. In that case TARGET_TYPE is the - type referred to by the reference. */ - tree target_type1; - tree target_type2; + is a reference type. In that case REF_CONV is the reference + binding conversion. */ + conversion *ref_conv1; + conversion *ref_conv2; /* Handle implicit object parameters. */ maybe_handle_implicit_object (&ics1); maybe_handle_implicit_object (&ics2); /* Handle reference parameters. */ - target_type1 = maybe_handle_ref_bind (&ics1); - target_type2 = maybe_handle_ref_bind (&ics2); + ref_conv1 = maybe_handle_ref_bind (&ics1); + ref_conv2 = maybe_handle_ref_bind (&ics2); /* [over.ics.rank] @@ -6023,15 +6063,31 @@ compare_ics (conversion *ics1, conversio /* [over.ics.rank] + --S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers + to an implicit object parameter, and either S1 binds an lvalue reference + to an lvalue and S2 binds an rvalue reference or S1 binds an rvalue + reference to an rvalue and S2 binds an lvalue reference + (C++0x draft standard, 13.3.3.2) + --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - if (target_type1 && target_type2 + if (ref_conv1 && ref_conv2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) - return comp_cv_qualification (target_type2, target_type1); + { + if (ref_conv1->rvaluedness_matches_p + && !ref_conv2->rvaluedness_matches_p) + return 1; + else if (!ref_conv1->rvaluedness_matches_p + && ref_conv2->rvaluedness_matches_p) + return -1; + + return comp_cv_qualification (TREE_TYPE (ref_conv2->type), + TREE_TYPE (ref_conv1->type)); + } /* Neither conversion sequence is better than the other. */ return 0; Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/cp-tree.h Fri Dec 20 16:01:02 2013 (r259655) @@ -56,6 +56,7 @@ struct diagnostic_context; OMP_FOR_GIMPLIFYING_P (in OMP_FOR) BASELINK_QUALIFIED_P (in BASELINK) TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) + TYPE_REF_IS_RVALUE (in REFERENCE_TYPE) 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. @@ -1666,6 +1667,10 @@ struct lang_decl GTY(()) #define DECL_COPY_CONSTRUCTOR_P(NODE) \ (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0) +/* Nonzero if NODE (a FUNCTION_DECL) is a move constructor. */ +#define DECL_MOVE_CONSTRUCTOR_P(NODE) \ + (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) + /* Nonzero if NODE is a destructor. */ #define DECL_DESTRUCTOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr) @@ -2561,6 +2566,10 @@ extern void decl_shadowed_for_var_insert #define TYPE_REF_OBJ_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) +/* True if reference type NODE is an rvalue reference */ +#define TYPE_REF_IS_RVALUE(NODE) \ + TREE_LANG_FLAG_0 (REFERENCE_TYPE_CHECK (NODE)) + /* Returns true if NODE is a pointer to an object, or a pointer to void. Keep these checks in ascending tree code order. */ #define TYPE_PTROBV_P(NODE) \ @@ -3444,6 +3453,8 @@ enum overload_flags { NO_SPECIAL = 0, DT (Normally, these entities are registered in the symbol table, but not found by lookup.) */ #define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) +/* Prefer that the lvalue be treated as an rvalue. */ +#define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3750,13 +3761,21 @@ struct cp_declarator { /* The bounds to the array. */ tree bounds; } array; - /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */ + /* For cdk_pointer and cdk_ptrmem. */ struct { /* The cv-qualifiers for the pointer. */ cp_cv_quals qualifiers; /* For cdk_ptrmem, the class type containing the member. */ tree class_type; } pointer; + /* For cdk_reference */ + struct { + /* The cv-qualifiers for the reference. These qualifiers are + only used to diagnose ill-formed code. */ + cp_cv_quals qualifiers; + /* Whether this is an rvalue reference */ + bool rvalue_ref; + } reference; } u; }; @@ -3917,6 +3936,7 @@ extern tree build_ptrmem_type (tree, t /* the grokdeclarator prototype is in decl.h */ extern tree build_this_parm (tree, cp_cv_quals); extern int copy_fn_p (tree); +extern bool move_fn_p (tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); @@ -4416,6 +4436,7 @@ extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); +extern tree cp_build_reference_type (tree, bool); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/decl.c Fri Dec 20 16:01:02 2013 (r259655) @@ -7823,10 +7823,24 @@ grokdeclarator (const cp_declarator *dec if (TREE_CODE (type) == REFERENCE_TYPE) { - error (declarator->kind == cdk_reference - ? "cannot declare reference to %q#T" - : "cannot declare pointer to %q#T", type); - type = TREE_TYPE (type); + if (declarator->kind != cdk_reference) + { + error ("cannot declare pointer to %q#T", type); + type = TREE_TYPE (type); + } + + /* In C++0x, we allow reference to reference declarations + that occur indirectly through typedefs [7.1.3/8 dcl.typedef] + and template type arguments [14.3.1/4 temp.arg.type]. The + check for direct reference to reference declarations, which + are still forbidden, occurs below. Reasoning behind the change + can be found in DR106, DR540, and the rvalue reference + proposals. */ + else if (!flag_cpp0x) + { + error ("cannot declare reference to %q#T", type); + type = TREE_TYPE (type); + } } else if (VOID_TYPE_P (type)) { @@ -7852,8 +7866,39 @@ grokdeclarator (const cp_declarator *dec if (declarator->kind == cdk_reference) { + /* In C++0x, the type we are creating a reference to might be + a typedef which is itself a reference type. In that case, + we follow the reference collapsing rules in + [7.1.3/8 dcl.typedef] to create the final reference type: + + "If a typedef TD names a type that is a reference to a type + T, an attempt to create the type 'lvalue reference to cv TD' + creates the type 'lvalue reference to T,' while an attempt + to create the type "rvalue reference to cv TD' creates the + type TD." + */ if (!VOID_TYPE_P (type)) - type = build_reference_type (type); + type = cp_build_reference_type + ((TREE_CODE (type) == REFERENCE_TYPE + ? TREE_TYPE (type) : type), + (declarator->u.reference.rvalue_ref + && (TREE_CODE(type) != REFERENCE_TYPE + || TYPE_REF_IS_RVALUE (type)))); + + /* In C++0x, we need this check for direct reference to + reference declarations, which are forbidden by + [8.3.2/5 dcl.ref]. Reference to reference declarations + are only allowed indirectly through typedefs and template + type arguments. Example: + + void foo(int & &); // invalid ref-to-ref decl + + typedef int & int_ref; + void foo(int_ref &); // valid ref-to-ref decl + */ + if (inner_declarator && inner_declarator->kind == cdk_reference) + error ("cannot declare reference to %q#T, which is not " + "a typedef or a template type argument", type); } else if (TREE_CODE (type) == METHOD_TYPE) type = build_ptrmemfunc_type (build_pointer_type (type)); @@ -9078,6 +9123,7 @@ copy_fn_p (tree d) result = -1; } else if (TREE_CODE (arg_type) == REFERENCE_TYPE + && !TYPE_REF_IS_RVALUE (arg_type) && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d)) { if (CP_TYPE_CONST_P (TREE_TYPE (arg_type))) @@ -9095,6 +9141,57 @@ copy_fn_p (tree d) return result; } +/* D is a constructor or overloaded `operator='. + + Let T be the class in which D is declared. Then, this function + returns true when D is a move constructor or move assignment + operator, false otherwise. */ + +bool +move_fn_p (tree d) +{ + tree args; + tree arg_type; + bool result = false; + + gcc_assert (DECL_FUNCTION_MEMBER_P (d)); + + if (!flag_cpp0x) + /* There are no move constructors if we aren't in C++0x mode. */ + return false; + + if (TREE_CODE (d) == TEMPLATE_DECL + || (DECL_TEMPLATE_INFO (d) + && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))) + /* Instantiations of template member functions are never copy + functions. Note that member functions of templated classes are + represented as template functions internally, and we must + accept those as copy functions. */ + return 0; + + args = FUNCTION_FIRST_USER_PARMTYPE (d); + if (!args) + return 0; + + arg_type = TREE_VALUE (args); + if (arg_type == error_mark_node) + return 0; + + if (TREE_CODE (arg_type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (arg_type) + && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)), + DECL_CONTEXT (d))) + result = true; + + args = TREE_CHAIN (args); + + if (args && args != void_list_node && !TREE_PURPOSE (args)) + /* There are more non-optional args. */ + return false; + + return result; +} + /* Remember any special properties of member function DECL. */ void grok_special_member_properties (tree decl) Modified: head/contrib/gcc/cp/error.c ============================================================================== --- head/contrib/gcc/cp/error.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/error.c Fri Dec 20 16:01:02 2013 (r259655) @@ -507,7 +507,15 @@ dump_type_prefix (tree t, int flags) pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); } - pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); + if (TREE_CODE (t) == POINTER_TYPE) + pp_character(cxx_pp, '*'); + else if (TREE_CODE (t) == REFERENCE_TYPE) + { + if (TYPE_REF_IS_RVALUE (t)) + pp_string (cxx_pp, "&&"); + else + pp_character (cxx_pp, '&'); + } pp_base (cxx_pp)->padding = pp_before; pp_cxx_cv_qualifier_seq (cxx_pp, t); } Modified: head/contrib/gcc/cp/except.c ============================================================================== --- head/contrib/gcc/cp/except.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/except.c Fri Dec 20 16:01:02 2013 (r259655) @@ -709,12 +709,25 @@ build_throw (tree exp) /* And initialize the exception object. */ if (CLASS_TYPE_P (temp_type)) { + int flags = LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING; + + /* Under C++0x [12.8/16 class.copy], a thrown lvalue is sometimes + treated as an rvalue for the purposes of overload resolution + to favor move constructors over copy constructors. */ + if (/* Must be a local, automatic variable. */ + TREE_CODE (exp) == VAR_DECL + && DECL_CONTEXT (exp) == current_function_decl + && ! TREE_STATIC (exp) + /* The variable must not have the `volatile' qualifier. */ + && !(cp_type_quals (TREE_TYPE (exp)) & TYPE_QUAL_VOLATILE)) + flags = flags | LOOKUP_PREFER_RVALUE; + /* Call the copy constructor. */ exp = (build_special_member_call (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING)); + flags)); if (exp == error_mark_node) { error (" in thrown expression"); Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 16:01:02 2013 (r259655) @@ -1541,6 +1541,10 @@ write_local_name (const tree function, c ::= G # imaginary (C 2000) [not supported] ::= U # vendor extended type qualifier + C++0x extensions + + ::= RR # rvalue reference-to + TYPE is a type node. */ static void @@ -1635,6 +1639,8 @@ write_type (tree type) break; case REFERENCE_TYPE: + if (TYPE_REF_IS_RVALUE (type)) + write_char('R'); write_char ('R'); write_type (TREE_TYPE (type)); break; Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/parser.c Fri Dec 20 16:01:02 2013 (r259655) @@ -843,7 +843,7 @@ static cp_declarator *make_array_declara static cp_declarator *make_pointer_declarator (cp_cv_quals, cp_declarator *); static cp_declarator *make_reference_declarator - (cp_cv_quals, cp_declarator *); + (cp_cv_quals, cp_declarator *, bool); static cp_parameter_declarator *make_parameter_declarator (cp_decl_specifier_seq *, cp_declarator *, tree); static cp_declarator *make_ptrmem_declarator @@ -937,14 +937,15 @@ make_pointer_declarator (cp_cv_quals cv_ /* Like make_pointer_declarator -- but for references. */ cp_declarator * -make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target) +make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target, + bool rvalue_ref) { cp_declarator *declarator; declarator = make_declarator (cdk_reference); declarator->declarator = target; - declarator->u.pointer.qualifiers = cv_qualifiers; - declarator->u.pointer.class_type = NULL_TREE; + declarator->u.reference.qualifiers = cv_qualifiers; + declarator->u.reference.rvalue_ref = rvalue_ref; return declarator; } @@ -1926,6 +1927,8 @@ static bool cp_parser_is_keyword (cp_token *, enum rid); static tree cp_parser_make_typename_type (cp_parser *, tree, tree); +static cp_declarator * cp_parser_make_indirect_declarator + (enum tree_code, tree, cp_cv_quals, cp_declarator *); /* Returns nonzero if we are parsing tentatively. */ @@ -2599,6 +2602,27 @@ cp_parser_make_typename_type (cp_parser return make_typename_type (scope, id, typename_type, tf_error); } +/* This is a wrapper around the + make_{pointer,ptrmem,reference}_declarator functions that decides + which one to call based on the CODE and CLASS_TYPE arguments. The + CODE argument should be one of the values returned by + cp_parser_ptr_operator. */ +static cp_declarator * +cp_parser_make_indirect_declarator (enum tree_code code, tree class_type, + cp_cv_quals cv_qualifiers, + cp_declarator *target) +{ + if (code == INDIRECT_REF) + if (class_type == NULL_TREE) + return make_pointer_declarator (cv_qualifiers, target); + else + return make_ptrmem_declarator (cv_qualifiers, class_type, target); + else if (code == ADDR_EXPR && class_type == NULL_TREE) + return make_reference_declarator (cv_qualifiers, target, false); + else if (code == NON_LVALUE_EXPR && class_type == NULL_TREE) + return make_reference_declarator (cv_qualifiers, target, true); + gcc_unreachable (); +} /* Create a new C++ parser. */ @@ -5387,15 +5411,8 @@ cp_parser_new_declarator_opt (cp_parser* /* Parse another optional declarator. */ declarator = cp_parser_new_declarator_opt (parser); - /* Create the representation of the declarator. */ - if (type) - declarator = make_ptrmem_declarator (cv_quals, type, declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); - - return declarator; + return cp_parser_make_indirect_declarator + (code, type, cv_quals, declarator); } /* If the next token is a `[', there is a direct-new-declarator. */ @@ -8054,16 +8071,8 @@ cp_parser_conversion_declarator_opt (cp_ /* Parse another optional declarator. */ declarator = cp_parser_conversion_declarator_opt (parser); - /* Create the representation of the declarator. */ - if (class_type) - declarator = make_ptrmem_declarator (cv_quals, class_type, - declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); - - return declarator; + return cp_parser_make_indirect_declarator + (code, class_type, cv_quals, declarator); } return NULL; @@ -11522,15 +11531,8 @@ cp_parser_declarator (cp_parser* parser, && !cp_parser_parse_definitely (parser)) declarator = NULL; - /* Build the representation of the ptr-operator. */ - if (class_type) - declarator = make_ptrmem_declarator (cv_quals, - class_type, - declarator); - else if (code == INDIRECT_REF) - declarator = make_pointer_declarator (cv_quals, declarator); - else - declarator = make_reference_declarator (cv_quals, declarator); + declarator = cp_parser_make_indirect_declarator + (code, class_type, cv_quals, declarator); } /* Everything else is a direct-declarator. */ else @@ -11971,12 +11973,15 @@ cp_parser_direct_declarator (cp_parser* & cv-qualifier-seq [opt] Returns INDIRECT_REF if a pointer, or pointer-to-member, was used. - Returns ADDR_EXPR if a reference was used. In the case of a - pointer-to-member, *TYPE is filled in with the TYPE containing the - member. *CV_QUALS is filled in with the cv-qualifier-seq, or - TYPE_UNQUALIFIED, if there are no cv-qualifiers. Returns - ERROR_MARK if an error occurred. */ - + Returns ADDR_EXPR if a reference was used, or NON_LVALUE_EXPR for + an rvalue reference. In the case of a pointer-to-member, *TYPE is + filled in with the TYPE containing the member. *CV_QUALS is + filled in with the cv-qualifier-seq, or TYPE_UNQUALIFIED, if there + are no cv-qualifiers. Returns ERROR_MARK if an error occurred. + Note that the tree codes returned by this function have nothing + to do with the types of trees that will be eventually be created + to represent the pointer or reference type being parsed. They are + just constants with suggestive names. */ static enum tree_code cp_parser_ptr_operator (cp_parser* parser, tree* type, @@ -11992,13 +11997,18 @@ cp_parser_ptr_operator (cp_parser* parse /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); - /* If it's a `*' or `&' we have a pointer or reference. */ - if (token->type == CPP_MULT || token->type == CPP_AND) - { - /* Remember which ptr-operator we were processing. */ - code = (token->type == CPP_AND ? ADDR_EXPR : INDIRECT_REF); - /* Consume the `*' or `&'. */ + /* If it's a `*', `&' or `&&' we have a pointer or reference. */ + if (token->type == CPP_MULT) + code = INDIRECT_REF; + else if (token->type == CPP_AND) + code = ADDR_EXPR; + else if (flag_cpp0x && token->type == CPP_AND_AND) /* C++0x only */ + code = NON_LVALUE_EXPR; + + if (code != ERROR_MARK) + { + /* Consume the `*', `&' or `&&'. */ cp_lexer_consume_token (parser->lexer); /* A `*' can be followed by a cv-qualifier-seq, and so can a Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 16:01:02 2013 (r259655) @@ -110,7 +110,8 @@ static void tsubst_enum (tree, tree, tre static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); static bool check_instantiated_args (tree, tree, tsubst_flags_t); -static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*); +static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, + tree); static int type_unification_real (tree, tree, tree, tree, int, unification_kind_t, int); static void note_template_header (int); @@ -7546,8 +7547,13 @@ tsubst (tree t, tree args, tsubst_flags_ -- Attempting to create a pointer to reference type. -- Attempting to create a reference to a reference type or - a reference to void. */ - if (TREE_CODE (type) == REFERENCE_TYPE + a reference to void. + + Core issue 106 says that creating a reference to a reference + during instantiation is no longer a cause for failure. We + only enforce this check in strict C++98 mode. */ + if ((TREE_CODE (type) == REFERENCE_TYPE + && ((!flag_cpp0x && flag_iso) || code != REFERENCE_TYPE)) || (code == REFERENCE_TYPE && TREE_CODE (type) == VOID_TYPE)) { static location_t last_loc; @@ -7581,8 +7587,22 @@ tsubst (tree t, tree args, tsubst_flags_ if (TREE_CODE (type) == METHOD_TYPE) r = build_ptrmemfunc_type (r); } + else if (TREE_CODE (type) == REFERENCE_TYPE) + /* In C++0x, during template argument substitution, when there is an + attempt to create a reference to a reference type, reference + collapsing is applied as described in [14.3.1/4 temp.arg.type]: + + "If a template-argument for a template-parameter T names a type + that is a reference to a type A, an attempt to create the type + 'lvalue reference to cv T' creates the type 'lvalue reference to + A,' while an attempt to create the type type rvalue reference to + cv T' creates the type T" + */ + r = cp_build_reference_type + (TREE_TYPE (type), + TYPE_REF_IS_RVALUE (t) && TYPE_REF_IS_RVALUE (type)); else - r = build_reference_type (type); + r = cp_build_reference_type (type, TYPE_REF_IS_RVALUE (t)); r = cp_build_qualified_type_real (r, TYPE_QUALS (t), complain); if (r != error_mark_node) @@ -9792,12 +9812,14 @@ fn_type_unification (tree fn, sections are symmetric. PARM is the type of a function parameter or the return type of the conversion function. ARG is the type of the argument passed to the call, or the type of the value - initialized with the result of the conversion function. */ + initialized with the result of the conversion function. + ARG_EXPR is the original argument expression, which may be null. */ static int maybe_adjust_types_for_deduction (unification_kind_t strict, tree* parm, - tree* arg) + tree* arg, + tree arg_expr) { int result = 0; @@ -9851,6 +9873,16 @@ maybe_adjust_types_for_deduction (unific *arg = TYPE_MAIN_VARIANT (*arg); } + /* From C++0x [14.8.2.1/3 temp.deduct.call] (after DR606), "If P is + of the form T&&, where T is a template parameter, and the argument + is an lvalue, T is deduced as A& */ + if (TREE_CODE (*parm) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (*parm) + && TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM + && cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED + && arg_expr && real_lvalue_p (arg_expr)) + *arg = build_reference_type (*arg); + /* [temp.deduct.call] If P is a cv-qualified type, the top level cv-qualifiers @@ -9887,7 +9919,7 @@ type_unification_real (tree tparms, unification_kind_t strict, int flags) { - tree parm, arg; + tree parm, arg, arg_expr; int i; int ntparms = TREE_VEC_LENGTH (tparms); int sub_strict; @@ -9929,6 +9961,7 @@ type_unification_real (tree tparms, parms = TREE_CHAIN (parms); arg = TREE_VALUE (args); args = TREE_CHAIN (args); + arg_expr = NULL; if (arg == error_mark_node) return 1; @@ -9978,6 +10011,7 @@ type_unification_real (tree tparms, return 1; } + arg_expr = arg; arg = unlowered_expr_type (arg); if (arg == error_mark_node) return 1; @@ -9987,7 +10021,8 @@ type_unification_real (tree tparms, int arg_strict = sub_strict; if (!subr) - arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); + arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, + arg_expr); if (unify (tparms, targs, parm, arg, arg_strict)) return 1; @@ -10164,7 +10199,7 @@ try_one_overload (tree tparms, else if (addr_p) arg = build_pointer_type (arg); - sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); + sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, NULL); /* We don't copy orig_targs for this because if we have already deduced some template args from previous args, unify would complain when we Modified: head/contrib/gcc/cp/rtti.c ============================================================================== --- head/contrib/gcc/cp/rtti.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/rtti.c Fri Dec 20 16:01:02 2013 (r259655) @@ -238,7 +238,7 @@ get_tinfo_decl_dynamic (tree exp) /* Peel off cv qualifiers. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, exp); if (!type) @@ -430,7 +430,7 @@ get_typeid (tree type) that is the operand of typeid are always ignored. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, NULL_TREE); if (!type) Modified: head/contrib/gcc/cp/tree.c ============================================================================== --- head/contrib/gcc/cp/tree.c Fri Dec 20 15:58:33 2013 (r259654) +++ head/contrib/gcc/cp/tree.c Fri Dec 20 16:01:02 2013 (r259655) @@ -64,8 +64,28 @@ lvalue_p_1 (tree ref, cp_lvalue_kind op1_lvalue_kind = clk_none; cp_lvalue_kind op2_lvalue_kind = clk_none; + /* Expressions of reference type are sometimes wrapped in + INDIRECT_REFs. INDIRECT_REFs are just internal compiler + representation, not part of the language, so we have to look + through them. */ + if (TREE_CODE (ref) == INDIRECT_REF + && TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) + == REFERENCE_TYPE) + return lvalue_p_1 (TREE_OPERAND (ref, 0), + treat_class_rvalues_as_lvalues); + if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE) - return clk_ordinary; + { + /* unnamed rvalue references are rvalues */ + if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref)) + && TREE_CODE (ref) != PARM_DECL + && TREE_CODE (ref) != VAR_DECL + && TREE_CODE (ref) != COMPONENT_REF) + return clk_none; + + /* lvalue references and named rvalue refences are lvalues */ + return clk_ordinary; + } if (ref == current_class_ptr) return clk_none; @@ -451,6 +471,53 @@ build_cplus_array_type (tree elt_type, t return t; } + +/* Return a reference type node referring to TO_TYPE. If RVAL is + true, return an rvalue reference type, otherwise return an lvalue + reference type. If a type node exists, reuse it, otherwise create + a new one. */ +tree +cp_build_reference_type (tree to_type, bool rval) +{ + tree lvalue_ref, t; + lvalue_ref = build_reference_type (to_type); + if (!rval) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 16:37:03 2013 Return-Path: Delivered-To: svn-src-all@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 9C8505D6; Fri, 20 Dec 2013 16:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9EA1346; Fri, 20 Dec 2013 16:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKGb3ER036205; Fri, 20 Dec 2013 16:37:03 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKGb3Cm036204; Fri, 20 Dec 2013 16:37:03 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312201637.rBKGb3Cm036204@svn.freebsd.org> From: Justin Hibbits Date: Fri, 20 Dec 2013 16:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259657 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 16:37:03 -0000 Author: jhibbits Date: Fri Dec 20 16:37:03 2013 New Revision: 259657 URL: http://svnweb.freebsd.org/changeset/base/259657 Log: Add suspend/resume handlers for ATI backlight ppc driver. With this, also shut shut off the display (DPMS-style) and disable the clocking when the backlight level is set to 0. This is taken from the radeonkms driver (radeon_legacy_encoders.c) which doesn't yet support PowerPC, and won't for a while, as it's missing full AGP support. Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Fri Dec 20 16:15:25 2013 (r259656) +++ head/sys/powerpc/powermac/atibl.c Fri Dec 20 16:37:03 2013 (r259657) @@ -52,10 +52,15 @@ __FBSDID("$FreeBSD$"); #define RADEON_LVDS_BL_MOD_EN (1 << 16) #define RADEON_LVDS_DIGON (1 << 18) #define RADEON_LVDS_BLON (1 << 19) +#define RADEON_LVDS_PLL_CNTL 0x02d4 +#define RADEON_LVDS_PLL_EN (1 << 16) +#define RADEON_LVDS_PLL_RESET (1 << 17) +#define RADEON_PIXCLKS_CNTL 0x002d +#define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) struct atibl_softc { - device_t dev; struct resource *sc_memr; + int sc_level; }; static void atibl_identify(driver_t *driver, device_t parent); @@ -63,13 +68,17 @@ static int atibl_probe(device_t dev); static int atibl_attach(device_t dev); static int atibl_setlevel(struct atibl_softc *sc, int newlevel); static int atibl_getlevel(struct atibl_softc *sc); +static int atibl_resume(device_t dev); +static int atibl_suspend(device_t dev); static int atibl_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t atibl_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, atibl_identify), - DEVMETHOD(device_probe, atibl_probe), - DEVMETHOD(device_attach, atibl_attach), + DEVMETHOD(device_identify, atibl_identify), + DEVMETHOD(device_probe, atibl_probe), + DEVMETHOD(device_attach, atibl_attach), + DEVMETHOD(device_suspend, atibl_suspend), + DEVMETHOD(device_resume, atibl_resume), {0, 0}, }; @@ -136,8 +145,8 @@ atibl_attach(device_t dev) tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - atibl_sysctl, "I", "Backlight level (0-100)"); + "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + atibl_sysctl, "I", "Backlight level (0-100)"); return (0); } @@ -146,6 +155,8 @@ static int atibl_setlevel(struct atibl_softc *sc, int newlevel) { uint32_t lvds_gen_cntl; + uint32_t lvds_pll_cntl; + uint32_t pixclks_cntl; if (newlevel > 100) newlevel = 100; @@ -153,13 +164,38 @@ atibl_setlevel(struct atibl_softc *sc, i if (newlevel < 0) newlevel = 0; - newlevel = (newlevel * 5) / 2 + 5; lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); - lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_LEVEL_MASK; - lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & - RADEON_LVDS_BL_MOD_LEVEL_MASK; - bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + + if (newlevel > 0) { + newlevel = (newlevel * 5) / 2 + 5; + lvds_pll_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL); + lvds_pll_cntl |= RADEON_LVDS_PLL_EN; + bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET; + bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + + lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS | + RADEON_LVDS_BL_MOD_LEVEL_MASK); + lvds_gen_cntl |= RADEON_LVDS_ON | RADEON_LVDS_EN | + RADEON_LVDS_DIGON | RADEON_LVDS_BLON; + lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & + RADEON_LVDS_BL_MOD_LEVEL_MASK; + lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; + DELAY(2000); + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + } else { + pixclks_cntl = bus_read_4(sc->sc_memr, RADEON_PIXCLKS_CNTL); + bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, + pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); + lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; + lvds_gen_cntl &= RADEON_LVDS_BL_MOD_EN; + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); + DELAY(2000); + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + + bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, pixclks_cntl); + } return (0); } @@ -173,13 +209,39 @@ atibl_getlevel(struct atibl_softc *sc) lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); level = ((lvds_gen_cntl & RADEON_LVDS_BL_MOD_LEVEL_MASK) >> - RADEON_LVDS_BL_MOD_LEVEL_SHIFT); - level = ((level - 5) * 2) / 5; + RADEON_LVDS_BL_MOD_LEVEL_SHIFT); + if (level != 0) + level = ((level - 5) * 2) / 5; return (level); } static int +atibl_suspend(device_t dev) +{ + struct atibl_softc *sc; + + sc = device_get_softc(dev); + + sc->sc_level = atibl_getlevel(sc); + atibl_setlevel(sc, 0); + + return (0); +} + +static int +atibl_resume(device_t dev) +{ + struct atibl_softc *sc; + + sc = device_get_softc(dev); + + atibl_setlevel(sc, sc->sc_level); + + return (0); +} + +static int atibl_sysctl(SYSCTL_HANDLER_ARGS) { struct atibl_softc *sc; From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 17:05:43 2013 Return-Path: Delivered-To: svn-src-all@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 CA8EE48D; Fri, 20 Dec 2013 17:05:43 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53F981611; Fri, 20 Dec 2013 17:05:43 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id w7so2456949qcr.11 for ; Fri, 20 Dec 2013 09:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=d6I2ymUaVjTk7b5OW/LMzZA5wZJ5gxKwqkSy3ak2Nzk=; b=e+fuxmklGHS1aQ4f4vxO6gLk4dC/O3zqrVIrnM9py1t337KKmt1Te5YI1sgqd97XzW kCorzBFGKav0a6mx+4QKAJTGr78cS7QPq4tYRe7z7UZPReYKS/3vAjXgH2joOsGskCEW N4XD6s70N88Vckqmn2sjlip14V2W8zFxGtVzxAxCPh7YddfFHk/k4scGX760/AQvxx3P GabPxUAzvoB3ZFvUtzMhgSROfGN5m7XgjN0cn88qCdQMNgeRD1Cfan0bUuH8sD9SfJlV t/TP+0Kc8+VvDj6txEsm1/lJOVGPEuSMg87ddKbx2a+1nlj1B7Ha+e55SoY7/QwSvN9W irkg== MIME-Version: 1.0 X-Received: by 10.49.76.66 with SMTP id i2mr15764513qew.35.1387559142458; Fri, 20 Dec 2013 09:05:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Fri, 20 Dec 2013 09:05:42 -0800 (PST) In-Reply-To: <20131220084419.GK71033@FreeBSD.org> References: <201312200741.rBK7f3tL038123@svn.freebsd.org> <20131220084419.GK71033@FreeBSD.org> Date: Fri, 20 Dec 2013 09:05:42 -0800 X-Google-Sender-Auth: dBjenF2o2H2n3TgCCyZgyxScIRQ Message-ID: Subject: Re: svn commit: r259642 - head/sys/netinet From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 17:05:43 -0000 On 20 December 2013 00:44, Gleb Smirnoff wrote: > I didn't get to review of actual patch, but IMO it would be better > just to remove the code, not ifdef 0 it. The code ifdefed has zero > probability to be enabled in its current form. If we ever fix it, code > would look very different. > > No reason to do followup commit, that was just me muttering. I figured it would be nicer in the short term to #if 0 it out whilst some other discussions went on, just to make it really obvious in the short term where the check was done. It's quite possible I'll eventually just trim it entirely out. Thanks, -a From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 17:39:08 2013 Return-Path: Delivered-To: svn-src-all@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 4ED1BA29; Fri, 20 Dec 2013 17:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F20E18A6; Fri, 20 Dec 2013 17:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKHd86D059255; Fri, 20 Dec 2013 17:39:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKHd73M059252; Fri, 20 Dec 2013 17:39:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312201739.rBKHd73M059252@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Dec 2013 17:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259659 - in head/sys: nfs rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 17:39:08 -0000 Author: mav Date: Fri Dec 20 17:39:07 2013 New Revision: 259659 URL: http://svnweb.freebsd.org/changeset/base/259659 Log: Remove several linear list traversals per request from RPC server code. Do not insert active ports into pool->sp_active list if they are success- fully assigned to some thread. This makes that list include only ports that really require attention, and so traversal can be reduced to simple taking the first one. Remove idle thread from pool->sp_idlethreads list when assigning some work (port of requests) to it. That again makes possible to replace list traversals with simple taking the first element. Modified: head/sys/nfs/nfs_fha.c head/sys/rpc/svc.c head/sys/rpc/svc.h Modified: head/sys/nfs/nfs_fha.c ============================================================================== --- head/sys/nfs/nfs_fha.c Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/nfs/nfs_fha.c Fri Dec 20 17:39:07 2013 (r259659) @@ -289,19 +289,6 @@ fha_hash_entry_add_op(struct fha_hash_en fhe->num_rw += count; } -static SVCTHREAD * -get_idle_thread(SVCPOOL *pool) -{ - SVCTHREAD *st; - - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) { - if (st->st_xprt == NULL && STAILQ_EMPTY(&st->st_reqs)) - return (st); - } - return (NULL); -} - - /* * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. @@ -386,7 +373,7 @@ fha_hash_entry_choose_thread(struct fha_ ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)t", thread, thread->st_reqcount); #endif - } else if ((thread = get_idle_thread(pool))) { + } else if ((thread = LIST_FIRST(&pool->sp_idlethreads))) { #if 0 ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)i", thread, thread->st_reqcount); @@ -418,7 +405,6 @@ SVCTHREAD * fha_assign(SVCTHREAD *this_thread, struct svc_req *req, struct fha_params *softc) { - SVCPOOL *pool; SVCTHREAD *thread; struct fha_info i; struct fha_hash_entry *fhe; @@ -439,7 +425,6 @@ fha_assign(SVCTHREAD *this_thread, struc if (req->rq_vers != 2 && req->rq_vers != 3) return (this_thread); - pool = req->rq_xprt->xp_pool; fha_extract_info(req, &i, cb); /* Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/rpc/svc.c Fri Dec 20 17:39:07 2013 (r259659) @@ -293,12 +293,10 @@ xprt_unregister_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_assert(&xprt->xp_mlock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); - if (xprt->xp_active) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - xprt->xp_active = FALSE; - } + xprt_inactive_locked(xprt); TAILQ_REMOVE(&pool->sp_xlist, xprt, xp_link); xprt->xp_registered = FALSE; } @@ -320,25 +318,25 @@ xprt_unregister(SVCXPRT *xprt) SVC_RELEASE(xprt); } -static void +/* + * Attempt to assign a service thread to this transport. + */ +static int xprt_assignthread(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; SVCTHREAD *st; - /* - * Attempt to assign a service thread to this - * transport. - */ - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) { - if (st->st_xprt == NULL && STAILQ_EMPTY(&st->st_reqs)) - break; - } + mtx_assert(&xprt->xp_mlock, MA_OWNED); + st = LIST_FIRST(&pool->sp_idlethreads); if (st) { + LIST_REMOVE(st, st_ilink); + st->st_idle = FALSE; SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; cv_signal(&st->st_cond); + return (TRUE); } else { /* * See if we can create a new thread. The @@ -354,6 +352,7 @@ xprt_assignthread(SVCXPRT *xprt) pool->sp_state = SVCPOOL_THREADWANTED; } } + return (FALSE); } void @@ -372,9 +371,12 @@ xprt_active(SVCXPRT *xprt) } if (!xprt->xp_active) { - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, xp_alink); xprt->xp_active = TRUE; - xprt_assignthread(xprt); + if (xprt->xp_thread == NULL) { + if (!xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, xprt, + xp_alink); + } } mtx_unlock(&pool->sp_lock); @@ -385,8 +387,10 @@ xprt_inactive_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + mtx_assert(&xprt->xp_mlock, MA_OWNED); if (xprt->xp_active) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + if (xprt->xp_thread == NULL) + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); xprt->xp_active = FALSE; } } @@ -948,10 +952,11 @@ svc_assign_waiting_sockets(SVCPOOL *pool { SVCXPRT *xprt; - TAILQ_FOREACH(xprt, &pool->sp_active, xp_alink) { - if (!xprt->xp_thread) { - xprt_assignthread(xprt); - } + while ((xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { + if (xprt_assignthread(xprt)) + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + else + break; } } @@ -1042,21 +1047,17 @@ svc_run_internal(SVCPOOL *pool, bool_t i * active transport which isn't being serviced * by a thread. */ - if (svc_request_space_available(pool)) { - TAILQ_FOREACH(xprt, &pool->sp_active, - xp_alink) { - if (!xprt->xp_thread) { - SVC_ACQUIRE(xprt); - xprt->xp_thread = st; - st->st_xprt = xprt; - break; - } - } - } - if (st->st_xprt) + if (svc_request_space_available(pool) && + (xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { + TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + SVC_ACQUIRE(xprt); + xprt->xp_thread = st; + st->st_xprt = xprt; continue; + } LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); + st->st_idle = TRUE; if (ismaster || (!ismaster && pool->sp_threadcount > pool->sp_minthreads)) error = cv_timedwait_sig(&st->st_cond, @@ -1064,7 +1065,10 @@ svc_run_internal(SVCPOOL *pool, bool_t i else error = cv_wait_sig(&st->st_cond, &pool->sp_lock); - LIST_REMOVE(st, st_ilink); + if (st->st_idle) { + LIST_REMOVE(st, st_ilink); + st->st_idle = FALSE; + } /* * Reduce worker thread count when idle. @@ -1132,11 +1136,12 @@ svc_run_internal(SVCPOOL *pool, bool_t i * execute the request * immediately. */ - if (stpref != st) { - cv_signal(&stpref->st_cond); - continue; - } else { + if (stpref == st) break; + if (stpref->st_idle) { + LIST_REMOVE(stpref, st_ilink); + stpref->st_idle = FALSE; + cv_signal(&stpref->st_cond); } } } while (stat == XPRT_MOREREQS @@ -1153,10 +1158,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i xprt->xp_thread = NULL; st->st_xprt = NULL; if (xprt->xp_active) { - xprt_assignthread(xprt); - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, - xp_alink); + if (!xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, + xprt, xp_alink); } mtx_unlock(&pool->sp_lock); SVC_RELEASE(xprt); Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Fri Dec 20 16:50:52 2013 (r259658) +++ head/sys/rpc/svc.h Fri Dec 20 17:39:07 2013 (r259659) @@ -278,6 +278,7 @@ typedef struct __rpc_svcthread { SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ int st_reqcount; /* number of queued reqs */ + int st_idle; /* thread is on idle list */ struct cv st_cond; /* sleeping for work */ LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 18:01:18 2013 Return-Path: Delivered-To: svn-src-all@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 0A1354A1; Fri, 20 Dec 2013 18:01:18 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03FBB1AA0; Fri, 20 Dec 2013 18:01:16 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id u56so2839404wes.36 for ; Fri, 20 Dec 2013 10:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bET6xWZS8aFaOBfsk6U2HnIZGN3jk0OZ9hjbeaWp7wc=; b=JpjT1QRIL/Zsn9RTTD0B5/8I4h7MXBkbMEOjzADhdw+PQI528InvkGu25LFD7E+x2g 69o+UeDlVPylmkz2pKC3le8cRmjkbVkbtBlB5+i/g6oL3DP69G9nmpFz4QHN6E/so12C +BLxgu3iZgReiSY6Xr2dHqYjtNjptBi5LatDyFhGdmixxKXNF1Vai53Jcs+cyIeP9ZvS KHecvm/51uIe7M1/tyq6jKsPgD3GITYp8GnRGo1Y/g+aXEJZbtURDhKOY+HU3MDhGA1C bnsFBtGkgkkBvQYnGifPqSFGu407hHfzPDpuCJio9BMjWKCXTUU7LMLmQ3DjEJSNMMD3 gVXg== MIME-Version: 1.0 X-Received: by 10.180.103.193 with SMTP id fy1mr9160868wib.10.1387562475319; Fri, 20 Dec 2013 10:01:15 -0800 (PST) Received: by 10.194.65.37 with HTTP; Fri, 20 Dec 2013 10:01:15 -0800 (PST) In-Reply-To: References: <201312200741.rBK7f3tL038123@svn.freebsd.org> <20131220084419.GK71033@FreeBSD.org> Date: Fri, 20 Dec 2013 10:01:15 -0800 Message-ID: Subject: Re: svn commit: r259642 - head/sys/netinet From: Jack Vogel To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 18:01:18 -0000 I agree with Gleb, ifdef 0 is silly, after all, that's why we have source history, its not like the offending code is gone forever :) So I guess its both of us muttering Gleb :) Jack On Fri, Dec 20, 2013 at 9:05 AM, Adrian Chadd wrote: > On 20 December 2013 00:44, Gleb Smirnoff wrote: > > > I didn't get to review of actual patch, but IMO it would be better > > just to remove the code, not ifdef 0 it. The code ifdefed has zero > > probability to be enabled in its current form. If we ever fix it, code > > would look very different. > > > > No reason to do followup commit, that was just me muttering. > > I figured it would be nicer in the short term to #if 0 it out whilst > some other discussions went on, just to make it really obvious in the > short term where the check was done. It's quite possible I'll > eventually just trim it entirely out. > > Thanks, > > > -a > From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 18:09:37 2013 Return-Path: Delivered-To: svn-src-all@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 B39C4A1C; Fri, 20 Dec 2013 18:09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD331AF2; Fri, 20 Dec 2013 18:09:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKI9bdB070497; Fri, 20 Dec 2013 18:09:37 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKI9Zp3070481; Fri, 20 Dec 2013 18:09:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201809.rBKI9Zp3070481@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 18:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259660 - head/contrib/gcc/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 18:09:37 -0000 Author: pfg Date: Fri Dec 20 18:09:34 2013 New Revision: 259660 URL: http://svnweb.freebsd.org/changeset/base/259660 Log: gcc: revert Rvalue references. They are very useful but at this time I prefer not to figure out some minor conflicts with the bigger Apple's blocks support patch that is being worked on for current. Modified: head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/call.c head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/error.c head/contrib/gcc/cp/except.c head/contrib/gcc/cp/mangle.c head/contrib/gcc/cp/parser.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/tree.c head/contrib/gcc/cp/typeck.c Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) @@ -35,65 +35,6 @@ * typeck.c (build_binary_op): Include types in error. -2007-05-30 Russell Yanofsky (r125211) - Douglas Gregor - Pedro Lamarao - Howard Hinnant - - PR c++/7412 - PR c++/29939 - * typeck.c (comptypes): Don't consider rvalue and lvalue - reference types to be equivalent. - (check_return_expr): Move from certain lvalues when returning - them. - * decl.c (grokdeclarator): Implement reference collapsing. - (copy_fn_p): Don't consider constructors taking rvalue references - to be copy constructors. - (move_fn_p): New. - * call.c (conversion): New "rvaluedness_matches_p" member. - (convert_class_to_reference): Require reference type as first - parameter instead of base type. - (reference_binding): Add logic to handle rvalue references. - (implicit_conversion): Update inaccurate comment. - (convert_like_real): Disable creation of temporaries that are - impossible to initialize for types with move constructors. - (build_over_call): Elide move constructors when possible. - (maybe_handle_implicit_object): Set "rvaluedness_matches_p". - (maybe_handle_ref_bind): Return conversion instead of type node. - (compare_ics): Add logic to use "rvaluedness_matches_p" values to - determine preferred conversion sequences. - * cp-tree.h (TYPE_REF_IS_RVALUE): New. - (LOOKUP_PREFER_RVALUE): New. - (DECL_MOVE_CONSTRUCTOR_P): New. - (struct cp_declarator): Add "reference" member for reference - types, with new "rvalue_ref" flag. - (cp_build_reference_type): Declare. - (move_fn_p): Declare. - * error.c (dump_type_prefix): Format rvalue reference types - correctly in error messages. - * except.c (build_throw): Move from certain lvalues when - throwing. - * mangle.c (write_type): Mangle rvalue references differently - than regular references. - * parser.c (make_reference_declarator): Add boolean parameter for - rvalue references. - (cp_parser_make_indirect_declarator): New. - (cp_parser_new_declarator_opt): Call - cp_parser_make_indirect_declarator. - (cp_parser_conversion_declarator_opt): Ditto. - (cp_parser_declarator): Ditto. - (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference - declarators. - * pt.c (tsubst): Implement reference collapsing. - (maybe_adjust_types_for_deduction): Implement special template - parameter deduction rule for rvalue references. - (type_unification_real): Update calls to - maybe_adjust_types_for_deduction. - (try_one_overload): Ditto. - (unify_pack_expansion): Ditto. - * tree.c (lvalue_p_1): Handle rvalue reference types. - (cp_build_reference_type): New. - 2007-05-18 Geoffrey Keating (r124839) * mangle.c (write_real_cst): Use 'unsigned long' for %lx. Modified: head/contrib/gcc/cp/call.c ============================================================================== --- head/contrib/gcc/cp/call.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/call.c Fri Dec 20 18:09:34 2013 (r259660) @@ -95,10 +95,6 @@ struct conversion { /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion from a pointer-to-derived to pointer-to-base is being performed. */ BOOL_BITFIELD base_p : 1; - /* If KIND is ck_ref_bind, true when either an lvalue reference is - being bound to an lvalue expression or an rvalue reference is - being bound to an rvalue expression. */ - BOOL_BITFIELD rvaluedness_matches_p: 1; /* The type of the expression resulting from the conversion. */ tree type; union { @@ -178,7 +174,7 @@ static conversion *standard_conversion ( static conversion *reference_binding (tree, tree, tree, bool, int); static conversion *build_conv (conversion_kind, tree, conversion *); static bool is_subseq (conversion *, conversion *); -static conversion *maybe_handle_ref_bind (conversion **); +static tree maybe_handle_ref_bind (conversion **); static void maybe_handle_implicit_object (conversion **); static struct z_candidate *add_candidate (struct z_candidate **, tree, tree, size_t, @@ -899,12 +895,12 @@ reference_compatible_p (tree t1, tree t2 converted to T as in [over.match.ref]. */ static conversion * -convert_class_to_reference (tree reference_type, tree s, tree expr) +convert_class_to_reference (tree t, tree s, tree expr) { tree conversions; tree arglist; conversion *conv; - tree t; + tree reference_type; struct z_candidate *candidates; struct z_candidate *cand; bool any_viable_p; @@ -938,7 +934,7 @@ convert_class_to_reference (tree referen arglist = build_int_cst (build_pointer_type (s), 0); arglist = build_tree_list (NULL_TREE, arglist); - t = TREE_TYPE (reference_type); + reference_type = build_reference_type (t); while (conversions) { @@ -1001,9 +997,6 @@ convert_class_to_reference (tree referen cand->second_conv = (direct_reference_binding (reference_type, identity_conv)); - cand->second_conv->rvaluedness_matches_p - = TYPE_REF_IS_RVALUE (TREE_TYPE (TREE_TYPE (cand->fn))) - == TYPE_REF_IS_RVALUE (reference_type); cand->second_conv->bad_p |= cand->convs[0]->bad_p; } } @@ -1130,16 +1123,7 @@ reference_binding (tree rto, tree rfrom, to = build_qualified_type (to, cp_type_quals (from)); compatible_p = reference_compatible_p (to, from); - /* Directly bind reference when target expression's type is compatible with - the reference and expression is an lvalue. In C++0x, the wording in - [8.5.3/5 dcl.init.ref] is changed to also allow direct bindings for const - and rvalue references to rvalues of compatible class type, as part of - DR391. */ - if (compatible_p - && (lvalue_p - || (flag_cpp0x - && (CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) - && CLASS_TYPE_P (from)))) + if (lvalue_p && compatible_p) { /* [dcl.init.ref] @@ -1152,15 +1136,6 @@ reference_binding (tree rto, tree rfrom, lvalue. */ conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); - - if (flags & LOOKUP_PREFER_RVALUE) - /* The top-level caller requested that we pretend that the lvalue - be treated as an rvalue. */ - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); - else - conv->rvaluedness_matches_p - = (TYPE_REF_IS_RVALUE (rto) == !lvalue_p); - if ((lvalue_p & clk_bitfield) != 0 || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to))) /* For the purposes of overload resolution, we ignore the fact @@ -1193,7 +1168,7 @@ reference_binding (tree rto, tree rfrom, the reference is bound to the lvalue result of the conversion in the second case. */ - conv = convert_class_to_reference (rto, from, expr); + conv = convert_class_to_reference (to, from, expr); if (conv) return conv; } @@ -1216,10 +1191,8 @@ reference_binding (tree rto, tree rfrom, /* [dcl.init.ref] - Otherwise, the reference shall be to a non-volatile const type. - - Under C++0x, [8.5.3/5 dcl.init.ref] it may also be an rvalue reference */ - if (!CP_TYPE_CONST_NON_VOLATILE_P (to) && !TYPE_REF_IS_RVALUE (rto)) + Otherwise, the reference shall be to a non-volatile const type. */ + if (!CP_TYPE_CONST_NON_VOLATILE_P (to)) return NULL; /* [dcl.init.ref] @@ -1242,7 +1215,6 @@ reference_binding (tree rto, tree rfrom, { conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)) conv->u.next->check_copy_constructor_p = true; return conv; @@ -1267,7 +1239,6 @@ reference_binding (tree rto, tree rfrom, /* This reference binding, unlike those above, requires the creation of a temporary. */ conv->need_temporary_p = true; - conv->rvaluedness_matches_p = TYPE_REF_IS_RVALUE (rto); return conv; } @@ -1309,7 +1280,7 @@ implicit_conversion (tree to, tree from, conv = cand->second_conv; /* We used to try to bind a reference to a temporary here, but that - is now handled after the recursive call to this function at the end + is now handled by the recursive call to this function at the end of reference_binding. */ return conv; } @@ -4438,22 +4409,13 @@ convert_like_real (conversion *convs, tr { tree ref_type = totype; - /* If necessary, create a temporary. - - VA_ARG_EXPR and CONSTRUCTOR expressions are special cases - that need temporaries, even when their types are reference - compatible with the type of reference being bound, so the - upcoming call to build_unary_op (ADDR_EXPR, expr, ...) - doesn't fail. */ - if (convs->need_temporary_p - || TREE_CODE (expr) == CONSTRUCTOR - || TREE_CODE (expr) == VA_ARG_EXPR) + /* If necessary, create a temporary. */ + if (convs->need_temporary_p || !lvalue_p (expr)) { tree type = convs->u.next->type; cp_lvalue_kind lvalue = real_lvalue_p (expr); - if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) - && !TYPE_REF_IS_RVALUE (ref_type)) + if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type))) { /* If the reference is volatile or non-const, we cannot create a temporary. */ @@ -4976,9 +4938,7 @@ build_over_call (struct z_candidate *can if (! flag_elide_constructors) /* Do things the hard way. */; - else if (cand->num_convs == 1 - && (DECL_COPY_CONSTRUCTOR_P (fn) - || DECL_MOVE_CONSTRUCTOR_P (fn))) + else if (cand->num_convs == 1 && DECL_COPY_CONSTRUCTOR_P (fn)) { tree targ; arg = skip_artificial_parms_for (fn, converted_args); @@ -5716,28 +5676,28 @@ maybe_handle_implicit_object (conversion t = t->u.next; t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); t = direct_reference_binding (reference_type, t); - t->rvaluedness_matches_p = 1; *ics = t; } } /* If *ICS is a REF_BIND set *ICS to the remainder of the conversion, - and return the initial reference binding conversion. Otherwise, - leave *ICS unchanged and return NULL. */ + and return the type to which the reference refers. Otherwise, + leave *ICS unchanged and return NULL_TREE. */ -static conversion * +static tree maybe_handle_ref_bind (conversion **ics) { if ((*ics)->kind == ck_ref_bind) { conversion *old_ics = *ics; + tree type = TREE_TYPE (old_ics->type); *ics = old_ics->u.next; (*ics)->user_conv_p = old_ics->user_conv_p; (*ics)->bad_p = old_ics->bad_p; - return old_ics; + return type; } - return NULL; + return NULL_TREE; } /* Compare two implicit conversion sequences according to the rules set out in @@ -5761,18 +5721,18 @@ compare_ics (conversion *ics1, conversio conversion_rank rank1, rank2; /* REF_BINDING is nonzero if the result of the conversion sequence - is a reference type. In that case REF_CONV is the reference - binding conversion. */ - conversion *ref_conv1; - conversion *ref_conv2; + is a reference type. In that case TARGET_TYPE is the + type referred to by the reference. */ + tree target_type1; + tree target_type2; /* Handle implicit object parameters. */ maybe_handle_implicit_object (&ics1); maybe_handle_implicit_object (&ics2); /* Handle reference parameters. */ - ref_conv1 = maybe_handle_ref_bind (&ics1); - ref_conv2 = maybe_handle_ref_bind (&ics2); + target_type1 = maybe_handle_ref_bind (&ics1); + target_type2 = maybe_handle_ref_bind (&ics2); /* [over.ics.rank] @@ -6063,31 +6023,15 @@ compare_ics (conversion *ics1, conversio /* [over.ics.rank] - --S1 and S2 are reference bindings (_dcl.init.ref_) and neither refers - to an implicit object parameter, and either S1 binds an lvalue reference - to an lvalue and S2 binds an rvalue reference or S1 binds an rvalue - reference to an rvalue and S2 binds an lvalue reference - (C++0x draft standard, 13.3.3.2) - --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - if (ref_conv1 && ref_conv2 + if (target_type1 && target_type2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) - { - if (ref_conv1->rvaluedness_matches_p - && !ref_conv2->rvaluedness_matches_p) - return 1; - else if (!ref_conv1->rvaluedness_matches_p - && ref_conv2->rvaluedness_matches_p) - return -1; - - return comp_cv_qualification (TREE_TYPE (ref_conv2->type), - TREE_TYPE (ref_conv1->type)); - } + return comp_cv_qualification (target_type2, target_type1); /* Neither conversion sequence is better than the other. */ return 0; Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/cp-tree.h Fri Dec 20 18:09:34 2013 (r259660) @@ -56,7 +56,6 @@ struct diagnostic_context; OMP_FOR_GIMPLIFYING_P (in OMP_FOR) BASELINK_QUALIFIED_P (in BASELINK) TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) - TYPE_REF_IS_RVALUE (in REFERENCE_TYPE) 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. @@ -1667,10 +1666,6 @@ struct lang_decl GTY(()) #define DECL_COPY_CONSTRUCTOR_P(NODE) \ (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0) -/* Nonzero if NODE (a FUNCTION_DECL) is a move constructor. */ -#define DECL_MOVE_CONSTRUCTOR_P(NODE) \ - (DECL_CONSTRUCTOR_P (NODE) && move_fn_p (NODE)) - /* Nonzero if NODE is a destructor. */ #define DECL_DESTRUCTOR_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr) @@ -2566,10 +2561,6 @@ extern void decl_shadowed_for_var_insert #define TYPE_REF_OBJ_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) -/* True if reference type NODE is an rvalue reference */ -#define TYPE_REF_IS_RVALUE(NODE) \ - TREE_LANG_FLAG_0 (REFERENCE_TYPE_CHECK (NODE)) - /* Returns true if NODE is a pointer to an object, or a pointer to void. Keep these checks in ascending tree code order. */ #define TYPE_PTROBV_P(NODE) \ @@ -3453,8 +3444,6 @@ enum overload_flags { NO_SPECIAL = 0, DT (Normally, these entities are registered in the symbol table, but not found by lookup.) */ #define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) -/* Prefer that the lvalue be treated as an rvalue. */ -#define LOOKUP_PREFER_RVALUE (LOOKUP_HIDDEN << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3761,21 +3750,13 @@ struct cp_declarator { /* The bounds to the array. */ tree bounds; } array; - /* For cdk_pointer and cdk_ptrmem. */ + /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */ struct { /* The cv-qualifiers for the pointer. */ cp_cv_quals qualifiers; /* For cdk_ptrmem, the class type containing the member. */ tree class_type; } pointer; - /* For cdk_reference */ - struct { - /* The cv-qualifiers for the reference. These qualifiers are - only used to diagnose ill-formed code. */ - cp_cv_quals qualifiers; - /* Whether this is an rvalue reference */ - bool rvalue_ref; - } reference; } u; }; @@ -3936,7 +3917,6 @@ extern tree build_ptrmem_type (tree, t /* the grokdeclarator prototype is in decl.h */ extern tree build_this_parm (tree, cp_cv_quals); extern int copy_fn_p (tree); -extern bool move_fn_p (tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); @@ -4436,7 +4416,6 @@ extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); -extern tree cp_build_reference_type (tree, bool); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/decl.c Fri Dec 20 18:09:34 2013 (r259660) @@ -7823,24 +7823,10 @@ grokdeclarator (const cp_declarator *dec if (TREE_CODE (type) == REFERENCE_TYPE) { - if (declarator->kind != cdk_reference) - { - error ("cannot declare pointer to %q#T", type); - type = TREE_TYPE (type); - } - - /* In C++0x, we allow reference to reference declarations - that occur indirectly through typedefs [7.1.3/8 dcl.typedef] - and template type arguments [14.3.1/4 temp.arg.type]. The - check for direct reference to reference declarations, which - are still forbidden, occurs below. Reasoning behind the change - can be found in DR106, DR540, and the rvalue reference - proposals. */ - else if (!flag_cpp0x) - { - error ("cannot declare reference to %q#T", type); - type = TREE_TYPE (type); - } + error (declarator->kind == cdk_reference + ? "cannot declare reference to %q#T" + : "cannot declare pointer to %q#T", type); + type = TREE_TYPE (type); } else if (VOID_TYPE_P (type)) { @@ -7866,39 +7852,8 @@ grokdeclarator (const cp_declarator *dec if (declarator->kind == cdk_reference) { - /* In C++0x, the type we are creating a reference to might be - a typedef which is itself a reference type. In that case, - we follow the reference collapsing rules in - [7.1.3/8 dcl.typedef] to create the final reference type: - - "If a typedef TD names a type that is a reference to a type - T, an attempt to create the type 'lvalue reference to cv TD' - creates the type 'lvalue reference to T,' while an attempt - to create the type "rvalue reference to cv TD' creates the - type TD." - */ if (!VOID_TYPE_P (type)) - type = cp_build_reference_type - ((TREE_CODE (type) == REFERENCE_TYPE - ? TREE_TYPE (type) : type), - (declarator->u.reference.rvalue_ref - && (TREE_CODE(type) != REFERENCE_TYPE - || TYPE_REF_IS_RVALUE (type)))); - - /* In C++0x, we need this check for direct reference to - reference declarations, which are forbidden by - [8.3.2/5 dcl.ref]. Reference to reference declarations - are only allowed indirectly through typedefs and template - type arguments. Example: - - void foo(int & &); // invalid ref-to-ref decl - - typedef int & int_ref; - void foo(int_ref &); // valid ref-to-ref decl - */ - if (inner_declarator && inner_declarator->kind == cdk_reference) - error ("cannot declare reference to %q#T, which is not " - "a typedef or a template type argument", type); + type = build_reference_type (type); } else if (TREE_CODE (type) == METHOD_TYPE) type = build_ptrmemfunc_type (build_pointer_type (type)); @@ -9123,7 +9078,6 @@ copy_fn_p (tree d) result = -1; } else if (TREE_CODE (arg_type) == REFERENCE_TYPE - && !TYPE_REF_IS_RVALUE (arg_type) && TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d)) { if (CP_TYPE_CONST_P (TREE_TYPE (arg_type))) @@ -9141,57 +9095,6 @@ copy_fn_p (tree d) return result; } -/* D is a constructor or overloaded `operator='. - - Let T be the class in which D is declared. Then, this function - returns true when D is a move constructor or move assignment - operator, false otherwise. */ - -bool -move_fn_p (tree d) -{ - tree args; - tree arg_type; - bool result = false; - - gcc_assert (DECL_FUNCTION_MEMBER_P (d)); - - if (!flag_cpp0x) - /* There are no move constructors if we aren't in C++0x mode. */ - return false; - - if (TREE_CODE (d) == TEMPLATE_DECL - || (DECL_TEMPLATE_INFO (d) - && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))) - /* Instantiations of template member functions are never copy - functions. Note that member functions of templated classes are - represented as template functions internally, and we must - accept those as copy functions. */ - return 0; - - args = FUNCTION_FIRST_USER_PARMTYPE (d); - if (!args) - return 0; - - arg_type = TREE_VALUE (args); - if (arg_type == error_mark_node) - return 0; - - if (TREE_CODE (arg_type) == REFERENCE_TYPE - && TYPE_REF_IS_RVALUE (arg_type) - && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)), - DECL_CONTEXT (d))) - result = true; - - args = TREE_CHAIN (args); - - if (args && args != void_list_node && !TREE_PURPOSE (args)) - /* There are more non-optional args. */ - return false; - - return result; -} - /* Remember any special properties of member function DECL. */ void grok_special_member_properties (tree decl) Modified: head/contrib/gcc/cp/error.c ============================================================================== --- head/contrib/gcc/cp/error.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/error.c Fri Dec 20 18:09:34 2013 (r259660) @@ -507,15 +507,7 @@ dump_type_prefix (tree t, int flags) pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); } - if (TREE_CODE (t) == POINTER_TYPE) - pp_character(cxx_pp, '*'); - else if (TREE_CODE (t) == REFERENCE_TYPE) - { - if (TYPE_REF_IS_RVALUE (t)) - pp_string (cxx_pp, "&&"); - else - pp_character (cxx_pp, '&'); - } + pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); pp_base (cxx_pp)->padding = pp_before; pp_cxx_cv_qualifier_seq (cxx_pp, t); } Modified: head/contrib/gcc/cp/except.c ============================================================================== --- head/contrib/gcc/cp/except.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/except.c Fri Dec 20 18:09:34 2013 (r259660) @@ -709,25 +709,12 @@ build_throw (tree exp) /* And initialize the exception object. */ if (CLASS_TYPE_P (temp_type)) { - int flags = LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING; - - /* Under C++0x [12.8/16 class.copy], a thrown lvalue is sometimes - treated as an rvalue for the purposes of overload resolution - to favor move constructors over copy constructors. */ - if (/* Must be a local, automatic variable. */ - TREE_CODE (exp) == VAR_DECL - && DECL_CONTEXT (exp) == current_function_decl - && ! TREE_STATIC (exp) - /* The variable must not have the `volatile' qualifier. */ - && !(cp_type_quals (TREE_TYPE (exp)) & TYPE_QUAL_VOLATILE)) - flags = flags | LOOKUP_PREFER_RVALUE; - /* Call the copy constructor. */ exp = (build_special_member_call (object, complete_ctor_identifier, build_tree_list (NULL_TREE, exp), TREE_TYPE (object), - flags)); + LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING)); if (exp == error_mark_node) { error (" in thrown expression"); Modified: head/contrib/gcc/cp/mangle.c ============================================================================== --- head/contrib/gcc/cp/mangle.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/mangle.c Fri Dec 20 18:09:34 2013 (r259660) @@ -1541,10 +1541,6 @@ write_local_name (const tree function, c ::= G # imaginary (C 2000) [not supported] ::= U # vendor extended type qualifier - C++0x extensions - - ::= RR # rvalue reference-to - TYPE is a type node. */ static void @@ -1639,8 +1635,6 @@ write_type (tree type) break; case REFERENCE_TYPE: - if (TYPE_REF_IS_RVALUE (type)) - write_char('R'); write_char ('R'); write_type (TREE_TYPE (type)); break; Modified: head/contrib/gcc/cp/parser.c ============================================================================== --- head/contrib/gcc/cp/parser.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/parser.c Fri Dec 20 18:09:34 2013 (r259660) @@ -843,7 +843,7 @@ static cp_declarator *make_array_declara static cp_declarator *make_pointer_declarator (cp_cv_quals, cp_declarator *); static cp_declarator *make_reference_declarator - (cp_cv_quals, cp_declarator *, bool); + (cp_cv_quals, cp_declarator *); static cp_parameter_declarator *make_parameter_declarator (cp_decl_specifier_seq *, cp_declarator *, tree); static cp_declarator *make_ptrmem_declarator @@ -937,15 +937,14 @@ make_pointer_declarator (cp_cv_quals cv_ /* Like make_pointer_declarator -- but for references. */ cp_declarator * -make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target, - bool rvalue_ref) +make_reference_declarator (cp_cv_quals cv_qualifiers, cp_declarator *target) { cp_declarator *declarator; declarator = make_declarator (cdk_reference); declarator->declarator = target; - declarator->u.reference.qualifiers = cv_qualifiers; - declarator->u.reference.rvalue_ref = rvalue_ref; + declarator->u.pointer.qualifiers = cv_qualifiers; + declarator->u.pointer.class_type = NULL_TREE; return declarator; } @@ -1927,8 +1926,6 @@ static bool cp_parser_is_keyword (cp_token *, enum rid); static tree cp_parser_make_typename_type (cp_parser *, tree, tree); -static cp_declarator * cp_parser_make_indirect_declarator - (enum tree_code, tree, cp_cv_quals, cp_declarator *); /* Returns nonzero if we are parsing tentatively. */ @@ -2602,27 +2599,6 @@ cp_parser_make_typename_type (cp_parser return make_typename_type (scope, id, typename_type, tf_error); } -/* This is a wrapper around the - make_{pointer,ptrmem,reference}_declarator functions that decides - which one to call based on the CODE and CLASS_TYPE arguments. The - CODE argument should be one of the values returned by - cp_parser_ptr_operator. */ -static cp_declarator * -cp_parser_make_indirect_declarator (enum tree_code code, tree class_type, - cp_cv_quals cv_qualifiers, - cp_declarator *target) -{ - if (code == INDIRECT_REF) - if (class_type == NULL_TREE) - return make_pointer_declarator (cv_qualifiers, target); - else - return make_ptrmem_declarator (cv_qualifiers, class_type, target); - else if (code == ADDR_EXPR && class_type == NULL_TREE) - return make_reference_declarator (cv_qualifiers, target, false); - else if (code == NON_LVALUE_EXPR && class_type == NULL_TREE) - return make_reference_declarator (cv_qualifiers, target, true); - gcc_unreachable (); -} /* Create a new C++ parser. */ @@ -5411,8 +5387,15 @@ cp_parser_new_declarator_opt (cp_parser* /* Parse another optional declarator. */ declarator = cp_parser_new_declarator_opt (parser); - return cp_parser_make_indirect_declarator - (code, type, cv_quals, declarator); + /* Create the representation of the declarator. */ + if (type) + declarator = make_ptrmem_declarator (cv_quals, type, declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); + + return declarator; } /* If the next token is a `[', there is a direct-new-declarator. */ @@ -8071,8 +8054,16 @@ cp_parser_conversion_declarator_opt (cp_ /* Parse another optional declarator. */ declarator = cp_parser_conversion_declarator_opt (parser); - return cp_parser_make_indirect_declarator - (code, class_type, cv_quals, declarator); + /* Create the representation of the declarator. */ + if (class_type) + declarator = make_ptrmem_declarator (cv_quals, class_type, + declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); + + return declarator; } return NULL; @@ -11531,8 +11522,15 @@ cp_parser_declarator (cp_parser* parser, && !cp_parser_parse_definitely (parser)) declarator = NULL; - declarator = cp_parser_make_indirect_declarator - (code, class_type, cv_quals, declarator); + /* Build the representation of the ptr-operator. */ + if (class_type) + declarator = make_ptrmem_declarator (cv_quals, + class_type, + declarator); + else if (code == INDIRECT_REF) + declarator = make_pointer_declarator (cv_quals, declarator); + else + declarator = make_reference_declarator (cv_quals, declarator); } /* Everything else is a direct-declarator. */ else @@ -11973,15 +11971,12 @@ cp_parser_direct_declarator (cp_parser* & cv-qualifier-seq [opt] Returns INDIRECT_REF if a pointer, or pointer-to-member, was used. - Returns ADDR_EXPR if a reference was used, or NON_LVALUE_EXPR for - an rvalue reference. In the case of a pointer-to-member, *TYPE is - filled in with the TYPE containing the member. *CV_QUALS is - filled in with the cv-qualifier-seq, or TYPE_UNQUALIFIED, if there - are no cv-qualifiers. Returns ERROR_MARK if an error occurred. - Note that the tree codes returned by this function have nothing - to do with the types of trees that will be eventually be created - to represent the pointer or reference type being parsed. They are - just constants with suggestive names. */ + Returns ADDR_EXPR if a reference was used. In the case of a + pointer-to-member, *TYPE is filled in with the TYPE containing the + member. *CV_QUALS is filled in with the cv-qualifier-seq, or + TYPE_UNQUALIFIED, if there are no cv-qualifiers. Returns + ERROR_MARK if an error occurred. */ + static enum tree_code cp_parser_ptr_operator (cp_parser* parser, tree* type, @@ -11997,18 +11992,13 @@ cp_parser_ptr_operator (cp_parser* parse /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); - - /* If it's a `*', `&' or `&&' we have a pointer or reference. */ - if (token->type == CPP_MULT) - code = INDIRECT_REF; - else if (token->type == CPP_AND) - code = ADDR_EXPR; - else if (flag_cpp0x && token->type == CPP_AND_AND) /* C++0x only */ - code = NON_LVALUE_EXPR; - - if (code != ERROR_MARK) + /* If it's a `*' or `&' we have a pointer or reference. */ + if (token->type == CPP_MULT || token->type == CPP_AND) { - /* Consume the `*', `&' or `&&'. */ + /* Remember which ptr-operator we were processing. */ + code = (token->type == CPP_AND ? ADDR_EXPR : INDIRECT_REF); + + /* Consume the `*' or `&'. */ cp_lexer_consume_token (parser->lexer); /* A `*' can be followed by a cv-qualifier-seq, and so can a Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 18:09:34 2013 (r259660) @@ -110,8 +110,7 @@ static void tsubst_enum (tree, tree, tre static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); static bool check_instantiated_args (tree, tree, tsubst_flags_t); -static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, - tree); +static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*); static int type_unification_real (tree, tree, tree, tree, int, unification_kind_t, int); static void note_template_header (int); @@ -7547,13 +7546,8 @@ tsubst (tree t, tree args, tsubst_flags_ -- Attempting to create a pointer to reference type. -- Attempting to create a reference to a reference type or - a reference to void. - - Core issue 106 says that creating a reference to a reference - during instantiation is no longer a cause for failure. We - only enforce this check in strict C++98 mode. */ - if ((TREE_CODE (type) == REFERENCE_TYPE - && ((!flag_cpp0x && flag_iso) || code != REFERENCE_TYPE)) + a reference to void. */ + if (TREE_CODE (type) == REFERENCE_TYPE || (code == REFERENCE_TYPE && TREE_CODE (type) == VOID_TYPE)) { static location_t last_loc; @@ -7587,22 +7581,8 @@ tsubst (tree t, tree args, tsubst_flags_ if (TREE_CODE (type) == METHOD_TYPE) r = build_ptrmemfunc_type (r); } - else if (TREE_CODE (type) == REFERENCE_TYPE) - /* In C++0x, during template argument substitution, when there is an - attempt to create a reference to a reference type, reference - collapsing is applied as described in [14.3.1/4 temp.arg.type]: - - "If a template-argument for a template-parameter T names a type - that is a reference to a type A, an attempt to create the type - 'lvalue reference to cv T' creates the type 'lvalue reference to - A,' while an attempt to create the type type rvalue reference to - cv T' creates the type T" - */ - r = cp_build_reference_type - (TREE_TYPE (type), - TYPE_REF_IS_RVALUE (t) && TYPE_REF_IS_RVALUE (type)); else - r = cp_build_reference_type (type, TYPE_REF_IS_RVALUE (t)); + r = build_reference_type (type); r = cp_build_qualified_type_real (r, TYPE_QUALS (t), complain); if (r != error_mark_node) @@ -9812,14 +9792,12 @@ fn_type_unification (tree fn, sections are symmetric. PARM is the type of a function parameter or the return type of the conversion function. ARG is the type of the argument passed to the call, or the type of the value - initialized with the result of the conversion function. - ARG_EXPR is the original argument expression, which may be null. */ + initialized with the result of the conversion function. */ static int maybe_adjust_types_for_deduction (unification_kind_t strict, tree* parm, - tree* arg, - tree arg_expr) + tree* arg) { int result = 0; @@ -9873,16 +9851,6 @@ maybe_adjust_types_for_deduction (unific *arg = TYPE_MAIN_VARIANT (*arg); } - /* From C++0x [14.8.2.1/3 temp.deduct.call] (after DR606), "If P is - of the form T&&, where T is a template parameter, and the argument - is an lvalue, T is deduced as A& */ - if (TREE_CODE (*parm) == REFERENCE_TYPE - && TYPE_REF_IS_RVALUE (*parm) - && TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM - && cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED - && arg_expr && real_lvalue_p (arg_expr)) - *arg = build_reference_type (*arg); - /* [temp.deduct.call] If P is a cv-qualified type, the top level cv-qualifiers @@ -9919,7 +9887,7 @@ type_unification_real (tree tparms, unification_kind_t strict, int flags) { - tree parm, arg, arg_expr; + tree parm, arg; int i; int ntparms = TREE_VEC_LENGTH (tparms); int sub_strict; @@ -9961,7 +9929,6 @@ type_unification_real (tree tparms, parms = TREE_CHAIN (parms); arg = TREE_VALUE (args); args = TREE_CHAIN (args); - arg_expr = NULL; if (arg == error_mark_node) return 1; @@ -10011,7 +9978,6 @@ type_unification_real (tree tparms, return 1; } - arg_expr = arg; arg = unlowered_expr_type (arg); if (arg == error_mark_node) return 1; @@ -10021,8 +9987,7 @@ type_unification_real (tree tparms, int arg_strict = sub_strict; if (!subr) - arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, - arg_expr); + arg_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); if (unify (tparms, targs, parm, arg, arg_strict)) return 1; @@ -10199,7 +10164,7 @@ try_one_overload (tree tparms, else if (addr_p) arg = build_pointer_type (arg); - sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg, NULL); + sub_strict |= maybe_adjust_types_for_deduction (strict, &parm, &arg); /* We don't copy orig_targs for this because if we have already deduced some template args from previous args, unify would complain when we Modified: head/contrib/gcc/cp/tree.c ============================================================================== --- head/contrib/gcc/cp/tree.c Fri Dec 20 17:39:07 2013 (r259659) +++ head/contrib/gcc/cp/tree.c Fri Dec 20 18:09:34 2013 (r259660) @@ -64,28 +64,8 @@ lvalue_p_1 (tree ref, cp_lvalue_kind op1_lvalue_kind = clk_none; cp_lvalue_kind op2_lvalue_kind = clk_none; - /* Expressions of reference type are sometimes wrapped in - INDIRECT_REFs. INDIRECT_REFs are just internal compiler - representation, not part of the language, so we have to look - through them. */ - if (TREE_CODE (ref) == INDIRECT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) - == REFERENCE_TYPE) - return lvalue_p_1 (TREE_OPERAND (ref, 0), - treat_class_rvalues_as_lvalues); - if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE) - { - /* unnamed rvalue references are rvalues */ - if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref)) - && TREE_CODE (ref) != PARM_DECL - && TREE_CODE (ref) != VAR_DECL - && TREE_CODE (ref) != COMPONENT_REF) - return clk_none; - - /* lvalue references and named rvalue refences are lvalues */ - return clk_ordinary; - } + return clk_ordinary; if (ref == current_class_ptr) return clk_none; @@ -471,53 +451,6 @@ build_cplus_array_type (tree elt_type, t return t; } - -/* Return a reference type node referring to TO_TYPE. If RVAL is - true, return an rvalue reference type, otherwise return an lvalue - reference type. If a type node exists, reuse it, otherwise create - a new one. */ -tree -cp_build_reference_type (tree to_type, bool rval) -{ - tree lvalue_ref, t; - lvalue_ref = build_reference_type (to_type); - if (!rval) - return lvalue_ref; - - /* This code to create rvalue reference types is based on and tied - to the code creating lvalue reference types in the middle-end - functions build_reference_type_for_mode and build_reference_type. - - It works by putting the rvalue reference type nodes after the - lvalue reference nodes in the TYPE_NEXT_REF_TO linked list, so - they will effectively be ignored by the middle end. */ - - for (t = lvalue_ref; (t = TYPE_NEXT_REF_TO (t)); ) - if (TYPE_REF_IS_RVALUE (t)) - return t; - - t = copy_node (lvalue_ref); - - TYPE_REF_IS_RVALUE (t) = true; - TYPE_NEXT_REF_TO (t) = TYPE_NEXT_REF_TO (lvalue_ref); - TYPE_NEXT_REF_TO (lvalue_ref) = t; - TYPE_MAIN_VARIANT (t) = t; - - if (TYPE_STRUCTURAL_EQUALITY_P (to_type)) - SET_TYPE_STRUCTURAL_EQUALITY (t); - else if (TYPE_CANONICAL (to_type) != to_type) - TYPE_CANONICAL (t) - = cp_build_reference_type (TYPE_CANONICAL (to_type), rval); - else - TYPE_CANONICAL (t) = t; - - layout_type (t); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 18:16:06 2013 Return-Path: Delivered-To: svn-src-all@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 7E9F8F61; Fri, 20 Dec 2013 18:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68B741CAA; Fri, 20 Dec 2013 18:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKIG6Q2074111; Fri, 20 Dec 2013 18:16:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKIG27b074084; Fri, 20 Dec 2013 18:16:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312201816.rBKIG27b074084@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 18:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259661 - in head/contrib/gcc: . cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 18:16:06 -0000 Author: pfg Date: Fri Dec 20 18:16:02 2013 New Revision: 259661 URL: http://svnweb.freebsd.org/changeset/base/259661 Log: Revert r259619: Fixes GCC libstdc++/29286 The fix seems to work for amd64 but causes segfaults on powerpc. At this time gcc is much more important on powerpc than on amd64. Reported by: andreast Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/init.c head/contrib/gcc/doc/c-tree.texi head/contrib/gcc/expr.c head/contrib/gcc/gimple-low.c head/contrib/gcc/gimplify.c head/contrib/gcc/omp-low.c head/contrib/gcc/print-tree.c head/contrib/gcc/tree-gimple.c head/contrib/gcc/tree-inline.c head/contrib/gcc/tree-pretty-print.c head/contrib/gcc/tree-ssa-alias.c head/contrib/gcc/tree-ssa-dce.c head/contrib/gcc/tree-ssa-operands.c head/contrib/gcc/tree-ssa-structalias.c head/contrib/gcc/tree.def head/contrib/gcc/tree.h Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/ChangeLog.gcc43 Fri Dec 20 18:16:02 2013 (r259661) @@ -65,48 +65,6 @@ fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. -2007-06-12 Ian Lance Taylor (r125653) - Daniel Berlin - - PR libstdc++/29286 - * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR. - * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define. - (CHANGE_DYNAMIC_TYPE_LOCATION): Define. - (DECL_NO_TBAA_P): Define. - (struct tree_decl_common): Add no_tbaa_flag field. - * tree-ssa-structalias.c (struct variable_info): Add - no_tbaa_pruning field. - (new_var_info): Initialize no_tbaa_pruning field. - (unify_nodes): Copy no_tbaa_pruning field. - (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR. - (dump_solution_for_var): Print no_tbaa_pruning flag. - (set_uids_in_ptset): Add no_tbaa_pruning parameter. Change all - callers. - (compute_tbaa_pruning): New static function. - (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes. - Call compute_tbaa_pruning. - * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers. - * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR. - * gimple-low.c (lower_stmt): Likewise. - * tree-gimple.c (is_gimple_stmt): Likewise. - * tree-ssa-operands.c (get_expr_operands): Likewise. - * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. - * tree-inline.c (estimate_num_insns_1): Likewise. - (copy_result_decl_to_var): Likewise. - * expr.c (expand_expr_real_1): Likewise. - * tree-pretty-print.c (dump_generic_node): Likewise. - * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag. - * omp-low.c (omp_copy_decl_2): Likewise. - * print-tree.c (print_node): Print DECL_NO_TBAA_P flag. - * doc/c-tree.texi (Expression trees): Document - CHANGE_DYNAMIC_TYPE_EXPR. - -2007-06-09 Daniel Berlin (r125603) - - * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd - parameter, use it. - (find_what_p_points_to): Pass new parameter to set_uids_in_ptset. - 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:16:02 2013 (r259661) @@ -25,12 +25,6 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. -2007-06-12 Ian Lance Taylor (r125653) - - PR libstdc++/29286 - * init.c (avoid_placement_new_aliasing): New static function. - (build_new_1): Call it. - 2007-05-31 Daniel Berlin (r125239) * typeck.c (build_binary_op): Include types in error. Modified: head/contrib/gcc/cp/init.c ============================================================================== --- head/contrib/gcc/cp/init.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/cp/init.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,7 +1,6 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1565,55 +1564,6 @@ build_raw_new_expr (tree placement, tree return new_expr; } -/* Make sure that there are no aliasing issues with T, a placement new - expression applied to PLACEMENT, by recording the change in dynamic - type. If placement new is inlined, as it is with libstdc++, and if - the type of the placement new differs from the type of the - placement location itself, then alias analysis may think it is OK - to interchange writes to the location from before the placement new - and from after the placement new. We have to prevent type-based - alias analysis from applying. PLACEMENT may be NULL, which means - that we couldn't capture it in a temporary variable, in which case - we use a memory clobber. */ - -static tree -avoid_placement_new_aliasing (tree t, tree placement) -{ - tree type_change; - - if (processing_template_decl) - return t; - - /* If we are not using type based aliasing, we don't have to do - anything. */ - if (!flag_strict_aliasing) - return t; - - /* If we have a pointer and a location, record the change in dynamic - type. Otherwise we need a general memory clobber. */ - if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE - && placement != NULL_TREE - && TREE_CODE (TREE_TYPE (placement)) == POINTER_TYPE) - type_change = build_stmt (CHANGE_DYNAMIC_TYPE_EXPR, - TREE_TYPE (t), - placement); - else - { - /* Build a memory clobber. */ - type_change = build_stmt (ASM_EXPR, - build_string (0, ""), - NULL_TREE, - NULL_TREE, - tree_cons (NULL_TREE, - build_string (6, "memory"), - NULL_TREE)); - - ASM_VOLATILE_P (type_change) = 1; - } - - return build2 (COMPOUND_EXPR, TREE_TYPE (t), type_change, t); -} - /* Generate code for a new-expression, including calling the "operator new" function, initializing the object, and, if an exception occurs during construction, cleaning up. The arguments are as for @@ -1657,7 +1607,6 @@ build_new_1 (tree placement, tree type, beginning of the storage allocated for an array-new expression in order to store the number of elements. */ tree cookie_size = NULL_TREE; - tree placement_var; /* True if the function we are calling is a placement allocation function. */ bool placement_allocation_fn_p; @@ -1751,20 +1700,6 @@ build_new_1 (tree placement, tree type, alloc_fn = NULL_TREE; - /* If PLACEMENT is a simple pointer type, then copy it into - PLACEMENT_VAR. */ - if (processing_template_decl - || placement == NULL_TREE - || TREE_CHAIN (placement) != NULL_TREE - || TREE_CODE (TREE_TYPE (TREE_VALUE (placement))) != POINTER_TYPE) - placement_var = NULL_TREE; - else - { - placement_var = get_temp_regvar (TREE_TYPE (TREE_VALUE (placement)), - TREE_VALUE (placement)); - placement = tree_cons (NULL_TREE, placement_var, NULL_TREE); - } - /* Allocate the object. */ if (! placement && TYPE_FOR_JAVA (elt_type)) { @@ -1857,12 +1792,7 @@ build_new_1 (tree placement, tree type, /* In the simple case, we can stop now. */ pointer_type = build_pointer_type (type); if (!cookie_size && !is_initialized) - { - rval = build_nop (pointer_type, alloc_call); - if (placement != NULL) - rval = avoid_placement_new_aliasing (rval, placement_var); - return rval; - } + return build_nop (pointer_type, alloc_call); /* While we're working, use a pointer to the type we've actually allocated. Store the result of the call in a variable so that we @@ -2121,9 +2051,6 @@ build_new_1 (tree placement, tree type, /* A new-expression is never an lvalue. */ gcc_assert (!lvalue_p (rval)); - if (placement != NULL) - rval = avoid_placement_new_aliasing (rval, placement_var); - return rval; } Modified: head/contrib/gcc/doc/c-tree.texi ============================================================================== --- head/contrib/gcc/doc/c-tree.texi Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/doc/c-tree.texi Fri Dec 20 18:16:02 2013 (r259661) @@ -1916,7 +1916,6 @@ This macro returns the attributes on the @tindex TARGET_EXPR @tindex AGGR_INIT_EXPR @tindex VA_ARG_EXPR -@tindex CHANGE_DYNAMIC_TYPE_EXPR @tindex OMP_PARALLEL @tindex OMP_FOR @tindex OMP_SECTIONS @@ -2573,13 +2572,6 @@ mechanism. It represents expressions li Its @code{TREE_TYPE} yields the tree representation for @code{type} and its sole argument yields the representation for @code{ap}. -@item CHANGE_DYNAMIC_TYPE_EXPR -Indicates the special aliasing required by C++ placement new. It has -two operands: a type and a location. It means that the dynamic type -of the location is changing to be the specified type. The alias -analysis code takes this into account when doing type based alias -analysis. - @item OMP_PARALLEL Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/expr.c Fri Dec 20 18:16:02 2013 (r259661) @@ -8718,13 +8718,6 @@ expand_expr_real_1 (tree exp, rtx target /* Lowered by gimplify.c. */ gcc_unreachable (); - case CHANGE_DYNAMIC_TYPE_EXPR: - /* This is ignored at the RTL level. The tree level set - DECL_POINTER_ALIAS_SET of any variable to be 0, which is - overkill for the RTL layer but is all that we can - represent. */ - return const0_rtx; - case EXC_PTR_EXPR: return get_exception_pointer (cfun); Modified: head/contrib/gcc/gimple-low.c ============================================================================== --- head/contrib/gcc/gimple-low.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/gimple-low.c Fri Dec 20 18:16:02 2013 (r259661) @@ -243,7 +243,6 @@ lower_stmt (tree_stmt_iterator *tsi, str case GOTO_EXPR: case LABEL_EXPR: case SWITCH_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: case OMP_FOR: case OMP_SECTIONS: case OMP_SECTION: Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/gimplify.c Fri Dec 20 18:16:02 2013 (r259661) @@ -5748,11 +5748,6 @@ gimplify_expr (tree *expr_p, tree *pre_p ret = GS_ALL_DONE; break; - case CHANGE_DYNAMIC_TYPE_EXPR: - ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p), - pre_p, post_p, is_gimple_reg, fb_lvalue); - break; - case OBJ_TYPE_REF: { enum gimplify_status r0, r1; Modified: head/contrib/gcc/omp-low.c ============================================================================== --- head/contrib/gcc/omp-low.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/omp-low.c Fri Dec 20 18:16:02 2013 (r259661) @@ -518,7 +518,6 @@ omp_copy_decl_2 (tree var, tree name, tr TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (var); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (var); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (var); DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); DECL_IGNORED_P (copy) = DECL_IGNORED_P (var); TREE_USED (copy) = 1; Modified: head/contrib/gcc/print-tree.c ============================================================================== --- head/contrib/gcc/print-tree.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/print-tree.c Fri Dec 20 18:16:02 2013 (r259661) @@ -401,9 +401,7 @@ print_node (FILE *file, const char *pref if (DECL_VIRTUAL_P (node)) fputs (" virtual", file); if (DECL_PRESERVE_P (node)) - fputs (" preserve", file); - if (DECL_NO_TBAA_P (node)) - fputs (" no-tbaa", file); + fputs (" preserve", file); if (DECL_LANG_FLAG_0 (node)) fputs (" decl_0", file); if (DECL_LANG_FLAG_1 (node)) Modified: head/contrib/gcc/tree-gimple.c ============================================================================== --- head/contrib/gcc/tree-gimple.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-gimple.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,6 +1,5 @@ /* Functions to analyze and validate GIMPLE trees. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo Rewritten by Jason Merrill @@ -216,7 +215,6 @@ is_gimple_stmt (tree t) case TRY_FINALLY_EXPR: case EH_FILTER_EXPR: case CATCH_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: case ASM_EXPR: case RESX_EXPR: case PHI_NODE: Modified: head/contrib/gcc/tree-inline.c ============================================================================== --- head/contrib/gcc/tree-inline.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-inline.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1649,11 +1649,6 @@ estimate_num_insns_1 (tree *tp, int *wal *walk_subtrees = 0; return NULL; - /* CHANGE_DYNAMIC_TYPE_EXPR explicitly expands to nothing. */ - case CHANGE_DYNAMIC_TYPE_EXPR: - *walk_subtrees = 0; - return NULL; - /* Try to estimate the cost of assignments. We have three cases to deal with: 1) Simple assignments to registers; @@ -2640,7 +2635,6 @@ copy_decl_to_var (tree decl, copy_body_d TREE_READONLY (copy) = TREE_READONLY (decl); TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); return copy_decl_for_dup_finish (id, decl, copy); } @@ -2667,7 +2661,6 @@ copy_result_decl_to_var (tree decl, copy { TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl); DECL_COMPLEX_GIMPLE_REG_P (copy) = DECL_COMPLEX_GIMPLE_REG_P (decl); - DECL_NO_TBAA_P (copy) = DECL_NO_TBAA_P (decl); } return copy_decl_for_dup_finish (id, decl, copy); Modified: head/contrib/gcc/tree-pretty-print.c ============================================================================== --- head/contrib/gcc/tree-pretty-print.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-pretty-print.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1443,17 +1443,6 @@ dump_generic_node (pretty_printer *buffe is_expr = false; break; - case CHANGE_DYNAMIC_TYPE_EXPR: - pp_string (buffer, "<<>>"); - is_expr = false; - break; - case LABEL_EXPR: op0 = TREE_OPERAND (node, 0); /* If this is for break or continue, don't bother printing it. */ Modified: head/contrib/gcc/tree-ssa-alias.c ============================================================================== --- head/contrib/gcc/tree-ssa-alias.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-alias.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,5 +1,5 @@ /* Alias analysis for trees. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -1961,29 +1961,28 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG); - if (!DECL_NO_TBAA_P (ptr)) + alias_stats.tbaa_queries++; + + /* If the alias sets don't conflict then MEM cannot alias VAR. */ + if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) { - alias_stats.tbaa_queries++; + alias_stats.alias_noalias++; + alias_stats.tbaa_resolved++; + return false; + } - /* If the alias sets don't conflict then MEM cannot alias VAR. */ - if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) - { - alias_stats.alias_noalias++; - alias_stats.tbaa_resolved++; - return false; - } + /* If var is a record or union type, ptr cannot point into var + unless there is some operation explicit address operation in the + program that can reference a field of the ptr's dereferenced + type. This also assumes that the types of both var and ptr are + contained within the compilation unit, and that there is no fancy + addressing arithmetic associated with any of the types + involved. */ - /* If VAR is a record or union type, PTR cannot point into VAR - unless there is some explicit address operation in the - program that can reference a field of the type pointed-to by - PTR. This also assumes that the types of both VAR and PTR - are contained within the compilation unit, and that there is - no fancy addressing arithmetic associated with any of the - types involved. */ - if (mem_alias_set != 0 && var_alias_set != 0) - { - tree ptr_type = TREE_TYPE (ptr); - tree var_type = TREE_TYPE (var); + if ((mem_alias_set != 0) && (var_alias_set != 0)) + { + tree ptr_type = TREE_TYPE (ptr); + tree var_type = TREE_TYPE (var); /* The star count is -1 if the type at the end of the pointer_to chain is not a record or union type. */ @@ -1992,41 +1991,41 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem { int ptr_star_count = 0; - /* ipa_type_escape_star_count_of_interesting_type is a - little too restrictive for the pointer type, need to - allow pointers to primitive types as long as those - types cannot be pointers to everything. */ - while (POINTER_TYPE_P (ptr_type)) - { - /* Strip the *s off. */ - ptr_type = TREE_TYPE (ptr_type); - ptr_star_count++; - } + /* Ipa_type_escape_star_count_of_interesting_type is a little to + restrictive for the pointer type, need to allow pointers to + primitive types as long as those types cannot be pointers + to everything. */ + while (POINTER_TYPE_P (ptr_type)) + /* Strip the *'s off. */ + { + ptr_type = TREE_TYPE (ptr_type); + ptr_star_count++; + } - /* There does not appear to be a better test to see if - the pointer type was one of the pointer to everything - types. */ - if (ptr_star_count > 0) - { - alias_stats.structnoaddress_queries++; - if (ipa_type_escape_field_does_not_clobber_p (var_type, - TREE_TYPE (ptr))) - { - alias_stats.structnoaddress_resolved++; - alias_stats.alias_noalias++; - return false; - } - } - else if (ptr_star_count == 0) + /* There does not appear to be a better test to see if the + pointer type was one of the pointer to everything + types. */ + + if (ptr_star_count > 0) + { + alias_stats.structnoaddress_queries++; + if (ipa_type_escape_field_does_not_clobber_p (var_type, + TREE_TYPE (ptr))) { - /* If PTR_TYPE was not really a pointer to type, it cannot - alias. */ - alias_stats.structnoaddress_queries++; alias_stats.structnoaddress_resolved++; alias_stats.alias_noalias++; return false; } } + else if (ptr_star_count == 0) + { + /* If ptr_type was not really a pointer to type, it cannot + alias. */ + alias_stats.structnoaddress_queries++; + alias_stats.structnoaddress_resolved++; + alias_stats.alias_noalias++; + return false; + } } } Modified: head/contrib/gcc/tree-ssa-dce.c ============================================================================== --- head/contrib/gcc/tree-ssa-dce.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-dce.c Fri Dec 20 18:16:02 2013 (r259661) @@ -1,6 +1,5 @@ /* Dead code elimination pass for the GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Ben Elliston and Andrew MacLeod Adapted to use control dependence by Steven Bosscher, SUSE Labs. @@ -308,7 +307,6 @@ mark_stmt_if_obviously_necessary (tree s case ASM_EXPR: case RESX_EXPR: case RETURN_EXPR: - case CHANGE_DYNAMIC_TYPE_EXPR: mark_stmt_necessary (stmt, true); return; Modified: head/contrib/gcc/tree-ssa-operands.c ============================================================================== --- head/contrib/gcc/tree-ssa-operands.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-operands.c Fri Dec 20 18:16:02 2013 (r259661) @@ -2057,10 +2057,6 @@ get_expr_operands (tree stmt, tree *expr return; } - case CHANGE_DYNAMIC_TYPE_EXPR: - get_expr_operands (stmt, &CHANGE_DYNAMIC_TYPE_LOCATION (expr), opf_none); - return; - case BLOCK: case FUNCTION_DECL: case EXC_PTR_EXPR: Modified: head/contrib/gcc/tree-ssa-structalias.c ============================================================================== --- head/contrib/gcc/tree-ssa-structalias.c Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree-ssa-structalias.c Fri Dec 20 18:16:02 2013 (r259661) @@ -251,10 +251,6 @@ struct variable_info /* True if this is a heap variable. */ unsigned int is_heap_var:1; - /* True if we may not use TBAA to prune references to this - variable. This is used for C++ placement new. */ - unsigned int no_tbaa_pruning : 1; - /* Points-to set for this variable. */ bitmap solution; @@ -372,7 +368,6 @@ static varinfo_t new_var_info (tree t, unsigned int id, const char *name) { varinfo_t ret = pool_alloc (variable_info_pool); - tree var; ret->id = id; ret->name = name; @@ -383,12 +378,6 @@ new_var_info (tree t, unsigned int id, c ret->is_special_var = false; ret->is_unknown_size_var = false; ret->has_union = false; - var = t; - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - ret->no_tbaa_pruning = (DECL_P (var) - && POINTER_TYPE_P (TREE_TYPE (var)) - && DECL_NO_TBAA_P (var)); ret->solution = BITMAP_ALLOC (&pta_obstack); ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack); ret->next = NULL; @@ -1232,9 +1221,6 @@ unify_nodes (constraint_graph_t graph, u merge_graph_nodes (graph, to, from); merge_node_constraints (graph, to, from); - if (get_varinfo (from)->no_tbaa_pruning) - get_varinfo (to)->no_tbaa_pruning = true; - if (update_changed && TEST_BIT (changed, from)) { RESET_BIT (changed, from); @@ -3578,14 +3564,6 @@ find_func_aliases (tree origt) } } } - else if (TREE_CODE (t) == CHANGE_DYNAMIC_TYPE_EXPR) - { - unsigned int j; - - get_constraint_for (CHANGE_DYNAMIC_TYPE_LOCATION (t), &lhsc); - for (j = 0; VEC_iterate (ce_s, lhsc, j, c); ++j) - get_varinfo (c->var)->no_tbaa_pruning = true; - } /* After promoting variables and computing aliasing we will need to re-scan most statements. FIXME: Try to minimize the @@ -4272,10 +4250,7 @@ dump_solution_for_var (FILE *file, unsig { fprintf (file, "%s ", get_varinfo (i)->name); } - fprintf (file, "}"); - if (vi->no_tbaa_pruning) - fprintf (file, " no-tbaa-pruning"); - fprintf (file, "\n"); + fprintf (file, "}\n"); } } @@ -4447,15 +4422,10 @@ shared_bitmap_add (bitmap pt_vars) /* Set bits in INTO corresponding to the variable uids in solution set FROM, which came from variable PTR. For variables that are actually dereferenced, we also use type - based alias analysis to prune the points-to sets. - IS_DEREFED is true if PTR was directly dereferenced, which we use to - help determine whether we are we are allowed to prune using TBAA. - If NO_TBAA_PRUNING is true, we do not perform any TBAA pruning of - the from set. */ + based alias analysis to prune the points-to sets. */ static void -set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed, - bool no_tbaa_pruning) +set_uids_in_ptset (tree ptr, bitmap into, bitmap from) { unsigned int i; bitmap_iterator bi; @@ -4492,8 +4462,7 @@ set_uids_in_ptset (tree ptr, bitmap into if (sft) { var_alias_set = get_alias_set (sft); - if (no_tbaa_pruning - || (!is_derefed && !vi->directly_dereferenced) + if (!vi->directly_dereferenced || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (sft)); } @@ -4507,8 +4476,7 @@ set_uids_in_ptset (tree ptr, bitmap into else { var_alias_set = get_alias_set (vi->decl); - if (no_tbaa_pruning - || (!is_derefed && !vi->directly_dereferenced) + if (!vi->directly_dereferenced || alias_sets_conflict_p (ptr_alias_set, var_alias_set)) bitmap_set_bit (into, DECL_UID (vi->decl)); } @@ -4596,9 +4564,7 @@ find_what_p_points_to (tree p) return false; finished_solution = BITMAP_GGC_ALLOC (); - set_uids_in_ptset (vi->decl, finished_solution, vi->solution, - vi->directly_dereferenced, - vi->no_tbaa_pruning); + set_uids_in_ptset (vi->decl, finished_solution, vi->solution); result = shared_bitmap_lookup (finished_solution); if (!result) @@ -4947,142 +4913,6 @@ remove_preds_and_fake_succs (constraint_ bitmap_obstack_release (&predbitmap_obstack); } -/* Compute the set of variables we can't TBAA prune. */ - -static void -compute_tbaa_pruning (void) -{ - unsigned int size = VEC_length (varinfo_t, varmap); - unsigned int i; - bool any; - - changed_count = 0; - changed = sbitmap_alloc (size); - sbitmap_zero (changed); - - /* Mark all initial no_tbaa_pruning nodes as changed. */ - any = false; - for (i = 0; i < size; ++i) - { - varinfo_t ivi = get_varinfo (i); - - if (find (i) == i && ivi->no_tbaa_pruning) - { - any = true; - if ((graph->succs[i] && !bitmap_empty_p (graph->succs[i])) - || VEC_length (constraint_t, graph->complex[i]) > 0) - { - SET_BIT (changed, i); - ++changed_count; - } - } - } - - while (changed_count > 0) - { - struct topo_info *ti = init_topo_info (); - ++stats.iterations; - - bitmap_obstack_initialize (&iteration_obstack); - - compute_topo_order (graph, ti); - - while (VEC_length (unsigned, ti->topo_order) != 0) - { - bitmap_iterator bi; - - i = VEC_pop (unsigned, ti->topo_order); - - /* If this variable is not a representative, skip it. */ - if (find (i) != i) - continue; - - /* If the node has changed, we need to process the complex - constraints and outgoing edges again. */ - if (TEST_BIT (changed, i)) - { - unsigned int j; - constraint_t c; - VEC(constraint_t,heap) *complex = graph->complex[i]; - - RESET_BIT (changed, i); - --changed_count; - - /* Process the complex copy constraints. */ - for (j = 0; VEC_iterate (constraint_t, complex, j, c); ++j) - { - if (c->lhs.type == SCALAR && c->rhs.type == SCALAR) - { - varinfo_t lhsvi = get_varinfo (find (c->lhs.var)); - - if (!lhsvi->no_tbaa_pruning) - { - lhsvi->no_tbaa_pruning = true; - if (!TEST_BIT (changed, lhsvi->id)) - { - SET_BIT (changed, lhsvi->id); - ++changed_count; - } - } - } - } - - /* Propagate to all successors. */ - EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i], 0, j, bi) - { - unsigned int to = find (j); - varinfo_t tovi = get_varinfo (to); - - /* Don't propagate to ourselves. */ - if (to == i) - continue; - - if (!tovi->no_tbaa_pruning) - { - tovi->no_tbaa_pruning = true; - if (!TEST_BIT (changed, to)) - { - SET_BIT (changed, to); - ++changed_count; - } - } - } - } - } - - free_topo_info (ti); - bitmap_obstack_release (&iteration_obstack); - } - - sbitmap_free (changed); - - if (any) - { - for (i = 0; i < size; ++i) - { - varinfo_t ivi = get_varinfo (i); - varinfo_t ivip = get_varinfo (find (i)); - - if (ivip->no_tbaa_pruning) - { - tree var = ivi->decl; - - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - - if (POINTER_TYPE_P (TREE_TYPE (var))) - { - DECL_NO_TBAA_P (var) = 1; - - /* Tell the RTL layer that this pointer can alias - anything. */ - DECL_POINTER_ALIAS_SET (var) = 0; - } - } - } - } -} - /* Create points-to sets for the current function. See the comments at the start of the file for an algorithmic overview. */ @@ -5118,7 +4948,7 @@ compute_points_to_sets (struct alias_inf } } - for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) { tree stmt = bsi_stmt (bsi); @@ -5129,13 +4959,6 @@ compute_points_to_sets (struct alias_inf This is used when creating name tags and alias sets. */ update_alias_info (stmt, ai); - - /* The information in CHANGE_DYNAMIC_TYPE_EXPR nodes has now - been captured, and we can remove them. */ - if (TREE_CODE (stmt) == CHANGE_DYNAMIC_TYPE_EXPR) - bsi_remove (&bsi, true); - else - bsi_next (&bsi); } } @@ -5168,8 +4991,6 @@ compute_points_to_sets (struct alias_inf solve_graph (graph); - compute_tbaa_pruning (); - if (dump_file) dump_sa_points_to_info (dump_file); have_alias_info = true; Modified: head/contrib/gcc/tree.def ============================================================================== --- head/contrib/gcc/tree.def Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree.def Fri Dec 20 18:16:02 2013 (r259661) @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the tree codes used in GCC. Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -880,15 +880,6 @@ DEFTREECODE (CATCH_EXPR, "catch_expr", t expanding. */ DEFTREECODE (EH_FILTER_EXPR, "eh_filter_expr", tcc_statement, 2) -/* Indicates a change in the dynamic type of a memory location. This - has no value and generates no executable code. It is only used for - type based alias analysis. This is generated by C++ placement new. - CHANGE_DYNAMIC_TYPE_NEW_TYPE, the first operand, is the new type. - CHNAGE_DYNAMIC_TYPE_LOCATION, the second operand, is the location - whose type is being changed. */ -DEFTREECODE (CHANGE_DYNAMIC_TYPE_EXPR, "change_dynamic_type_expr", - tcc_statement, 2) - /* Node used for describing a property that is known at compile time. */ DEFTREECODE (SCEV_KNOWN, "scev_known", tcc_expression, 0) Modified: head/contrib/gcc/tree.h ============================================================================== --- head/contrib/gcc/tree.h Fri Dec 20 18:09:34 2013 (r259660) +++ head/contrib/gcc/tree.h Fri Dec 20 18:16:02 2013 (r259661) @@ -1548,12 +1548,6 @@ struct tree_constructor GTY(()) #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1) #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE)) -/* CHANGE_DYNAMIC_TYPE_EXPR accessors. */ -#define CHANGE_DYNAMIC_TYPE_NEW_TYPE(NODE) \ - TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 0) -#define CHANGE_DYNAMIC_TYPE_LOCATION(NODE) \ - TREE_OPERAND (CHANGE_DYNAMIC_TYPE_EXPR_CHECK (NODE), 1) - /* OBJ_TYPE_REF accessors. */ #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0) #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1) @@ -2544,11 +2538,6 @@ struct tree_struct_field_tag GTY(()) #define DECL_CALL_CLOBBERED(DECL) \ DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag -/* For a DECL with pointer type, this is set if Type Based Alias - Analysis should not be applied to this DECL. */ -#define DECL_NO_TBAA_P(DECL) \ - DECL_COMMON_CHECK (DECL)->decl_common.no_tbaa_flag - struct tree_decl_common GTY(()) { struct tree_decl_minimal common; @@ -2590,8 +2579,6 @@ struct tree_decl_common GTY(()) parm decl. */ unsigned gimple_reg_flag : 1; unsigned call_clobbered_flag : 1; - /* In a DECL with pointer type, set if no TBAA should be done. */ - unsigned no_tbaa_flag : 1; unsigned int align : 24; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 18:27:22 2013 Return-Path: Delivered-To: svn-src-all@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 426F3B28; Fri, 20 Dec 2013 18:27:22 +0000 (UTC) Received: from mail-oa0-x22c.google.com (mail-oa0-x22c.google.com [IPv6:2607:f8b0:4003:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D66E71DB9; Fri, 20 Dec 2013 18:27:21 +0000 (UTC) Received: by mail-oa0-f44.google.com with SMTP id m1so3283514oag.31 for ; Fri, 20 Dec 2013 10:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SaUEgQPuwCCaXmaP6rHh8uRAsbXE3mIczyobFVemo8I=; b=cGlkgUPRN6xgwg3G2ggLGfa0axUXloZMX4x99PogcG1S+pCJCvQKWPfn/06oFrAP4Q EfQqNygN8MsJKurUM8fJ3e31Zq2T5Lg/9C4dPttdLRJjxCelWDwjY6xTJnnG5X/OU4wH cdWECIuKR0yTGdwfm/NL4hUs+c1KsNvwe2zX5kTU+mlXzqTBttDLL8MZ3UI9+jpM+Nrf eq/o6hf0/xlgUewgd+0NqPC7PfEF9qysj7mWIJ8k2oFkcln4JBMJIqV7CcWmWTMjl5tN F6UJX3VLqblQu/E1t4aoePWU7RzCvbc+cE+q0Z6eEWz7Gyoiq0tVuNvmgJ0Hjq4Pjvbl +wmg== MIME-Version: 1.0 X-Received: by 10.182.99.231 with SMTP id et7mr7427510obb.10.1387564041175; Fri, 20 Dec 2013 10:27:21 -0800 (PST) Received: by 10.182.142.101 with HTTP; Fri, 20 Dec 2013 10:27:21 -0800 (PST) In-Reply-To: <201312200550.rBK5oNmw098487@svn.freebsd.org> References: <201312200550.rBK5oNmw098487@svn.freebsd.org> Date: Fri, 20 Dec 2013 10:27:21 -0800 Message-ID: Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel From: Benjamin Kaduk To: Neel Natu Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 18:27:22 -0000 On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: > Author: neel > Date: Fri Dec 20 05:50:22 2013 > New Revision: 259641 > URL: http://svnweb.freebsd.org/changeset/base/259641 > > Log: > Re-arrange bits in the amd64/pmap 'pm_flags' field. > > The least significant 8 bits of 'pm_flags' are now used for the IPI > vector > to use for nested page table TLB shootdown. > > Previously we used IPI_AST to interrupt the host cpu which is > functionally > correct but could lead to misleading interrupt counts for AST handler. > The > AST handler was also doing a lot more than what is required for the > nested > page table TLB shootdown (EOI and IRET). > This represents a KBI change, does it not? Should __FreeBSD_version be bumped? -Ben From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 19:27:01 2013 Return-Path: Delivered-To: svn-src-all@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 3A49893; Fri, 20 Dec 2013 19:27:01 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA25612BE; Fri, 20 Dec 2013 19:27:00 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id n7so2644265qcx.33 for ; Fri, 20 Dec 2013 11:26:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QcQeA2Vt9zvHFLbeTRpWUel4QCUr/JvcPE5hYHaSZY4=; b=PSLlhefnXjMaFWnZ0HzYH3HgXoEQ9WL/iSsEHgTQsE9PN6Azv6L46JeqsPWZorCrVi RuiHtA4PFIrIKftWVe4JfYrxXKAuEqFnzzFb3ZvyHgBruBjXlnQa/4lcH2EKIbcuYe6C ZMUGHo9EYUSsvbgf52BY35HlLkw/x4L0Or1LiBf/2TE+puXVzHmVVkim7b6rgRPQKAZk DYrvApeLwwA9VFTJ3u2Di6WzTNimQUXDvisV7M9uLO3aR9X0vwNOS5xXa7ms+3h5WPme S4lJw5ynv/6jBAAsjmEYWw2G+4Zkn0WUVEw72WvSC+x7RURBYo28ZFvlhRxGT8pJgrI5 xwAQ== MIME-Version: 1.0 X-Received: by 10.49.15.202 with SMTP id z10mr17400556qec.46.1387567619788; Fri, 20 Dec 2013 11:26:59 -0800 (PST) Received: by 10.140.34.17 with HTTP; Fri, 20 Dec 2013 11:26:59 -0800 (PST) In-Reply-To: References: <201312200550.rBK5oNmw098487@svn.freebsd.org> Date: Fri, 20 Dec 2013 11:26:59 -0800 Message-ID: Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel From: Neel Natu To: Benjamin Kaduk Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 19:27:01 -0000 Hi Ben, On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk wrote: > On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: >> >> Author: neel >> Date: Fri Dec 20 05:50:22 2013 >> New Revision: 259641 >> URL: http://svnweb.freebsd.org/changeset/base/259641 >> >> Log: >> Re-arrange bits in the amd64/pmap 'pm_flags' field. >> >> The least significant 8 bits of 'pm_flags' are now used for the IPI >> vector >> to use for nested page table TLB shootdown. >> >> Previously we used IPI_AST to interrupt the host cpu which is >> functionally >> correct but could lead to misleading interrupt counts for AST handler. >> The >> AST handler was also doing a lot more than what is required for the >> nested >> page table TLB shootdown (EOI and IRET). > > > This represents a KBI change, does it not? Should __FreeBSD_version be > bumped? > I was under the impression that a bump would be required only if this change is MFCed to a stable branch. I could be wrong about this and if so would be happy to rectify it. best Neel > -Ben From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 19:44:30 2013 Return-Path: Delivered-To: svn-src-all@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 6BFF27D6; Fri, 20 Dec 2013 19:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 581B21470; Fri, 20 Dec 2013 19:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKJiUes008608; Fri, 20 Dec 2013 19:44:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKJiUwS008607; Fri, 20 Dec 2013 19:44:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201944.rBKJiUwS008607@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 19:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259662 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 19:44:30 -0000 Author: glebius Date: Fri Dec 20 19:44:29 2013 New Revision: 259662 URL: http://svnweb.freebsd.org/changeset/base/259662 Log: Fix build. Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Fri Dec 20 18:16:02 2013 (r259661) +++ head/sys/rpc/svc.c Fri Dec 20 19:44:29 2013 (r259662) @@ -293,7 +293,7 @@ xprt_unregister_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); xprt_inactive_locked(xprt); @@ -327,7 +327,7 @@ xprt_assignthread(SVCXPRT *xprt) SVCPOOL *pool = xprt->xp_pool; SVCTHREAD *st; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); st = LIST_FIRST(&pool->sp_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); @@ -387,7 +387,7 @@ xprt_inactive_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; - mtx_assert(&xprt->xp_mlock, MA_OWNED); + mtx_assert(&pool->sp_lock, MA_OWNED); if (xprt->xp_active) { if (xprt->xp_thread == NULL) TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 19:45:51 2013 Return-Path: Delivered-To: svn-src-all@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 97632A2B; Fri, 20 Dec 2013 19:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 837C71483; Fri, 20 Dec 2013 19:45:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKJjp11009107; Fri, 20 Dec 2013 19:45:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKJjpuj009106; Fri, 20 Dec 2013 19:45:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312201945.rBKJjpuj009106@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 20 Dec 2013 19:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259663 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 19:45:51 -0000 Author: glebius Date: Fri Dec 20 19:45:51 2013 New Revision: 259663 URL: http://svnweb.freebsd.org/changeset/base/259663 Log: 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. Sponsored by: Nginx, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Dec 20 19:44:29 2013 (r259662) +++ head/sys/kern/tty.c Fri Dec 20 19:45:51 2013 (r259663) @@ -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); } @@ -1279,6 +1274,11 @@ tty_makedevf(struct tty *tp, struct ucre } } + sx_xlock(&tty_list_sx); + TAILQ_INSERT_TAIL(&tty_list, tp, t_list); + tty_list_count++; + sx_xunlock(&tty_list_sx); + return (0); fail: From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 20:14:54 2013 Return-Path: Delivered-To: svn-src-all@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 C95BE408; Fri, 20 Dec 2013 20:14:54 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B420A16A7; Fri, 20 Dec 2013 20:14:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKEsEZ022816; Fri, 20 Dec 2013 20:14:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKEsTJ022815; Fri, 20 Dec 2013 20:14:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312202014.rBKKEsTJ022815@svn.freebsd.org> From: Dimitry Andric Date: Fri, 20 Dec 2013 20:14:54 +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: r259664 - in stable: 10/contrib/llvm/tools/clang/lib/Headers 9/contrib/llvm/tools/clang/lib/Headers X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 20:14:54 -0000 Author: dim Date: Fri Dec 20 20:14:54 2013 New Revision: 259664 URL: http://svnweb.freebsd.org/changeset/base/259664 Log: MFC r259498: Pull in r197399 from upstream clang trunk: Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat. Modified: stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/Headers/cpuid.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h Fri Dec 20 19:45:51 2013 (r259663) +++ stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h Fri Dec 20 20:14:54 2013 (r259664) @@ -79,6 +79,7 @@ #define bit_ACPI 0x00400000 #define bit_MMX 0x00800000 #define bit_FXSR 0x01000000 +#define bit_FXSAVE bit_FXSR /* for gcc compat */ #define bit_SSE 0x02000000 #define bit_SSE2 0x04000000 #define bit_SS 0x08000000 From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 20:14:55 2013 Return-Path: Delivered-To: svn-src-all@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 29479409; Fri, 20 Dec 2013 20:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 149CB16A8; Fri, 20 Dec 2013 20:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKEso2022822; Fri, 20 Dec 2013 20:14:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKEs6O022821; Fri, 20 Dec 2013 20:14:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312202014.rBKKEs6O022821@svn.freebsd.org> From: Dimitry Andric Date: Fri, 20 Dec 2013 20:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259664 - in stable: 10/contrib/llvm/tools/clang/lib/Headers 9/contrib/llvm/tools/clang/lib/Headers X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 20:14:55 -0000 Author: dim Date: Fri Dec 20 20:14:54 2013 New Revision: 259664 URL: http://svnweb.freebsd.org/changeset/base/259664 Log: MFC r259498: Pull in r197399 from upstream clang trunk: Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat. Modified: stable/10/contrib/llvm/tools/clang/lib/Headers/cpuid.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Headers/cpuid.h ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Headers/cpuid.h Fri Dec 20 19:45:51 2013 (r259663) +++ stable/10/contrib/llvm/tools/clang/lib/Headers/cpuid.h Fri Dec 20 20:14:54 2013 (r259664) @@ -79,6 +79,7 @@ #define bit_ACPI 0x00400000 #define bit_MMX 0x00800000 #define bit_FXSR 0x01000000 +#define bit_FXSAVE bit_FXSR /* for gcc compat */ #define bit_SSE 0x02000000 #define bit_SSE2 0x04000000 #define bit_SS 0x08000000 From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 20:22:10 2013 Return-Path: Delivered-To: svn-src-all@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 EDB5B906; Fri, 20 Dec 2013 20:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA1B8174E; Fri, 20 Dec 2013 20:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKMA2H026552; Fri, 20 Dec 2013 20:22:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKMATA026551; Fri, 20 Dec 2013 20:22:10 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201312202022.rBKKMATA026551@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 20 Dec 2013 20:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259665 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 20:22:11 -0000 Author: gnn Date: Fri Dec 20 20:22:10 2013 New Revision: 259665 URL: http://svnweb.freebsd.org/changeset/base/259665 Log: Add another Haswell model (0x45) to the set of supported chips. Model 0x45 appears, for example, in late 2013 Mac Book Pro models and is properly emulated by VMware. Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 20:14:54 2013 (r259664) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Dec 20 20:22:10 2013 (r259665) @@ -173,6 +173,7 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x3C: /* Per Intel document 325462-045US 01/2013. */ + case 0x45: cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 20:57:16 2013 Return-Path: Delivered-To: svn-src-all@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 EB0FA57F; Fri, 20 Dec 2013 20:57:16 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D62F419D1; Fri, 20 Dec 2013 20:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKKvG7g039010; Fri, 20 Dec 2013 20:57:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKKvECG038994; Fri, 20 Dec 2013 20:57:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312202057.rBKKvECG038994@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Dec 2013 20:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259666 - in head/contrib/gcc: . cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 20:57:17 -0000 Author: pfg Date: Fri Dec 20 20:57:13 2013 New Revision: 259666 URL: http://svnweb.freebsd.org/changeset/base/259666 Log: gcc: clean some warnings from -Wformat-security Obtained from: Apple GCC 4.2 - 5646 (Radar 5764921) MFC after: 1 week Modified: head/contrib/gcc/c-common.c head/contrib/gcc/c-convert.c head/contrib/gcc/c-incpath.c head/contrib/gcc/c-typeck.c head/contrib/gcc/cfg.c head/contrib/gcc/collect2.c head/contrib/gcc/cp/cvt.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/typeck.c head/contrib/gcc/fold-const.c head/contrib/gcc/gcc.c head/contrib/gcc/gcov.c head/contrib/gcc/tlink.c Modified: head/contrib/gcc/c-common.c ============================================================================== --- head/contrib/gcc/c-common.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-common.c Fri Dec 20 20:57:13 2013 (r259666) @@ -6014,11 +6014,11 @@ c_parse_error (const char *gmsgid, enum message = NULL; } else - error (gmsgid); + error (gmsgid, ""); if (message) { - error (message); + error (message, ""); free (message); } #undef catenate_messages Modified: head/contrib/gcc/c-convert.c ============================================================================== --- head/contrib/gcc/c-convert.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-convert.c Fri Dec 20 20:57:13 2013 (r259666) @@ -80,7 +80,7 @@ convert (tree type, tree expr) if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/c-incpath.c ============================================================================== --- head/contrib/gcc/c-incpath.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-incpath.c Fri Dec 20 20:57:13 2013 (r259666) @@ -72,7 +72,7 @@ free_path (struct cpp_dir *path, int rea case REASON_DUP_SYS: fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name); if (reason == REASON_DUP_SYS) - fprintf (stderr, + fprintf (stderr, "%s", _(" as it is a non-system directory that duplicates a system directory\n")); break; @@ -292,16 +292,16 @@ merge_include_chains (cpp_reader *pfile, { struct cpp_dir *p; - fprintf (stderr, _("#include \"...\" search starts here:\n")); + fprintf (stderr, "%s", _("#include \"...\" search starts here:\n")); for (p = heads[QUOTE];; p = p->next) { if (p == heads[BRACKET]) - fprintf (stderr, _("#include <...> search starts here:\n")); + fprintf (stderr, "%s", _("#include <...> search starts here:\n")); if (!p) break; fprintf (stderr, " %s\n", p->name); } - fprintf (stderr, _("End of search list.\n")); + fprintf (stderr, "%s", _("End of search list.\n")); } } Modified: head/contrib/gcc/c-typeck.c ============================================================================== --- head/contrib/gcc/c-typeck.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/c-typeck.c Fri Dec 20 20:57:13 2013 (r259666) @@ -2584,7 +2584,7 @@ convert_arguments (tree typelist, tree v else if ((invalid_func_diag = targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val))) { - error (invalid_func_diag); + error (invalid_func_diag, ""); return error_mark_node; } else @@ -2781,7 +2781,7 @@ build_unary_op (enum tree_code code, tre if ((invalid_op_diag = targetm.invalid_unary_op (code, TREE_TYPE (xarg)))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } @@ -7819,7 +7819,7 @@ build_binary_op (enum tree_code code, tr if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/cfg.c ============================================================================== --- head/contrib/gcc/cfg.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cfg.c Fri Dec 20 20:57:13 2013 (r259666) @@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc else fprintf (file, ", "); first = false; - fputs (bb_bitnames[i], file); + fprintf (file, "%s", bb_bitnames[i]); } if (!first) fprintf (file, ")"); Modified: head/contrib/gcc/collect2.c ============================================================================== --- head/contrib/gcc/collect2.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/collect2.c Fri Dec 20 20:57:13 2013 (r259666) @@ -1562,10 +1562,10 @@ collect_execute (const char *prog, char if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } return pex; @@ -2050,10 +2050,10 @@ scan_prog_file (const char *prog_name, e if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); Modified: head/contrib/gcc/cp/cvt.c ============================================================================== --- head/contrib/gcc/cp/cvt.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/cvt.c Fri Dec 20 20:57:13 2013 (r259666) @@ -615,7 +615,7 @@ ocp_convert (tree type, tree expr, int c if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/pt.c Fri Dec 20 20:57:13 2013 (r259666) @@ -8925,7 +8925,7 @@ tsubst_copy_and_build (tree t, /*template_arg_p=*/false, &error_msg); if (error_msg) - error (error_msg); + error ("%s", error_msg); if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE) decl = unqualified_name_lookup_error (decl); return decl; Modified: head/contrib/gcc/cp/typeck.c ============================================================================== --- head/contrib/gcc/cp/typeck.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/cp/typeck.c Fri Dec 20 20:57:13 2013 (r259666) @@ -3107,7 +3107,7 @@ build_binary_op (enum tree_code code, tr if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } @@ -4034,7 +4034,7 @@ build_unary_op (enum tree_code code, tre : code), TREE_TYPE (xarg)))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } Modified: head/contrib/gcc/fold-const.c ============================================================================== --- head/contrib/gcc/fold-const.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/fold-const.c Fri Dec 20 20:57:13 2013 (r259666) @@ -992,7 +992,7 @@ fold_overflow_warning (const char* gmsgi } } else if (issue_strict_overflow_warning (wc)) - warning (OPT_Wstrict_overflow, gmsgid); + warning (OPT_Wstrict_overflow, "%s", gmsgid); } /* Return true if the built-in mathematical function specified by CODE Modified: head/contrib/gcc/gcc.c ============================================================================== --- head/contrib/gcc/gcc.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/gcc.c Fri Dec 20 20:57:13 2013 (r259666) @@ -2974,7 +2974,7 @@ execute (void) if (errmsg != NULL) { if (err == 0) - fatal (errmsg); + fatal ("%s", errmsg); else { errno = err; @@ -6525,7 +6525,7 @@ main (int argc, char **argv) if (! verbose_flag) { - printf (_("\nFor bug reporting instructions, please see:\n")); + printf ("%s", _("\nFor bug reporting instructions, please see:\n")); printf ("%s.\n", bug_report_url); return (0); Modified: head/contrib/gcc/gcov.c ============================================================================== --- head/contrib/gcc/gcov.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/gcov.c Fri Dec 20 20:57:13 2013 (r259666) @@ -414,7 +414,7 @@ print_usage (int error_p) static void print_version (void) { - fnotice (stdout, "gcov (GCC) %s\n", version_string); + fnotice (stdout, "%s", "gcov (GCC) %s\n", version_string); fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n", _("(C)")); fnotice (stdout, Modified: head/contrib/gcc/tlink.c ============================================================================== --- head/contrib/gcc/tlink.c Fri Dec 20 20:22:10 2013 (r259665) +++ head/contrib/gcc/tlink.c Fri Dec 20 20:57:13 2013 (r259666) @@ -381,7 +381,7 @@ read_repo_file (file *f) FILE *stream = fopen (f->key, "r"); if (tlink_verbose >= 2) - fprintf (stderr, _("collect: reading %s\n"), f->key); + fprintf (stderr, "%s", _("collect: reading %s\n"), f->key); while (fscanf (stream, "%c ", &c) == 1) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 21:31:53 2013 Return-Path: Delivered-To: svn-src-all@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 D95F2199; Fri, 20 Dec 2013 21:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4DD21D48; Fri, 20 Dec 2013 21:31:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKLVqms054866; Fri, 20 Dec 2013 21:31:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKLVpsA054857; Fri, 20 Dec 2013 21:31:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312202131.rBKLVpsA054857@svn.freebsd.org> From: Ed Schouten Date: Fri, 20 Dec 2013 21:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259667 - in head/sys: dev/syscons dev/vt kern sys teken teken/demo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 21:31:53 -0000 Author: ed Date: Fri Dec 20 21:31:50 2013 New Revision: 259667 URL: http://svnweb.freebsd.org/changeset/base/259667 Log: Extend libteken to support CJK fullwidth characters. Introduce a new formatting bit (TF_CJK_RIGHT) that is set when putting a cell that is the right part of a CJK fullwidth character. This will allow drivers like vt(9) to support fullwidth characters properly. emaste@ has a patch to extend vt(9)'s font handling to increase the number of Unicode -> glyph maps from 2 ({normal,bold)} to 4 ({normal,bold} x {left,right}). This will need to use this formatting bit to determine whether to draw the left or right glyph. Reviewed by: emaste Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/vt/vt_font.c head/sys/kern/subr_terminal.c head/sys/sys/terminal.h head/sys/teken/demo/teken_demo.c head/sys/teken/teken.h head/sys/teken/teken_subr.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/dev/syscons/scterm-teken.c Fri Dec 20 21:31:50 2013 (r259667) @@ -553,7 +553,14 @@ scteken_putchar(void *arg, const teken_p vm_offset_t p; int cursor, attr; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ attr = scteken_attr(a) << 8; + if (a->ta_format & TF_CJK_RIGHT) + c = ' '; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/dev/vt/vt_font.c Fri Dec 20 21:31:50 2013 (r259667) @@ -87,7 +87,15 @@ vtfont_lookup(const struct vt_font *vf, uint16_t dst; size_t stride; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ src = TCHAR_CHARACTER(c); + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) + src = ' '; + if (TCHAR_FORMAT(c) & TF_BOLD) { dst = vtfont_bisearch(vf->vf_bold, vf->vf_bold_length, src); if (dst != 0) Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/kern/subr_terminal.c Fri Dec 20 21:31:50 2013 (r259667) @@ -128,7 +128,7 @@ static const teken_attr_t default_messag }; #define TCHAR_CREATE(c, a) ((c) | \ - (a)->ta_format << 22 | \ + (a)->ta_format << 21 | \ teken_256to8((a)->ta_fgcolor) << 26 | \ teken_256to8((a)->ta_bgcolor) << 29) Modified: head/sys/sys/terminal.h ============================================================================== --- head/sys/sys/terminal.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/sys/terminal.h Fri Dec 20 21:31:50 2013 (r259667) @@ -62,15 +62,14 @@ struct tty; * * Bits Meaning * 0-20: Character value - * 21: Unused - * 22-25: Bold, underline, blink, reverse + * 21-25: Bold, underline, blink, reverse, right part of CJK fullwidth character * 26-28: Foreground color * 29-31: Background color */ typedef uint32_t term_char_t; #define TCHAR_CHARACTER(c) ((c) & 0x1fffff) -#define TCHAR_FORMAT(c) (((c) >> 22) & 0xf) +#define TCHAR_FORMAT(c) (((c) >> 21) & 0x1f) #define TCHAR_FGCOLOR(c) (((c) >> 26) & 0x7) #define TCHAR_BGCOLOR(c) ((c) >> 29) Modified: head/sys/teken/demo/teken_demo.c ============================================================================== --- head/sys/teken/demo/teken_demo.c Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/demo/teken_demo.c Fri Dec 20 21:31:50 2013 (r259667) @@ -86,9 +86,10 @@ printchar(const teken_pos_t *p) assert(p->tp_row < NROWS); assert(p->tp_col < NCOLS); - getyx(stdscr, y, x); - px = &buffer[p->tp_col][p->tp_row]; + /* No need to print right hand side of CJK character manually. */ + if (px->a.ta_format & TF_CJK_RIGHT) + return; /* Convert Unicode to UTF-8. */ if (px->c < 0x80) { @@ -118,8 +119,8 @@ printchar(const teken_pos_t *p) bkgdset(attr | COLOR_PAIR(teken_256to8(px->a.ta_fgcolor) + 8 * teken_256to8(px->a.ta_bgcolor))); + getyx(stdscr, y, x); mvaddstr(p->tp_row, p->tp_col, str); - move(y, x); } Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/teken.h Fri Dec 20 21:31:50 2013 (r259667) @@ -41,10 +41,11 @@ typedef uint32_t teken_char_t; typedef unsigned short teken_unit_t; typedef unsigned char teken_format_t; -#define TF_BOLD 0x01 -#define TF_UNDERLINE 0x02 -#define TF_BLINK 0x04 -#define TF_REVERSE 0x08 +#define TF_BOLD 0x01 /* Bold character. */ +#define TF_UNDERLINE 0x02 /* Underline character. */ +#define TF_BLINK 0x04 /* Blinking character. */ +#define TF_REVERSE 0x08 /* Reverse rendered character. */ +#define TF_CJK_RIGHT 0x10 /* Right-hand side of CJK character. */ typedef unsigned char teken_color_t; #define TC_BLACK 0 #define TC_RED 1 Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Fri Dec 20 20:57:13 2013 (r259666) +++ head/sys/teken/teken_subr.h Fri Dec 20 21:31:50 2013 (r259667) @@ -791,21 +791,19 @@ teken_subr_do_putchar(teken_t *t, const teken_funcs_copy(t, &ctr, &ctp); } + teken_funcs_putchar(t, tp, c, &t->t_curattr); + if (width == 2 && tp->tp_col + 1 < t->t_winsize.tp_col) { teken_pos_t tp2; + teken_attr_t attr; - /* - * Store a space behind double width characters before - * actually printing them. This prevents artifacts when - * the consumer doesn't render it using double width - * glyphs. - */ + /* Print second half of CJK fullwidth character. */ tp2.tp_row = tp->tp_row; tp2.tp_col = tp->tp_col + 1; - teken_funcs_putchar(t, &tp2, BLANK, &t->t_curattr); + attr = t->t_curattr; + attr.ta_format |= TF_CJK_RIGHT; + teken_funcs_putchar(t, &tp2, c, &attr); } - - teken_funcs_putchar(t, tp, c, &t->t_curattr); } static void From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 21:38:52 2013 Return-Path: Delivered-To: svn-src-all@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 51B94324; Fri, 20 Dec 2013 21:38:52 +0000 (UTC) Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu [18.7.68.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1B21D71; Fri, 20 Dec 2013 21:38:51 +0000 (UTC) X-AuditID: 12074425-f79906d000000cf9-e8-52b4b8e4c36b Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 83.E9.03321.4E8B4B25; Fri, 20 Dec 2013 16:38:44 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id rBKLch2w018361; Fri, 20 Dec 2013 16:38:43 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBKLcfte031360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Dec 2013 16:38:42 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id rBKLceKL021585; Fri, 20 Dec 2013 16:38:40 -0500 (EST) Date: Fri, 20 Dec 2013 16:38:40 -0500 (EST) From: Benjamin Kaduk To: Neel Natu Subject: Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel In-Reply-To: Message-ID: References: <201312200550.rBK5oNmw098487@svn.freebsd.org> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsUixCmqrftkx5Ygg8btqhbHHh5lt/izbCWj xZ/2KSwWfzYtZLVo+rKAyYHVY8an+SweO2fdZQ9giuKySUnNySxLLdK3S+DK6FwtXDCfu2LX 7UesDYwPOboYOTkkBEwk+s4dZYKwxSQu3FvP1sXIxSEkMJtJYt/7LVDORkaJz2sfsUI4h5gk DvU2s0A4DYwS/funsYH0swhoS7w/c40ZxGYTUJGY+WYjUJyDQ0RASeLetmKQemaBF4wSTYfn MYLUCAv4Sxx6Nh2sl1MgUKLn5UUWEJtXwFFix7SLUKsPM0pc2fEcbKiogI7E6v1ToIoEJU7O fAJmMwtYSpz7c51tAqPgLCSpWUhSCxiZVjHKpuRW6eYmZuYUpybrFicn5uWlFula6OVmluil ppRuYgSFMruL6g7GCYeUDjEKcDAq8fBKRG4JEmJNLCuuzD3EKMnBpCTKy7oNKMSXlJ9SmZFY nBFfVJqTWnyIUYKDWUmEd94EoBxvSmJlVWpRPkxKmoNFSZz3Fod9kJBAemJJanZqakFqEUxW hoNDSYL37HagRsGi1PTUirTMnBKENBMHJ8hwHqDhl0FqeIsLEnOLM9Mh8qcYFaXEeQWAyUJI ACSRUZoH1wtLNa8YxYFeEeY9CNLOA0xTcN2vgAYzAQ02XrsJZHBJIkJKqoFxvdDCFM9V+qaq /BbJ9TofN6T4RXQatYWdupSYeDT1X87i+zO4+BIirm06XJ99z9D98YJboQwmYncXaEY9f2js 4Wu8caeZbfqLTr+SuTJ3Tb4u253Gcvwb48TF0549lTjXG3Z1wp/iCauPq//8Uh7wqnv2yfR2 Xu/Y4/qvBBOncknX2mm3iq1RYinOSDTUYi4qTgQAB4fV5RADAAA= Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 21:38:52 -0000 On Fri, 20 Dec 2013, Neel Natu wrote: > Hi Ben, > > On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk wrote: >> On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu wrote: >>> >>> Author: neel >>> Date: Fri Dec 20 05:50:22 2013 >>> New Revision: 259641 >>> URL: http://svnweb.freebsd.org/changeset/base/259641 >>> >>> Log: >>> Re-arrange bits in the amd64/pmap 'pm_flags' field. >>> >>> The least significant 8 bits of 'pm_flags' are now used for the IPI >>> vector >>> to use for nested page table TLB shootdown. >>> >>> Previously we used IPI_AST to interrupt the host cpu which is >>> functionally >>> correct but could lead to misleading interrupt counts for AST handler. >>> The >>> AST handler was also doing a lot more than what is required for the >>> nested >>> page table TLB shootdown (EOI and IRET). >> >> >> This represents a KBI change, does it not? Should __FreeBSD_version be >> bumped? >> > > I was under the impression that a bump would be required only if this > change is MFCed to a stable branch. I could be wrong about this and if > so would be happy to rectify it. I guess KBI is probably okay, that's true. I have had a lot of headaches with KPI changes on -current and third-party modules, so I am a bit sensitive. I'm also recovering from a laptop theft while on vacation, and thus a bit discombobulated. Thanks, Ben From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 23:18:15 2013 Return-Path: Delivered-To: svn-src-all@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 4795AD8F; Fri, 20 Dec 2013 23:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 332EC1337; Fri, 20 Dec 2013 23:18:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNIFPm097431; Fri, 20 Dec 2013 23:18:15 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNIFbS097430; Fri, 20 Dec 2013 23:18:15 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312202318.rBKNIFbS097430@svn.freebsd.org> From: Justin Hibbits Date: Fri, 20 Dec 2013 23:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259668 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 23:18:15 -0000 Author: jhibbits Date: Fri Dec 20 23:18:14 2013 New Revision: 259668 URL: http://svnweb.freebsd.org/changeset/base/259668 Log: Fix a couple bugs in FBT PowerPC. Clamp the size to a 'instruction size' not 'byte size', and fix a typo. MFC after: 2 weeks Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 (r259667) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 (r259668) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) (symval->value + symval->size); + limit = (u_int32_t *) (symval->value + symval->size / sizeof(u_int32_t)); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) @@ -278,7 +278,7 @@ again: instr++; for (j = 0; j < 12 && instr < limit; j++, instr++) { - if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) | + if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) || FBT_IS_JUMP(*instr)) break; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 23:34:11 2013 Return-Path: Delivered-To: svn-src-all@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 8706433D; Fri, 20 Dec 2013 23:34:11 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72E1A1486; Fri, 20 Dec 2013 23:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNYBBn005057; Fri, 20 Dec 2013 23:34:11 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNYB3i005056; Fri, 20 Dec 2013 23:34:11 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312202334.rBKNYB3i005056@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 20 Dec 2013 23:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259669 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 23:34:11 -0000 Author: jmg Date: Fri Dec 20 23:34:10 2013 New Revision: 259669 URL: http://svnweb.freebsd.org/changeset/base/259669 Log: document how to install when src is newer than the world.. This allows people to build -current systems from older systems... Thanks to: Thomas Mueller Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 20 23:18:14 2013 (r259668) +++ head/UPDATING Fri Dec 20 23:34:10 2013 (r259669) @@ -1943,7 +1943,7 @@ COMMON ITEMS: make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installworld DESTDIR=${CURRENT_ROOT} + make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT} cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 23:57:06 2013 Return-Path: Delivered-To: svn-src-all@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 06D5A7A2; Fri, 20 Dec 2013 23:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E67E815D1; Fri, 20 Dec 2013 23:57:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKNv5Qn013432; Fri, 20 Dec 2013 23:57:05 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKNv5Pn013426; Fri, 20 Dec 2013 23:57:05 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312202357.rBKNv5Pn013426@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 20 Dec 2013 23:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259670 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 23:57:06 -0000 Author: jmg Date: Fri Dec 20 23:57:05 2013 New Revision: 259670 URL: http://svnweb.freebsd.org/changeset/base/259670 Log: document the m_getjcl function... Modified: head/share/man/man9/Makefile head/share/man/man9/mbuf.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) @@ -901,6 +901,7 @@ MLINKS+=\ mbuf.9 m_freem.9 \ mbuf.9 MGET.9 \ mbuf.9 m_get.9 \ + mbuf.9 m_getjcl.9 \ mbuf.9 m_getcl.9 \ mbuf.9 m_getclr.9 \ mbuf.9 MGETHDR.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) @@ -74,6 +74,8 @@ .Ft struct mbuf * .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" .Ft struct mbuf * +.Fn m_getjcl "int how" "short type" "int flags" "int size" +.Ft struct mbuf * .Fn m_getcl "int how" "short type" "int flags" .Ft struct mbuf * .Fn m_getclr "int how" "int type" @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ Returns .Dv NULL on failure. +.It Fn m_getjcl how type flags size +This is like +.Fn m_getcl +but it the size of the cluster allocated will be large enough for +.Fa size +bytes. .It Fn m_getclr how type Allocate an .Vt mbuf From owner-svn-src-all@FreeBSD.ORG Fri Dec 20 23:59:32 2013 Return-Path: Delivered-To: svn-src-all@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 792CB90B; Fri, 20 Dec 2013 23:59:32 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33CB915E1; Fri, 20 Dec 2013 23:59:32 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id BF5BB2138D; Fri, 20 Dec 2013 23:59:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us BF5BB2138D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 20 Dec 2013 18:59:29 -0500 From: Glen Barber To: John-Mark Gurney Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131220235929.GE3148@glenbarber.us> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EXKGNeO8l0xGFBjy" Content-Disposition: inline In-Reply-To: <201312202357.rBKNv5Pn013426@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 23:59:32 -0000 --EXKGNeO8l0xGFBjy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2013 at 11:57:05PM +0000, John-Mark Gurney wrote: > Author: jmg > Date: Fri Dec 20 23:57:05 2013 > New Revision: 259670 > URL: http://svnweb.freebsd.org/changeset/base/259670 >=20 > Log: > document the m_getjcl function... >=20 > Modified: > head/share/man/man9/Makefile > head/share/man/man9/mbuf.9 >=20 > Modified: head/share/man/man9/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) > +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) > @@ -901,6 +901,7 @@ MLINKS+=3D\ > mbuf.9 m_freem.9 \ > mbuf.9 MGET.9 \ > mbuf.9 m_get.9 \ > + mbuf.9 m_getjcl.9 \ > mbuf.9 m_getcl.9 \ > mbuf.9 m_getclr.9 \ > mbuf.9 MGETHDR.9 \ >=20 > Modified: head/share/man/man9/mbuf.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) > +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) > @@ -74,6 +74,8 @@ > .Ft struct mbuf * > .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" > .Ft struct mbuf * > +.Fn m_getjcl "int how" "short type" "int flags" "int size" > +.Ft struct mbuf * > .Fn m_getcl "int how" "short type" "int flags" > .Ft struct mbuf * > .Fn m_getclr "int how" "int type" > @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ > Returns > .Dv NULL > on failure. > +.It Fn m_getjcl how type flags size > +This is like > +.Fn m_getcl > +but it the size of the cluster allocated will be large enough for > +.Fa size > +bytes. > .It Fn m_getclr how type > Allocate an > .Vt mbuf Please bump .Dd. Glen --EXKGNeO8l0xGFBjy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJStNngAAoJELls3eqvi17QWnEP/3d/Roik1y1y1Sij0uheiWL9 PMkNBqdIS21LrNqCkt9pY0HvDNlu/HyJ/gtCjHX4OEqmRIThqauv65Ul6EW7sfOQ Qc6ZdhRKPYmGg/iJ78pYjtXj3WpVs2OQZmTQhPdP55Zgro780uX9uy0nFfbyrBNv UOnrelRS4O/I9Twlc7FVhctwWlKDOKVCN8y63/T2qqvzrKVrEYiquZRhXtdMjlQe L+Vo+jldQvHtcgw1OL6Y67mwP437YSBp/f73f8uU1c16cMaDnxu2T2nbLLXDE/8a K8/akImC0AzJC3De9eFbcfBAM3yXZMetiRqvlX9IUO30XchVNF5FvKOq2XtFs5lN QB3R5s3byxU32tHIpMuT3tSAKabZlfoRNpTAej7ef6odyX4NJTBVrWBTIJBKnVAI 86ripb9whkuxfQV9KaYOSbe3wMOhcnJ11hrj1q1a/p8t2k/G+8pJjVabYkz/uMEC NhqhcRLEZSsijxwhUGstDP4dOINHr1wKt9lDk15JGZ1KxY3g+XBQuPctAEMNl23N I3cWFRxRDw4jwD/KOOhuTNDn2/tZ0CyB/OeijMc+PzFRx56LiMjjvSwiFrAUeWlN X8EjvTolJzlQ8vwXIwGWVx/1YOCEOvGpG/7ldOdcClQlhaBOz7xsbNYs8n+7ThuR EWyxNIYCWASUvih3V8ac =rG4w -----END PGP SIGNATURE----- --EXKGNeO8l0xGFBjy-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:07:58 2013 Return-Path: Delivered-To: svn-src-all@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 F076FBE4; Sat, 21 Dec 2013 00:07:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB954165E; Sat, 21 Dec 2013 00:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL07vQR018847; Sat, 21 Dec 2013 00:07:57 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL07vj2018843; Sat, 21 Dec 2013 00:07:57 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210007.rBL07vj2018843@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 00:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259671 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:07:58 -0000 Author: jhibbits Date: Sat Dec 21 00:07:56 2013 New Revision: 259671 URL: http://svnweb.freebsd.org/changeset/base/259671 Log: Add suspend/resume to DBDMA and ATA on PowerMacs. This, and several subsequent commits, are suspend/resume for various PowerMac drivers, which will include a change to the global suspend/resume code eventually. Modified: head/sys/powerpc/powermac/ata_macio.c head/sys/powerpc/powermac/dbdma.c head/sys/powerpc/powermac/dbdmavar.h Modified: head/sys/powerpc/powermac/ata_macio.c ============================================================================== --- head/sys/powerpc/powermac/ata_macio.c Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/ata_macio.c Sat Dec 21 00:07:56 2013 (r259671) @@ -114,11 +114,15 @@ static int ata_macio_probe(device_t de static int ata_macio_setmode(device_t dev, int target, int mode); static int ata_macio_attach(device_t dev); static int ata_macio_begin_transaction(struct ata_request *request); +static int ata_macio_suspend(device_t dev); +static int ata_macio_resume(device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_macio_attach), + DEVMETHOD(device_suspend, ata_macio_suspend), + DEVMETHOD(device_resume, ata_macio_resume), /* ATA interface */ DEVMETHOD(ata_setmode, ata_macio_setmode), @@ -336,3 +340,34 @@ ata_macio_begin_transaction(struct ata_r return ata_begin_transaction(request); } + +static int +ata_macio_suspend(device_t dev) +{ + struct ata_dbdma_channel *ch = device_get_softc(dev); + int error; + + if (!ch->sc_ch.attached) + return (0); + + error = ata_suspend(dev); + dbdma_save_state(ch->dbdma); + + return (error); +} + +static int +ata_macio_resume(device_t dev) +{ + struct ata_dbdma_channel *ch = device_get_softc(dev); + int error; + + if (!ch->sc_ch.attached) + return (0); + + dbdma_restore_state(ch->dbdma); + error = ata_resume(dev); + + return (error); +} + Modified: head/sys/powerpc/powermac/dbdma.c ============================================================================== --- head/sys/powerpc/powermac/dbdma.c Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/dbdma.c Sat Dec 21 00:07:56 2013 (r259671) @@ -343,6 +343,31 @@ dbdma_sync_commands(dbdma_channel_t *cha bus_dmamap_sync(chan->sc_dmatag, chan->sc_dmamap, op); } +void +dbdma_save_state(dbdma_channel_t *chan) +{ + + chan->sc_saved_regs[0] = dbdma_read_reg(chan, CHAN_CMDPTR); + chan->sc_saved_regs[1] = dbdma_read_reg(chan, CHAN_CMDPTR_HI); + chan->sc_saved_regs[2] = dbdma_read_reg(chan, CHAN_INTR_SELECT); + chan->sc_saved_regs[3] = dbdma_read_reg(chan, CHAN_BRANCH_SELECT); + chan->sc_saved_regs[4] = dbdma_read_reg(chan, CHAN_WAIT_SELECT); + + dbdma_stop(chan); +} + +void +dbdma_restore_state(dbdma_channel_t *chan) +{ + + dbdma_wake(chan); + dbdma_write_reg(chan, CHAN_CMDPTR, chan->sc_saved_regs[0]); + dbdma_write_reg(chan, CHAN_CMDPTR_HI, chan->sc_saved_regs[1]); + dbdma_write_reg(chan, CHAN_INTR_SELECT, chan->sc_saved_regs[2]); + dbdma_write_reg(chan, CHAN_BRANCH_SELECT, chan->sc_saved_regs[3]); + dbdma_write_reg(chan, CHAN_WAIT_SELECT, chan->sc_saved_regs[4]); +} + static uint32_t dbdma_read_reg(dbdma_channel_t *chan, u_int offset) { Modified: head/sys/powerpc/powermac/dbdmavar.h ============================================================================== --- head/sys/powerpc/powermac/dbdmavar.h Fri Dec 20 23:57:05 2013 (r259670) +++ head/sys/powerpc/powermac/dbdmavar.h Sat Dec 21 00:07:56 2013 (r259671) @@ -60,6 +60,7 @@ struct dbdma_channel { bus_dma_tag_t sc_dmatag; bus_dmamap_t sc_dmamap; + uint32_t sc_saved_regs[5]; }; From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:15:37 2013 Return-Path: Delivered-To: svn-src-all@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 BEB8CD7C; Sat, 21 Dec 2013 00:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9091C16D1; Sat, 21 Dec 2013 00:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL0FbSi022829; Sat, 21 Dec 2013 00:15:37 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL0FbZQ022828; Sat, 21 Dec 2013 00:15:37 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201312210015.rBL0FbZQ022828@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 21 Dec 2013 00:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259672 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:15:37 -0000 Author: jmg Date: Sat Dec 21 00:15:37 2013 New Revision: 259672 URL: http://svnweb.freebsd.org/changeset/base/259672 Log: bump Dd Reminded by: gjb Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Sat Dec 21 00:07:56 2013 (r259671) +++ head/share/man/man9/mbuf.9 Sat Dec 21 00:15:37 2013 (r259672) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd December 20, 2013 .Dt MBUF 9 .Os .\" From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:15:59 2013 Return-Path: Delivered-To: svn-src-all@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 70C42EB9; Sat, 21 Dec 2013 00:15:59 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32A0A16D5; Sat, 21 Dec 2013 00:15:58 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rBL0Fvlf069934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Dec 2013 16:15:58 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rBL0FvfE069933; Fri, 20 Dec 2013 16:15:57 -0800 (PST) (envelope-from jmg) Date: Fri, 20 Dec 2013 16:15:57 -0800 From: John-Mark Gurney To: Glen Barber Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131221001557.GA99167@funkthat.com> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> <20131220235929.GE3148@glenbarber.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131220235929.GE3148@glenbarber.us> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 20 Dec 2013 16:15:58 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:15:59 -0000 Glen Barber wrote this message on Fri, Dec 20, 2013 at 18:59 -0500: > On Fri, Dec 20, 2013 at 11:57:05PM +0000, John-Mark Gurney wrote: > > Author: jmg > > Date: Fri Dec 20 23:57:05 2013 > > New Revision: 259670 > > URL: http://svnweb.freebsd.org/changeset/base/259670 > > > > Log: > > document the m_getjcl function... > > > > Modified: > > head/share/man/man9/Makefile > > head/share/man/man9/mbuf.9 > > > > Modified: head/share/man/man9/Makefile > > ============================================================================== > > --- head/share/man/man9/Makefile Fri Dec 20 23:34:10 2013 (r259669) > > +++ head/share/man/man9/Makefile Fri Dec 20 23:57:05 2013 (r259670) > > @@ -901,6 +901,7 @@ MLINKS+=\ > > mbuf.9 m_freem.9 \ > > mbuf.9 MGET.9 \ > > mbuf.9 m_get.9 \ > > + mbuf.9 m_getjcl.9 \ > > mbuf.9 m_getcl.9 \ > > mbuf.9 m_getclr.9 \ > > mbuf.9 MGETHDR.9 \ > > > > Modified: head/share/man/man9/mbuf.9 > > ============================================================================== > > --- head/share/man/man9/mbuf.9 Fri Dec 20 23:34:10 2013 (r259669) > > +++ head/share/man/man9/mbuf.9 Fri Dec 20 23:57:05 2013 (r259670) > > @@ -74,6 +74,8 @@ > > .Ft struct mbuf * > > .Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" > > .Ft struct mbuf * > > +.Fn m_getjcl "int how" "short type" "int flags" "int size" > > +.Ft struct mbuf * > > .Fn m_getcl "int how" "short type" "int flags" > > .Ft struct mbuf * > > .Fn m_getclr "int how" "int type" > > @@ -592,6 +594,12 @@ together, as it avoids having to unlock/ > > Returns > > .Dv NULL > > on failure. > > +.It Fn m_getjcl how type flags size > > +This is like > > +.Fn m_getcl > > +but it the size of the cluster allocated will be large enough for > > +.Fa size > > +bytes. > > .It Fn m_getclr how type > > Allocate an > > .Vt mbuf > > Please bump .Dd. Sorry, done in r259672. Thanks for the reminder. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:19:28 2013 Return-Path: Delivered-To: svn-src-all@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 34FC918F; Sat, 21 Dec 2013 00:19:28 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0558316F3; Sat, 21 Dec 2013 00:19:27 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 26AB82158E; Sat, 21 Dec 2013 00:19:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 26AB82158E Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 20 Dec 2013 19:19:24 -0500 From: Glen Barber To: John-Mark Gurney Subject: Re: svn commit: r259670 - head/share/man/man9 Message-ID: <20131221001924.GF3148@glenbarber.us> References: <201312202357.rBKNv5Pn013426@svn.freebsd.org> <20131220235929.GE3148@glenbarber.us> <20131221001557.GA99167@funkthat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oPmsXEqKQNHCSXW7" Content-Disposition: inline In-Reply-To: <20131221001557.GA99167@funkthat.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:19:28 -0000 --oPmsXEqKQNHCSXW7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 20, 2013 at 04:15:57PM -0800, John-Mark Gurney wrote: > > Please bump .Dd. >=20 > Sorry, done in r259672. >=20 > Thanks for the reminder. >=20 Thank you. Glen --oPmsXEqKQNHCSXW7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJStN6MAAoJELls3eqvi17QF3sP/i7y5ZWRnKWNcZadwG8o4yXQ vQwxVQsNMWCE5jk0ym3ff1RVUnHau8KuzHABGbpehzQRCIcnPBj6sOMF/RiZ6UZM Wez7v7iBiqaZJmapTusa6nUaMt55EQya+HyKDetMuV9vs0dQBu0BX8WX7KhiuHDk /3qkruXnCuZoycxGFP3emdKQmHiaYxi1nEVLl+ybImK+fZYU9rUzkO88ojhmH1MY epnrPRpi5YFzdDbgZVo9cTuxmi6TOV5EK7NjlELN/ZnRrnUohDIY+ZevfL14vhTN umHqFm8QFHz3UZ6rPkxq/D/1+wluzKs7d2H4s8L/UxhMKXzlCyzn74mTWH1olcQC dt57r+6bpki3glHaUPo5xeRnA/MISXxy2tu73m67v7YkFCN4BSEons0i6xIw8+0P aLCJ3Bb5yHVHTm8Axh0KYN7KTEWREPxf82HrpQEzfE8yuRKM0FqcVtC2rfX8765r +krRiiMnxQbIkBuOin8qPPOKOxGUFDtx5oK6n1bUIXkNDHwT6Bm5Wtb08RjTIrN9 +CC1XGlh8uJSDNVCHSYWd7Q6H/ul2Ansa3duhphk5EsSA1wmwl8MwneErtWLPdR2 BEQo3ALgJA9Q/G/PNZFl5powVORuIE69WRgGQS+kt5VlEmBwhaP5fLiag6zKsrzN w/tRRBWYIJ8/XExvWC2F =zNS1 -----END PGP SIGNATURE----- --oPmsXEqKQNHCSXW7-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:20:07 2013 Return-Path: Delivered-To: svn-src-all@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 1447B2D0; Sat, 21 Dec 2013 00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE79216F9; Sat, 21 Dec 2013 00:20:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL0K6f2025546; Sat, 21 Dec 2013 00:20:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL0K6Kp025545; Sat, 21 Dec 2013 00:20:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312210020.rBL0K6Kp025545@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 00:20: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: r259673 - stable/9/tools/build/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:20:07 -0000 Author: gjb Date: Sat Dec 21 00:20:06 2013 New Revision: 259673 URL: http://svnweb.freebsd.org/changeset/base/259673 Log: Honor WITHOUT_SYSINSTALL=1. This is a direct commit to stable/9. PR: 176263 Submitted by: Sayetsky Anton (vsjcfm gmail com) Sponsored by: The FreeBSD Foundation Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 00:15:37 2013 (r259672) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 00:20:06 2013 (r259673) @@ -3124,6 +3124,21 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif +.if ${MK_SYSINSTALL} == no +OLD_FILES+=usr/sbin/sysinstall +OLD_FILES+=usr/share/man/man8/sysinstall.8.gz +OLD_FILES+=usr/lib/libftpio.a +OLD_FILES+=usr/lib/libftpio.so +OLD_LIBS+=usr/lib/libftpio.so.8 +OLD_FILES+=usr/lib/libftpio_p.a +OLD_FILES+=usr/lib32/libftpio.a +OLD_FILES+=usr/lib32/libftpio.so +OLD_LIBS+=usr/lib32/libftpio.so.8 +OLD_FILES+=usr/lib32/libftpio_p.a +OLD_FILES+=usr/include/ftpio.h +OLD_FILES+=usr/share/man/man3/ftpio.3.gz +.endif + .if ${MK_PC_SYSINSTALL} == no # backend-partmanager OLD_FILES+=usr/share/pc-sysinstall/backend-partmanager/create-part.sh From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:31:02 2013 Return-Path: Delivered-To: svn-src-all@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 95B2D677; Sat, 21 Dec 2013 00:31:02 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E11A17D4; Sat, 21 Dec 2013 00:31:02 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id e9so2873296qcy.6 for ; Fri, 20 Dec 2013 16:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LdisjTC1n5NPwS1gKFB0ZQ1SB1ouS85IyN61pxQTvyc=; b=Vnd9c09qsAGSUNTM2veH4dGgYy0m40klYKXth/6vgAuhX9Oge9KaXiQhlsmTU0WOy3 kKSKDVLeIy2h+hwiyioWOuIxy2k0/mgceBVDXDC6ZRC20hvO+keH6MwOUEnVTh9x9OJQ urlR6GLLFs8bLMi2/9U5JxYKChrquysOTA/FOUvqqrdFanbkViABeF1ufj/osYNrfmev gSRDuX92T5hoaPd6fIYyCARfgKY53sCvpDl/xsbXZuP85V9KVKDcDvI0Vto9wpdzp7kD rSo9zyfsscT9bzFqcoGn3vdSJo72b+JWJWk4RPfRW7FoBbMC6it5n+APtVJb6LfNIsdi yGMg== MIME-Version: 1.0 X-Received: by 10.224.135.71 with SMTP id m7mr19777048qat.10.1387585861172; Fri, 20 Dec 2013 16:31:01 -0800 (PST) Received: by 10.224.130.194 with HTTP; Fri, 20 Dec 2013 16:31:01 -0800 (PST) In-Reply-To: <201312202318.rBKNIFbS097430@svn.freebsd.org> References: <201312202318.rBKNIFbS097430@svn.freebsd.org> Date: Sat, 21 Dec 2013 08:31:01 +0800 Message-ID: Subject: Re: svn commit: r259668 - head/sys/cddl/dev/fbt From: Howard Su To: Justin Hibbits Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:31:02 -0000 On Saturday, December 21, 2013, Justin Hibbits wrote: > Author: jhibbits > Date: Fri Dec 20 23:18:14 2013 > New Revision: 259668 > URL: http://svnweb.freebsd.org/changeset/base/259668 > > Log: > Fix a couple bugs in FBT PowerPC. Clamp the size to a 'instruction > size' not > 'byte size', and fix a typo. > > MFC after: 2 weeks > > Modified: > head/sys/cddl/dev/fbt/fbt_powerpc.c > > Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c > > ============================================================================== > --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 > (r259667) > +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 > (r259668) > @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ > return (0); > > instr = (u_int32_t *) symval->value; > - limit = (u_int32_t *) (symval->value + symval->size); > + limit = (u_int32_t *) (symval->value + symval->size / > sizeof(u_int32_t)); > > This change doesn't look right to me. symval->value is caddr_t (char*). why add instruction size to it? > for (; instr < limit; instr++) > if (*instr == FBT_MFLR_R0) > @@ -278,7 +278,7 @@ again: > instr++; > > for (j = 0; j < 12 && instr < limit; j++, instr++) { > - if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) | > + if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) || > FBT_IS_JUMP(*instr)) > break; > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > -- -Howard From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:37:32 2013 Return-Path: Delivered-To: svn-src-all@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 A455D8D8; Sat, 21 Dec 2013 00:37:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FFEC181D; Sat, 21 Dec 2013 00:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL0bWpo031503; Sat, 21 Dec 2013 00:37:32 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL0bW8I031502; Sat, 21 Dec 2013 00:37:32 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210037.rBL0bW8I031502@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 00:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259674 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:37:32 -0000 Author: jhibbits Date: Sat Dec 21 00:37:32 2013 New Revision: 259674 URL: http://svnweb.freebsd.org/changeset/base/259674 Log: Fix a brain-o. I had misread the limit as a size, but it's a pointer. Submitted by: Howard Su MFC after: 2 weeks X-MFC-with: r259668 Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:20:06 2013 (r259673) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:37:32 2013 (r259674) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) (symval->value + symval->size / sizeof(u_int32_t)); + limit = (u_int32_t *) (symval->value + symval->size); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 00:37:51 2013 Return-Path: Delivered-To: svn-src-all@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 BBF45A19; Sat, 21 Dec 2013 00:37:51 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDB11825; Sat, 21 Dec 2013 00:37:51 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id bj1so3288267pad.16 for ; Fri, 20 Dec 2013 16:37:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5putG4odMXujIhmJ3KJEwVawrSzkVldsYwpcHPdhFLk=; b=RL5kDK21UgjO7LoovuYlmv4wRkxWSAbdTe2GFUiaL6KhRe742IAj1dy56h9f8xxorr dWUzFGRFN8xa8dmYizaECDMOLfWF95QLiDkSxfFWOqerjG0B6tbXstYAEkV6+1ZRRrXB 2+DYI+KvG9+HImy1iYYzzjYjIqZDla6k+D4Aei+iNdYCaQPxLDCxxm912Ung8EVX01yb b2OMWb5AkLZTutoxFfhP6+xzu7ID79+FuSGl9yAjl8R8hiRI+E2h/iCUfG5JrtR6Whhj d7bPo5+LZF4BSt/0DMQC87KiYjALxOiKOAmBWwfb+yeapKHm9bayWMiHG9FqPy3Pdw1O Cw8A== X-Received: by 10.68.129.99 with SMTP id nv3mr12057358pbb.40.1387586271039; Fri, 20 Dec 2013 16:37:51 -0800 (PST) Received: from zhabar.gateway.2wire.net (76-253-2-5.lightspeed.sntcca.sbcglobal.net. [76.253.2.5]) by mx.google.com with ESMTPSA id pe3sm17143495pbc.23.2013.12.20.16.37.49 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 20 Dec 2013 16:37:50 -0800 (PST) Date: Fri, 20 Dec 2013 16:37:45 -0800 From: Justin Hibbits To: Howard Su Subject: Re: svn commit: r259668 - head/sys/cddl/dev/fbt Message-ID: <20131220163745.479cb59d@zhabar.gateway.2wire.net> In-Reply-To: References: <201312202318.rBKNIFbS097430@svn.freebsd.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; powerpc64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Justin Hibbits , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 00:37:51 -0000 On Sat, 21 Dec 2013 08:31:01 +0800 Howard Su wrote: > On Saturday, December 21, 2013, Justin Hibbits wrote: > > > Author: jhibbits > > Date: Fri Dec 20 23:18:14 2013 > > New Revision: 259668 > > URL: http://svnweb.freebsd.org/changeset/base/259668 > > > > Log: > > Fix a couple bugs in FBT PowerPC. Clamp the size to a > > 'instruction size' not > > 'byte size', and fix a typo. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/cddl/dev/fbt/fbt_powerpc.c > > > > Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c > > > > ============================================================================== > > --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013 > > (r259667) > > +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013 > > (r259668) > > @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ > > return (0); > > > > instr = (u_int32_t *) symval->value; > > - limit = (u_int32_t *) (symval->value + symval->size); > > + limit = (u_int32_t *) (symval->value + symval->size / > > sizeof(u_int32_t)); > > > > This change doesn't look right to me. symval->value is caddr_t > > (char*). > why add instruction size to it? D'oh, complete brain-o. I had read it as a size field, not a pointer field. Fixed now. - Justin From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 03:05:14 2013 Return-Path: Delivered-To: svn-src-all@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 4E2BCC11; Sat, 21 Dec 2013 03:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD3510CE; Sat, 21 Dec 2013 03:05:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL35ENI093694; Sat, 21 Dec 2013 03:05:14 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL35DS7093692; Sat, 21 Dec 2013 03:05:13 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201312210305.rBL35DS7093692@svn.freebsd.org> From: Don Lewis Date: Sat, 21 Dec 2013 03:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259675 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 03:05:14 -0000 Author: truckman Date: Sat Dec 21 03:05:13 2013 New Revision: 259675 URL: http://svnweb.freebsd.org/changeset/base/259675 Log: Add quirks to make my old SanDisk Cruzer Mini 128MB happy. MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sat Dec 21 00:37:32 2013 (r259674) +++ head/sys/dev/usb/quirk/usb_quirk.c Sat Dec 21 03:05:13 2013 (r259675) @@ -332,6 +332,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(SANDISK, SDDR12, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(SANDISK, SDCZ2_128, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE, + UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(SANDISK, SDCZ2_256, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(SANDISK, SDCZ4_128, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Dec 21 00:37:32 2013 (r259674) +++ head/sys/dev/usb/usbdevs Sat Dec 21 03:05:13 2013 (r259675) @@ -3718,6 +3718,7 @@ product SANDISK SDDR05 0x0005 ImageMate product SANDISK SDDR12 0x0100 ImageMate SDDR-12 product SANDISK SDDR09 0x0200 ImageMate SDDR-09 product SANDISK SDDR75 0x0810 ImageMate SDDR-75 +product SANDISK SDCZ2_128 0x7100 Cruzer Mini 128MB product SANDISK SDCZ2_256 0x7104 Cruzer Mini 256MB product SANDISK SDCZ4_128 0x7112 Cruzer Micro 128MB product SANDISK SDCZ4_256 0x7113 Cruzer Micro 256MB From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 04:31:56 2013 Return-Path: Delivered-To: svn-src-all@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 0F2C674A; Sat, 21 Dec 2013 04:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE3BA167E; Sat, 21 Dec 2013 04:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBL4Vtc8030895; Sat, 21 Dec 2013 04:31:55 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBL4VsoZ030885; Sat, 21 Dec 2013 04:31:54 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312210431.rBL4VsoZ030885@svn.freebsd.org> From: Justin Hibbits Date: Sat, 21 Dec 2013 04:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259676 - in head/sys/powerpc: include ofw powermac powerpc psim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 04:31:56 -0000 Author: jhibbits Date: Sat Dec 21 04:31:54 2013 New Revision: 259676 URL: http://svnweb.freebsd.org/changeset/base/259676 Log: Add suspend/resume state saving for OpenPIC on PowerMac. It's likely this can be used on the others (cpcht and psim), but that has not been tested. Modified: head/sys/powerpc/include/openpicreg.h head/sys/powerpc/include/openpicvar.h head/sys/powerpc/ofw/openpic_ofw.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/psim/openpic_iobus.c Modified: head/sys/powerpc/include/openpicreg.h ============================================================================== --- head/sys/powerpc/include/openpicreg.h Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/include/openpicreg.h Sat Dec 21 04:31:54 2013 (r259676) @@ -99,6 +99,7 @@ */ /* interrupt vector/priority reg */ +#define OPENPIC_SRC_VECTOR_COUNT 64 #ifndef OPENPIC_SRC_VECTOR #define OPENPIC_SRC_VECTOR(irq) (0x10000 + (irq) * 0x20) #endif Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/include/openpicvar.h Sat Dec 21 04:31:54 2013 (r259676) @@ -32,6 +32,14 @@ #define OPENPIC_IRQMAX 256 /* h/w allows more */ +/* Names match the macros in openpicreg.h. */ +struct openpic_timer { + uint32_t tcnt; + uint32_t tbase; + uint32_t tvec; + uint32_t tdst; +}; + struct openpic_softc { device_t sc_dev; struct resource *sc_memr; @@ -45,6 +53,14 @@ struct openpic_softc { u_int sc_ncpu; u_int sc_nirq; int sc_psim; + + /* Saved states. */ + uint32_t sc_saved_config; + uint32_t sc_saved_ipis[4]; + uint32_t sc_saved_prios[4]; + struct openpic_timer sc_saved_timers[OPENPIC_TIMERS]; + uint32_t sc_saved_vectors[OPENPIC_SRC_VECTOR_COUNT]; + }; extern devclass_t openpic_devclass; @@ -66,4 +82,7 @@ void openpic_ipi(device_t, u_int); void openpic_mask(device_t, u_int); void openpic_unmask(device_t, u_int); +int openpic_suspend(device_t dev); +int openpic_resume(device_t dev); + #endif /* _POWERPC_OPENPICVAR_H_ */ Modified: head/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- head/sys/powerpc/ofw/openpic_ofw.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/ofw/openpic_ofw.c Sat Dec 21 04:31:54 2013 (r259676) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "pic_if.h" @@ -68,6 +69,8 @@ static device_method_t openpic_ofw_meth /* Device interface */ DEVMETHOD(device_probe, openpic_ofw_probe), DEVMETHOD(device_attach, openpic_ofw_attach), + DEVMETHOD(device_suspend, openpic_suspend), + DEVMETHOD(device_resume, openpic_resume), /* PIC interface */ DEVMETHOD(pic_bind, openpic_bind), Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/powermac/cpcht.c Sat Dec 21 04:31:54 2013 (r259676) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/powerpc/openpic.c Sat Dec 21 04:31:54 2013 (r259676) @@ -380,3 +380,64 @@ openpic_unmask(device_t dev, u_int irq) openpic_write(sc, OPENPIC_IPI_VECTOR(0), x); } } + +int +openpic_suspend(device_t dev) +{ + struct openpic_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); + for (i = 0; i < 4; i++) { + sc->sc_saved_ipis[i] = bus_read_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i)); + } + + for (i = 0; i < 4; i++) { + sc->sc_saved_prios[i] = bus_read_4(sc->sc_memr, OPENPIC_PCPU_TPR(i)); + } + + for (i = 0; i < OPENPIC_TIMERS; i++) { + sc->sc_saved_timers[i].tcnt = bus_read_4(sc->sc_memr, OPENPIC_TCNT(i)); + sc->sc_saved_timers[i].tbase = bus_read_4(sc->sc_memr, OPENPIC_TBASE(i)); + sc->sc_saved_timers[i].tvec = bus_read_4(sc->sc_memr, OPENPIC_TVEC(i)); + sc->sc_saved_timers[i].tdst = bus_read_4(sc->sc_memr, OPENPIC_TDST(i)); + } + + for (i = 0; i < OPENPIC_SRC_VECTOR_COUNT; i++) + sc->sc_saved_vectors[i] = + bus_read_4(sc->sc_memr, OPENPIC_SRC_VECTOR(i)) & ~OPENPIC_ACTIVITY; + + return (0); +} + +int +openpic_resume(device_t dev) +{ + struct openpic_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); + for (i = 0; i < 4; i++) { + bus_write_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i), sc->sc_saved_ipis[i]); + } + + for (i = 0; i < 4; i++) { + bus_write_4(sc->sc_memr, OPENPIC_PCPU_TPR(i), sc->sc_saved_prios[i]); + } + + for (i = 0; i < OPENPIC_TIMERS; i++) { + bus_write_4(sc->sc_memr, OPENPIC_TCNT(i), sc->sc_saved_timers[i].tcnt); + bus_write_4(sc->sc_memr, OPENPIC_TBASE(i), sc->sc_saved_timers[i].tbase); + bus_write_4(sc->sc_memr, OPENPIC_TVEC(i), sc->sc_saved_timers[i].tvec); + bus_write_4(sc->sc_memr, OPENPIC_TDST(i), sc->sc_saved_timers[i].tdst); + } + + for (i = 0; i < OPENPIC_SRC_VECTOR_COUNT; i++) + bus_write_4(sc->sc_memr, OPENPIC_SRC_VECTOR(i), sc->sc_saved_vectors[i]); + + return (0); +} Modified: head/sys/powerpc/psim/openpic_iobus.c ============================================================================== --- head/sys/powerpc/psim/openpic_iobus.c Sat Dec 21 03:05:13 2013 (r259675) +++ head/sys/powerpc/psim/openpic_iobus.c Sat Dec 21 04:31:54 2013 (r259676) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 07:09:19 2013 Return-Path: Delivered-To: svn-src-all@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 CACBE26C; Sat, 21 Dec 2013 07:09:19 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD0DB1EDF; Sat, 21 Dec 2013 07:09:19 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.7/8.14.7) with ESMTP id rBL79784057651; Fri, 20 Dec 2013 23:09:07 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.7/8.14.7/Submit) id rBL797JA057650; Fri, 20 Dec 2013 23:09:07 -0800 (PST) (envelope-from sgk) Date: Fri, 20 Dec 2013 23:09:07 -0800 From: Steve Kargl To: Alexander Motin Subject: Re: svn commit: r259659 - in head/sys: nfs rpc Message-ID: <20131221070907.GA57639@troutmask.apl.washington.edu> References: <201312201739.rBKHd73M059252@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312201739.rBKHd73M059252@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 07:09:20 -0000 On Fri, Dec 20, 2013 at 05:39:07PM +0000, Alexander Motin wrote: > Author: mav > Date: Fri Dec 20 17:39:07 2013 > New Revision: 259659 > URL: http://svnweb.freebsd.org/changeset/base/259659 > > Log: > Remove several linear list traversals per request from RPC server code. > > Do not insert active ports into pool->sp_active list if they are success- > fully assigned to some thread. This makes that list include only ports that > really require attention, and so traversal can be reduced to simple taking > the first one. > > Remove idle thread from pool->sp_idlethreads list when assigning some > work (port of requests) to it. That again makes possible to replace list > traversals with simple taking the first element. > > Modified: > head/sys/nfs/nfs_fha.c > head/sys/rpc/svc.c > head/sys/rpc/svc.h FYI. cc -c -O -pipe -march=core2 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -Werror /usr/src/sys/rpc/svc.c /usr/src/sys/rpc/svc.c:296:20: error: no member named 'xp_mlock' in 'struct __rpc_svcxprt'; did you mean 'xp_lock'? mtx_assert(&xprt->xp_mlock, MA_OWNED); ^ /usr/src/sys/sys/mutex.h:379:15: note: expanded from macro 'mtx_assert' mtx_assert_((m), (what), __FILE__, __LINE__) ^ /usr/src/sys/sys/mutex.h:359:15: note: expanded from macro 'mtx_assert_' _mtx_assert((m), (what), (file), (line)) ^ /usr/src/sys/sys/mutex.h:158:17: note: expanded from macro '_mtx_assert' __mtx_assert(&(m)->mtx_lock, w, f, l) ^ /usr/src/sys/rpc/svc.h:149:12: note: 'xp_lock' declared here struct sx xp_lock; ^ /usr/src/sys/rpc/svc.c:296:2: error: no member named 'mtx_lock' in 'struct sx'; did you mean 'sx_lock'? mtx_assert(&xprt->xp_mlock, MA_OWNED); ^ /usr/src/sys/sys/mutex.h:379:2: note: expanded from macro 'mtx_assert' mtx_assert_((m), (what), __FILE__, __LINE__) ^ /usr/src/sys/sys/mutex.h:359:2: note: expanded from macro 'mtx_assert_' _mtx_assert((m), (what), (file), (line)) ^ /usr/src/sys/sys/mutex.h:158:21: note: expanded from macro '_mtx_assert' __mtx_assert(&(m)->mtx_lock, w, f, l) ^ /usr/src/sys/sys/_sx.h:39:21: note: 'sx_lock' declared here volatile uintptr_t sx_lock; -- steve From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 11:59:59 2013 Return-Path: Delivered-To: svn-src-all@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 8086AE7A; Sat, 21 Dec 2013 11:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 676961001; Sat, 21 Dec 2013 11:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLBxxhu011771; Sat, 21 Dec 2013 11:59:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLBxxOE011770; Sat, 21 Dec 2013 11:59:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201312211159.rBLBxxOE011770@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 21 Dec 2013 11:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259677 - head/sbin/swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 11:59:59 -0000 Author: jilles Date: Sat Dec 21 11:59:58 2013 New Revision: 259677 URL: http://svnweb.freebsd.org/changeset/base/259677 Log: swapon: Fix buffer overflow when configuring encrypted swap on GBDE. PR: bin/184950 Tested by: Radim Kolar MFC after: 3 days Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Dec 21 04:31:54 2013 (r259676) +++ head/sbin/swapon/swapon.c Sat Dec 21 11:59:58 2013 (r259677) @@ -266,7 +266,8 @@ static const char * swap_on_off_gbde(const char *name, int doingall) { const char *ret; - char pass[64 * 2 + 1], bpass[64]; + char pass[64 * 2 + 1]; + unsigned char bpass[64]; char *dname; int i, error; From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 12:45:36 2013 Return-Path: Delivered-To: svn-src-all@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 43FA73B5; Sat, 21 Dec 2013 12:45:36 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3040E1284; Sat, 21 Dec 2013 12:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLCja7o029359; Sat, 21 Dec 2013 12:45:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLCjaXQ029358; Sat, 21 Dec 2013 12:45:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211245.rBLCjaXQ029358@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 12:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259678 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 12:45:36 -0000 Author: gjb Date: Sat Dec 21 12:45:35 2013 New Revision: 259678 URL: http://svnweb.freebsd.org/changeset/base/259678 Log: Fix build with WITHOUT_CAPSICUM. Submitted by: dt71 gmx com Sponsored by: The FreeBSD Foundation Modified: head/contrib/tcpdump/addrtoname.c Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Sat Dec 21 11:59:58 2013 (r259677) +++ head/contrib/tcpdump/addrtoname.c Sat Dec 21 12:45:35 2013 (r259678) @@ -33,8 +33,10 @@ static const char rcsid[] _U_ = #endif #ifdef __FreeBSD__ +#ifdef HAVE_LIBCAPSICUM #include #include +#endif /* HAVE_LIBCAPSICUM */ #endif #include From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 12:55:43 2013 Return-Path: Delivered-To: svn-src-all@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 4598EABB; Sat, 21 Dec 2013 12:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25F0D1365; Sat, 21 Dec 2013 12:55:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLCthwE033325; Sat, 21 Dec 2013 12:55:43 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLCth6j033324; Sat, 21 Dec 2013 12:55:43 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312211255.rBLCth6j033324@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 21 Dec 2013 12:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259679 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 12:55:43 -0000 Author: dumbbell Date: Sat Dec 21 12:55:42 2013 New Revision: 259679 URL: http://svnweb.freebsd.org/changeset/base/259679 Log: vga_pci: Improve boot display detection The previous code was checking the "VGA Enable" bit on the video card's parent PCI-to-PCI bridge only. This didn't work for the case where the video card is attached to the root PCI bus (ie. the card has no parent PCI-to-PCI bridge). Now, the new code: 1. checks the "VGA Enable" bit on the parent bridge only if it's a PCI-to-PCI bridge; 2. always checks the "I/O" and "Memory address space decoding" bits on the video card itself. However, vendor-specific bits are not used. This fixes the use of many integrated Radeon cards: without this patch, we fail to detect them as the boot display and, when radeonkms looks for the Video BIOS, it skips the shadow copy made by the System BIOS. It then fails to fully initialize the card, because the shadow copy is the only way to read the Video BIOS in these situations. A workaround was to force the boot display selection using the "hw.pci.default_vgapci_unit" tunable. A previous version of this patch added a new function doing the checks. Now, the vga_pci_is_boot_display() function is used to perform the checks (only until the boot display is found) and return if the given device is the boot display or not. Furthermore, vga_pci_attach() logs "Boot video device" if the card being attached it the Chosen One: vgapci0: [...] vgapci0: Boot video device Reviewed by: kib@, jhb@ (both a previous version) Tested by: lunatic_ (#freebsd-xorg, integrated Radeon card, xmj (#freebsd-xorg, i915+NVIDIA cards) Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sat Dec 21 12:45:35 2013 (r259678) +++ head/sys/dev/pci/vga_pci.c Sat Dec 21 12:55:42 2013 (r259679) @@ -81,16 +81,58 @@ SYSCTL_INT(_hw_pci, OID_AUTO, default_vg int vga_pci_is_boot_display(device_t dev) { + int unit; + device_t pcib; + uint16_t config; + + /* Check that the given device is a video card */ + if ((pci_get_class(dev) != PCIC_DISPLAY && + (pci_get_class(dev) != PCIC_OLD || + pci_get_subclass(dev) != PCIS_OLD_VGA))) + return (0); + + unit = device_get_unit(dev); + + if (vga_pci_default_unit >= 0) { + /* + * The boot display device was determined by a previous + * call to this function, or the user forced it using + * the hw.pci.default_vgapci_unit tunable. + */ + return (vga_pci_default_unit == unit); + } /* - * Return true if the given device is the default display used - * at boot time. + * The primary video card used as a boot display must have the + * "I/O" and "Memory Address Space Decoding" bits set in its + * Command register. + * + * Furthermore, if the card is attached to a bridge, instead of + * the root PCI bus, the bridge must have the "VGA Enable" bit + * set in its Control register. */ - return ( - (pci_get_class(dev) == PCIC_DISPLAY || - (pci_get_class(dev) == PCIC_OLD && - pci_get_subclass(dev) == PCIS_OLD_VGA)) && - device_get_unit(dev) == vga_pci_default_unit); + + pcib = device_get_parent(device_get_parent(dev)); + if (device_get_devclass(device_get_parent(pcib)) == + devclass_find("pci")) { + /* + * The parent bridge is a PCI-to-PCI bridge: check the + * value of the "VGA Enable" bit. + */ + config = pci_read_config(pcib, PCIR_BRIDGECTL_1, 2); + if ((config & PCIB_BCR_VGA_ENABLE) == 0) + return (0); + } + + config = pci_read_config(dev, PCIR_COMMAND, 2); + if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0) + return (0); + + /* This video card is the boot display: record its unit number. */ + vga_pci_default_unit = unit; + device_set_flags(dev, 1); + + return (1); } void * @@ -159,9 +201,6 @@ vga_pci_unmap_bios(device_t dev, void *b static int vga_pci_probe(device_t dev) { - device_t bdev; - int unit; - uint16_t bctl; switch (pci_get_class(dev)) { case PCIC_DISPLAY: @@ -175,13 +214,7 @@ vga_pci_probe(device_t dev) } /* Probe default display. */ - unit = device_get_unit(dev); - bdev = device_get_parent(device_get_parent(dev)); - bctl = pci_read_config(bdev, PCIR_BRIDGECTL_1, 2); - if (vga_pci_default_unit < 0 && (bctl & PCIB_BCR_VGA_ENABLE) != 0) - vga_pci_default_unit = unit; - if (vga_pci_default_unit == unit) - device_set_flags(dev, 1); + vga_pci_is_boot_display(dev); device_set_desc(dev, "VGA-compatible display"); return (BUS_PROBE_GENERIC); @@ -197,6 +230,10 @@ vga_pci_attach(device_t dev) device_add_child(dev, "drm", -1); device_add_child(dev, "drmn", -1); bus_generic_attach(dev); + + if (vga_pci_is_boot_display(dev)) + device_printf(dev, "Boot video device\n"); + return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 13:58:57 2013 Return-Path: Delivered-To: svn-src-all@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 57E4E6B0; Sat, 21 Dec 2013 13:58:57 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37DF61711; Sat, 21 Dec 2013 13:58:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLDwvGe055132; Sat, 21 Dec 2013 13:58:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLDwtvX055123; Sat, 21 Dec 2013 13:58:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201312211358.rBLDwtvX055123@svn.freebsd.org> From: Ed Maste Date: Sat, 21 Dec 2013 13:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259680 - in head: sys/dev/vt sys/dev/vt/font sys/sys tools/tools/vt/fontcvt tools/tools/vt/mkkfont tools/tools/vt/setfont X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 13:58:57 -0000 Author: emaste Date: Sat Dec 21 13:58:55 2013 New Revision: 259680 URL: http://svnweb.freebsd.org/changeset/base/259680 Log: Support double-width characters in vt(9) Normal and bold fonts each have a glyph map for single or left half- glyphs, and right half glyphs. The flag TF_CJK_RIGHT in term_char_t requests the right half-glyph. Reviewed by: ed@ Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_font_default.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_font.c head/sys/sys/consio.h head/tools/tools/vt/fontcvt/fontcvt.c head/tools/tools/vt/mkkfont/mkkfont.c head/tools/tools/vt/setfont/setfont.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/font/vt_font_default.c Sat Dec 21 13:58:55 2013 (r259680) @@ -2194,9 +2194,8 @@ struct vt_font vt_font_default = { .vf_width = 8, .vf_height = 16, .vf_bytes = font_bytes, - .vf_normal = font_mapping_normal, - .vf_normal_length = 248, - .vf_bold = font_mapping_bold, - .vf_bold_length = 260, + .vf_map = { font_mapping_normal, NULL, + font_mapping_bold, NULL }, + .vf_map_count = { 248, 0, 260, 0 }, .vf_refcount = 1, }; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/vt.h Sat Dec 21 13:58:55 2013 (r259680) @@ -388,11 +388,10 @@ struct vt_font_map { }; struct vt_font { - struct vt_font_map *vf_bold; - struct vt_font_map *vf_normal; + struct vt_font_map *vf_map[VFNT_MAPS]; uint8_t *vf_bytes; - unsigned int vf_height, vf_width, - vf_normal_length, vf_bold_length; + unsigned int vf_height, vf_width; + unsigned int vf_map_count[VFNT_MAPS]; unsigned int vf_refcount; }; Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/dev/vt/vt_font.c Sat Dec 21 13:58:55 2013 (r259680) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ -#define VTFONT_MAXMAPPINGS 1024 +#define VTFONT_MAXMAPPINGS 8192 #define VTFONT_MAXGLYPHSIZE 262144 #define VTFONT_MAXDIMENSION 128 @@ -86,6 +86,8 @@ vtfont_lookup(const struct vt_font *vf, uint32_t src; uint16_t dst; size_t stride; + unsigned int normal_map; + unsigned int bold_map; /* * No support for printing right hand sides for CJK fullwidth @@ -93,15 +95,22 @@ vtfont_lookup(const struct vt_font *vf, * hand side describes the entire character. */ src = TCHAR_CHARACTER(c); - if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) - src = ' '; + if (TCHAR_FORMAT(c) & TF_CJK_RIGHT) { + normal_map = VFNT_MAP_NORMAL_RIGHT; + bold_map = VFNT_MAP_BOLD_RIGHT; + } else { + normal_map = VFNT_MAP_NORMAL; + bold_map = VFNT_MAP_BOLD; + } if (TCHAR_FORMAT(c) & TF_BOLD) { - dst = vtfont_bisearch(vf->vf_bold, vf->vf_bold_length, src); + dst = vtfont_bisearch(vf->vf_map[bold_map], + vf->vf_map_count[bold_map], src); if (dst != 0) goto found; } - dst = vtfont_bisearch(vf->vf_normal, vf->vf_normal_length, src); + dst = vtfont_bisearch(vf->vf_map[normal_map], + vf->vf_map_count[normal_map], src); found: stride = howmany(vf->vf_width, 8) * vf->vf_height; @@ -119,10 +128,11 @@ vtfont_ref(struct vt_font *vf) void vtfont_unref(struct vt_font *vf) { + unsigned int i; if (refcount_release(&vf->vf_refcount)) { - free(vf->vf_normal, M_VTFONT); - free(vf->vf_bold, M_VTFONT); + for (i = 0; i < VFNT_MAPS; i++) + free(vf->vf_map[i], M_VTFONT); free(vf->vf_bytes, M_VTFONT); free(vf, M_VTFONT); } @@ -130,7 +140,7 @@ vtfont_unref(struct vt_font *vf) static int vtfont_validate_map(struct vt_font_map *vfm, unsigned int length, - unsigned int nglyphs) + unsigned int glyph_count) { unsigned int i, last = 0; @@ -141,8 +151,8 @@ vtfont_validate_map(struct vt_font_map * /* * Destination extends amount of glyphs. */ - if (vfm[i].vfm_dst >= nglyphs || - vfm[i].vfm_dst + vfm[i].vfm_len >= nglyphs) + if (vfm[i].vfm_dst >= glyph_count || + vfm[i].vfm_dst + vfm[i].vfm_len >= glyph_count) return (EINVAL); last = vfm[i].vfm_src + vfm[i].vfm_len; } @@ -153,9 +163,10 @@ vtfont_validate_map(struct vt_font_map * int vtfont_load(vfnt_t *f, struct vt_font **ret) { - size_t glyphsize; + size_t glyphsize, mapsize; struct vt_font *vf; int error; + unsigned int i; /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) @@ -164,50 +175,43 @@ vtfont_load(vfnt_t *f, struct vt_font ** return (E2BIG); /* Not too many mappings. */ - if (f->nnormal > VTFONT_MAXMAPPINGS || f->nbold > VTFONT_MAXMAPPINGS) - return (E2BIG); + for (i = 0; i < VFNT_MAPS; i++) + if (f->map_count[i] > VTFONT_MAXMAPPINGS) + return (E2BIG); /* Character 0 must always be present. */ - if (f->nglyphs < 1) + if (f->glyph_count < 1) return (EINVAL); - glyphsize = howmany(f->width, 8) * f->height * f->nglyphs; + glyphsize = howmany(f->width, 8) * f->height * f->glyph_count; if (glyphsize > VTFONT_MAXGLYPHSIZE) return (E2BIG); /* Allocate new font structure. */ - vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK); - vf->vf_normal = malloc(f->nnormal * sizeof(struct vt_font_map), - M_VTFONT, M_WAITOK); - vf->vf_bold = malloc(f->nbold * sizeof(struct vt_font_map), - M_VTFONT, M_WAITOK); + vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK | M_ZERO); vf->vf_bytes = malloc(glyphsize, M_VTFONT, M_WAITOK); vf->vf_height = f->height; vf->vf_width = f->width; - vf->vf_normal_length = f->nnormal; - vf->vf_bold_length = f->nbold; vf->vf_refcount = 1; - /* Copy in data. */ - error = copyin(f->normal, vf->vf_normal, - vf->vf_normal_length * sizeof(struct vt_font_map)); - if (error) - goto bad; - error = copyin(f->bold, vf->vf_bold, - vf->vf_bold_length * sizeof(struct vt_font_map)); - if (error) - goto bad; - error = copyin(f->glyphs, vf->vf_bytes, glyphsize); - if (error) - goto bad; + /* Allocate, copy in, and validate mappings. */ + for (i = 0; i < VFNT_MAPS; i++) { + vf->vf_map_count[i] = f->map_count[i]; + if (f->map_count[i] == 0) + continue; + mapsize = f->map_count[i] * sizeof(struct vt_font_map); + vf->vf_map[i] = malloc(mapsize, M_VTFONT, M_WAITOK); + error = copyin(f->map[i], vf->vf_map[i], mapsize); + if (error) + goto bad; + error = vtfont_validate_map(vf->vf_map[i], vf->vf_map_count[i], + f->glyph_count); + if (error) + goto bad; + } - /* Validate mappings. */ - error = vtfont_validate_map(vf->vf_normal, vf->vf_normal_length, - f->nglyphs); - if (error) - goto bad; - error = vtfont_validate_map(vf->vf_bold, vf->vf_bold_length, - f->nglyphs); + /* Copy in glyph data. */ + error = copyin(f->glyphs, vf->vf_bytes, glyphsize); if (error) goto bad; Modified: head/sys/sys/consio.h ============================================================================== --- head/sys/sys/consio.h Sat Dec 21 12:55:42 2013 (r259679) +++ head/sys/sys/consio.h Sat Dec 21 13:58:55 2013 (r259680) @@ -216,13 +216,16 @@ struct vfnt_map { }; typedef struct vfnt_map vfnt_map_t; +#define VFNT_MAP_NORMAL 0 +#define VFNT_MAP_NORMAL_RIGHT 1 +#define VFNT_MAP_BOLD 2 +#define VFNT_MAP_BOLD_RIGHT 3 +#define VFNT_MAPS 4 struct vfnt { - vfnt_map_t *normal; - vfnt_map_t *bold; + vfnt_map_t *map[VFNT_MAPS]; uint8_t *glyphs; - unsigned int nnormal; - unsigned int nbold; - unsigned int nglyphs; + unsigned int map_count[VFNT_MAPS]; + unsigned int glyph_count; unsigned int width; unsigned int height; }; Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/fontcvt/fontcvt.c Sat Dec 21 13:58:55 2013 (r259680) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#define VFNT_MAPS 4 +#define VFNT_MAP_NORMAL 0 +#define VFNT_MAP_BOLD 2 + static unsigned int width, wbytes, height; struct glyph { @@ -48,9 +52,14 @@ struct glyph { unsigned int g_index; }; -static TAILQ_HEAD(, glyph) glyph_list = TAILQ_HEAD_INITIALIZER(glyph_list); -static unsigned int glyph_total, glyph_normal, glyph_bold, - glyph_unique, glyph_dupe; +TAILQ_HEAD(glyph_list, glyph); +static struct glyph_list glyphs[VFNT_MAPS] = { + TAILQ_HEAD_INITIALIZER(glyphs[0]), + TAILQ_HEAD_INITIALIZER(glyphs[1]), + TAILQ_HEAD_INITIALIZER(glyphs[2]), + TAILQ_HEAD_INITIALIZER(glyphs[3]), +}; +static unsigned int glyph_total, glyph_count[4], glyph_unique, glyph_dupe; struct mapping { TAILQ_ENTRY(mapping) m_list; @@ -60,12 +69,14 @@ struct mapping { }; TAILQ_HEAD(mapping_list, mapping); -static struct mapping_list mapping_list_normal = - TAILQ_HEAD_INITIALIZER(mapping_list_normal); -static struct mapping_list mapping_list_bold = - TAILQ_HEAD_INITIALIZER(mapping_list_bold); -static unsigned int mapping_total, mapping_normal, mapping_normal_folded, - mapping_bold, mapping_bold_folded, mapping_unique, mapping_dupe; +static struct mapping_list maps[VFNT_MAPS] = { + TAILQ_HEAD_INITIALIZER(maps[0]), + TAILQ_HEAD_INITIALIZER(maps[1]), + TAILQ_HEAD_INITIALIZER(maps[2]), + TAILQ_HEAD_INITIALIZER(maps[3]), +}; +static unsigned int mapping_total, map_count[4], map_folded_count[4], + mapping_unique, mapping_dupe; static void usage(void) @@ -77,17 +88,18 @@ usage(void) } static int -add_mapping(struct glyph *gl, unsigned int c, int bold) +add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) { struct mapping *mp; struct mapping_list *ml; mapping_total++; - if (bold) { + if (map_idx >= VFNT_MAP_BOLD) { int found = 0; + unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; - TAILQ_FOREACH(mp, &mapping_list_normal, m_list) { + TAILQ_FOREACH(mp, &maps[normal_map_idx], m_list) { if (mp->m_char < c) continue; else if (mp->m_char > c) @@ -116,7 +128,7 @@ add_mapping(struct glyph *gl, unsigned i mp->m_glyph = gl; mp->m_length = 0; - ml = bold ? &mapping_list_bold : &mapping_list_normal; + ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && TAILQ_LAST(ml, mapping_list)->m_char >= c) { fprintf(stderr, "Bad ordering at character %u\n", c); @@ -124,30 +136,27 @@ add_mapping(struct glyph *gl, unsigned i } TAILQ_INSERT_TAIL(ml, mp, m_list); - if (bold) - mapping_bold++; - else - mapping_normal++; + map_count[map_idx]++; mapping_unique++; return (0); } static struct glyph * -add_glyph(const uint8_t *bytes, int bold, int fallback) +add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) { struct glyph *gl; + unsigned int i; glyph_total++; - if (bold) - glyph_bold++; - else - glyph_normal++; + glyph_count[map_idx]++; - TAILQ_FOREACH(gl, &glyph_list, g_list) { - if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { - glyph_dupe++; - return (gl); + for (i = 0; i < VFNT_MAPS; i++) { + TAILQ_FOREACH(gl, &glyphs[i], g_list) { + if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { + glyph_dupe++; + return (gl); + } } } @@ -155,22 +164,61 @@ add_glyph(const uint8_t *bytes, int bold gl->g_data = malloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); if (fallback) - TAILQ_INSERT_HEAD(&glyph_list, gl, g_list); + TAILQ_INSERT_HEAD(&glyphs[map_idx], gl, g_list); else - TAILQ_INSERT_TAIL(&glyph_list, gl, g_list); + TAILQ_INSERT_TAIL(&glyphs[map_idx], gl, g_list); glyph_unique++; return (gl); } static int -parse_bdf(const char *filename, int bold __unused) +parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, + unsigned int dwidth) +{ + uint8_t *p; + unsigned int i, subline; + + if (dwidth != width && dwidth != width * 2) { + fprintf(stderr, + "Unsupported width %u!\n", dwidth); + return (1); + } + + /* Move pixel data right to simplify splitting double characters. */ + line >>= (howmany(dwidth, 8) * 8) - dwidth; + + for (i = dwidth / width; i > 0; i--) { + p = (i == 2) ? right : left; + + subline = line & ((1 << width) - 1); + subline <<= (howmany(width, 8) * 8) - width; + + if (wbytes == 1) { + *p = subline; + } else if (wbytes == 2) { + *p++ = subline >> 8; + *p = subline; + } else { + fprintf(stderr, + "Unsupported wbytes %u!\n", wbytes); + return (1); + } + + line >>= width; + } + + return (0); +} + +static int +parse_bdf(const char *filename, unsigned int map_idx) { FILE *fp; char *ln; size_t length; - uint8_t bytes[wbytes * height]; - unsigned int curchar = 0, i, line; + uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; + unsigned int curchar = 0, dwidth = 0, i, line; struct glyph *gl; fp = fopen(filename, "r"); @@ -186,6 +234,10 @@ parse_bdf(const char *filename, int bold curchar = atoi(ln + 9); } + if (strncmp(ln, "DWIDTH ", 7) == 0) { + dwidth = atoi(ln + 7); + } + if (strcmp(ln, "BITMAP") == 0) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) { @@ -194,26 +246,25 @@ parse_bdf(const char *filename, int bold } ln[length - 1] = '\0'; sscanf(ln, "%x", &line); - if (wbytes == 1) { - bytes[i] = line; - } else if (wbytes == 2) { - bytes[i * 2 + 0] = line >> 8; - bytes[i * 2 + 1] = line; - } else { - fprintf(stderr, - "Unsupported wbytes!\n"); + if (parse_bitmap_line(bytes + i * wbytes, + bytes_r + i * wbytes, line, dwidth) != 0) return (1); - } } /* Prevent adding two glyphs for 0xFFFD */ if (curchar == 0xFFFD) { - if (!bold) - gl = add_glyph(bytes, bold, 1); + if (map_idx < VFNT_MAP_BOLD) + gl = add_glyph(bytes, 0, 1); } else if (curchar >= 0x20) { - gl = add_glyph(bytes, bold, 0); - if (add_mapping(gl, curchar, bold) != 0) + gl = add_glyph(bytes, map_idx, 0); + if (add_mapping(gl, curchar, map_idx) != 0) return (1); + if (dwidth == width * 2) { + gl = add_glyph(bytes_r, map_idx + 1, 0); + if (add_mapping(gl, curchar, + map_idx + 1) != 0) + return (1); + } } } } @@ -225,32 +276,31 @@ static void number_glyphs(void) { struct glyph *gl; - unsigned int idx = 0; + unsigned int i, idx = 0; - TAILQ_FOREACH(gl, &glyph_list, g_list) - gl->g_index = idx++; + for (i = 0; i < VFNT_MAPS; i++) + TAILQ_FOREACH(gl, &glyphs[i], g_list) + gl->g_index = idx++; } static void write_glyphs(FILE *fp) { struct glyph *gl; + unsigned int i; - TAILQ_FOREACH(gl, &glyph_list, g_list) - fwrite(gl->g_data, wbytes * height, 1, fp); + for (i = 0; i < VFNT_MAPS; i++) { + TAILQ_FOREACH(gl, &glyphs[i], g_list) + fwrite(gl->g_data, wbytes * height, 1, fp); + } } static void -fold_mappings(int bold) +fold_mappings(unsigned int map_idx) { - struct mapping_list *ml; + struct mapping_list *ml = &maps[map_idx]; struct mapping *mn, *mp, *mbase; - if (bold) - ml = &mapping_list_bold; - else - ml = &mapping_list_normal; - mp = mbase = TAILQ_FIRST(ml); for (mp = mbase = TAILQ_FIRST(ml); mp != NULL; mp = mn) { mn = TAILQ_NEXT(mp, m_list); @@ -259,10 +309,7 @@ fold_mappings(int bold) continue; mbase->m_length = mp->m_char - mbase->m_char + 1; mbase = mp = mn; - if (bold) - mapping_bold_folded++; - else - mapping_normal_folded++; + map_folded_count[map_idx]++; } } @@ -273,18 +320,13 @@ struct file_mapping { } __packed; static void -write_mappings(FILE *fp, int bold) +write_mappings(FILE *fp, unsigned int map_idx) { - struct mapping_list *ml; + struct mapping_list *ml = &maps[map_idx]; struct mapping *mp; struct file_mapping fm; unsigned int i = 0, j = 0; - if (bold) - ml = &mapping_list_bold; - else - ml = &mapping_list_normal; - TAILQ_FOREACH(mp, ml, m_list) { j++; if (mp->m_length > 0) { @@ -302,9 +344,9 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static int @@ -312,7 +354,7 @@ write_fnt(const char *filename) { FILE *fp; struct file_header fh = { - .magic = "VFNT 1.0", + .magic = "VFNT0002", }; fp = fopen(filename, "wb"); @@ -323,14 +365,18 @@ write_fnt(const char *filename) fh.width = width; fh.height = height; - fh.nglyphs = htobe16(glyph_unique); - fh.nmappings_normal = htobe16(mapping_normal_folded); - fh.nmappings_bold = htobe16(mapping_bold_folded); + fh.glyph_count = htobe32(glyph_unique); + fh.map_count[0] = htobe32(map_folded_count[0]); + fh.map_count[1] = htobe32(map_folded_count[1]); + fh.map_count[2] = htobe32(map_folded_count[2]); + fh.map_count[3] = htobe32(map_folded_count[3]); fwrite(&fh, sizeof fh, 1, fp); write_glyphs(fp); - write_mappings(fp, 0); + write_mappings(fp, VFNT_MAP_NORMAL); write_mappings(fp, 1); + write_mappings(fp, VFNT_MAP_BOLD); + write_mappings(fp, 3); return (0); } @@ -339,7 +385,7 @@ int main(int argc, char *argv[]) { - assert(sizeof(struct file_header) == 16); + assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); if (argc != 6) @@ -349,36 +395,49 @@ main(int argc, char *argv[]) wbytes = howmany(width, 8); height = atoi(argv[2]); - if (parse_bdf(argv[3], 0) != 0) + if (parse_bdf(argv[3], VFNT_MAP_NORMAL) != 0) return (1); - if (parse_bdf(argv[4], 1) != 0) + if (parse_bdf(argv[4], VFNT_MAP_BOLD) != 0) return (1); number_glyphs(); fold_mappings(0); fold_mappings(1); + fold_mappings(2); + fold_mappings(3); if (write_fnt(argv[5]) != 0) return (1); printf( "Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", +"- glyph_total: %5u\n" +"- glyph_normal: %5u\n" +"- glyph_normal_right: %5u\n" +"- glyph_bold: %5u\n" +"- glyph_bold_right: %5u\n" +"- glyph_unique: %5u\n" +"- glyph_dupe: %5u\n" +"- mapping_total: %5u\n" +"- mapping_normal: %5u\n" +"- mapping_normal_folded: %5u\n" +"- mapping_normal_right: %5u\n" +"- mapping_normal_right_folded: %5u\n" +"- mapping_bold: %5u\n" +"- mapping_bold_folded: %5u\n" +"- mapping_bold_right: %5u\n" +"- mapping_bold_right_folded: %5u\n" +"- mapping_unique: %5u\n" +"- mapping_dupe: %5u\n", glyph_total, - glyph_normal, glyph_bold, + glyph_count[0], + glyph_count[1], + glyph_count[2], + glyph_count[3], glyph_unique, glyph_dupe, mapping_total, - mapping_normal, mapping_normal_folded, - mapping_bold, mapping_bold_folded, + map_count[0], map_folded_count[0], + map_count[1], map_folded_count[1], + map_count[2], map_folded_count[2], + map_count[3], map_folded_count[3], mapping_unique, mapping_dupe); return (0); Modified: head/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- head/tools/tools/vt/mkkfont/mkkfont.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/mkkfont/mkkfont.c Sat Dec 21 13:58:55 2013 (r259680) @@ -48,22 +48,22 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static int print_glyphs(struct file_header *fh) { - unsigned int gbytes, nglyphs, j, k, total; + unsigned int gbytes, glyph_count, j, k, total; uint8_t *gbuf; gbytes = howmany(fh->width, 8) * fh->height; - nglyphs = be16toh(fh->nglyphs); + glyph_count = be32toh(fh->glyph_count); - printf("\nstatic uint8_t font_bytes[%u * %u] = {", nglyphs, gbytes); - total = nglyphs * gbytes; + printf("\nstatic uint8_t font_bytes[%u * %u] = {", glyph_count, gbytes); + total = glyph_count * gbytes; gbuf = malloc(total); if (fread(gbuf, total, 1, stdin) != 1) { @@ -84,26 +84,23 @@ print_glyphs(struct file_header *fh) return (0); } +static const char *map_names[4] = { + "normal", "normal_right", "bold", "bold_right" }; + static int -print_mappings(struct file_header *fh, int bold) +print_mappings(struct file_header *fh, int map_index) { struct file_mapping fm; - const char *name; unsigned int nmappings, i, col = 0; - if (bold) { - nmappings = be16toh(fh->nmappings_bold); - name = "bold"; - } else { - nmappings = be16toh(fh->nmappings_normal); - name = "normal"; - } + + nmappings = be32toh(fh->map_count[map_index]); if (nmappings == 0) return (0); printf("\nstatic struct vt_font_map font_mapping_%s[%u] = {", - name, nmappings); + map_names[map_index], nmappings); for (i = 0; i < nmappings; i++) { if (fread(&fm, sizeof fm, 1, stdin) != 1) { @@ -126,7 +123,7 @@ print_mappings(struct file_header *fh, i static int print_info(struct file_header *fh) { - unsigned int nnormal, nbold; + unsigned int i; printf( "\nstruct vt_font vt_font_default = {\n" @@ -135,17 +132,19 @@ print_info(struct file_header *fh) "\t.vf_bytes\t\t= font_bytes,\n", fh->width, fh->height); - nnormal = be16toh(fh->nmappings_normal); - nbold = be16toh(fh->nmappings_bold); - - if (nnormal != 0) - printf( - "\t.vf_normal\t\t= font_mapping_normal,\n" - "\t.vf_normal_length\t= %u,\n", nnormal); - if (nbold != 0) - printf( - "\t.vf_bold\t\t= font_mapping_bold,\n" - "\t.vf_bold_length\t\t= %u,\n", nbold); + printf("\t.vf_map\t\t\t= {\n"); + for (i = 0; i < 4; i++) { + if (fh->map_count[i] > 0) + printf("\t\t\t\t font_mapping_%s,\n", map_names[i]); + else + printf("\t\t\t\t NULL,\n"); + } + printf("\t\t\t\t }\n"); + printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", + be32toh(fh->map_count[0]), + be32toh(fh->map_count[1]), + be32toh(fh->map_count[2]), + be32toh(fh->map_count[3])); printf("\t.vf_refcount\t\t= 1,\n};\n"); return (0); @@ -161,7 +160,7 @@ main(int argc __unused, char *argv[] __u return (1); } - if (memcmp(fh.magic, "VFNT 1.0", 8) != 0) { + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { fprintf(stderr, "Bad magic\n"); return (1); } Modified: head/tools/tools/vt/setfont/setfont.c ============================================================================== --- head/tools/tools/vt/setfont/setfont.c Sat Dec 21 12:55:42 2013 (r259679) +++ head/tools/tools/vt/setfont/setfont.c Sat Dec 21 13:58:55 2013 (r259680) @@ -1,3 +1,6 @@ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -12,9 +15,9 @@ struct file_header { uint8_t magic[8]; uint8_t width; uint8_t height; - uint16_t nglyphs; - uint16_t nmappings_normal; - uint16_t nmappings_bold; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; } __packed; static vfnt_map_t * @@ -48,24 +51,25 @@ main(int argc __unused, char *argv[] __u struct file_header fh; static vfnt_t vfnt; size_t glyphsize; + unsigned int i; if (fread(&fh, sizeof fh, 1, stdin) != 1) { perror("file_header"); return (1); } - if (memcmp(fh.magic, "VFNT 1.0", 8) != 0) { + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { fprintf(stderr, "Bad magic\n"); return (1); } - vfnt.nnormal = be16toh(fh.nmappings_normal); - vfnt.nbold = be16toh(fh.nmappings_bold); - vfnt.nglyphs = be16toh(fh.nglyphs); + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map_count[i] = be32toh(fh.map_count[i]); + vfnt.glyph_count = be32toh(fh.glyph_count); vfnt.width = fh.width; vfnt.height = fh.height; - glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.nglyphs; + glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count; vfnt.glyphs = malloc(glyphsize); if (fread(vfnt.glyphs, glyphsize, 1, stdin) != 1) { @@ -73,8 +77,8 @@ main(int argc __unused, char *argv[] __u return (1); } - vfnt.normal = load_mappingtable(vfnt.nnormal); - vfnt.bold = load_mappingtable(vfnt.nbold); + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map[i] = load_mappingtable(vfnt.map_count[i]); if (ioctl(STDOUT_FILENO, PIO_VFONT, &vfnt) == -1) { perror("PIO_VFONT"); From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 14:41:33 2013 Return-Path: Delivered-To: svn-src-all@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 13F16E65; Sat, 21 Dec 2013 14:41:33 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D894619D5; Sat, 21 Dec 2013 14:41:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLEfWWG072414; Sat, 21 Dec 2013 14:41:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLEfWko072413; Sat, 21 Dec 2013 14:41:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312211441.rBLEfWko072413@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 21 Dec 2013 14:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259681 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 14:41:33 -0000 Author: glebius Date: Sat Dec 21 14:41:32 2013 New Revision: 259681 URL: http://svnweb.freebsd.org/changeset/base/259681 Log: In r248885 I have reduced size of fake uio resid that ng_ksocket(4) passes to the soreceive(). This exposed a bug. When reading from a raw socket, when our fake limit is depleted, we receive a truncated mbuf chain, with m->m_pkthdr.len > m_length(m). The first problem is that MSG_TRUNC was not handled. The second one is that we didn't reinit uio_resid in our endless loop (neither flags), and if socket buffer contained several records, then we quickly deplete our fake limit. The third bug, actually introduced in r248885, is that MJUMPAGESIZE isn't enough to handle maximum packet that ng_ksocket(4) can theoretically receive. Changes: - Reinit uio_resid and flags before every call to soreceive(). - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the module doesn't support INET6. - Properly handle MSG_TRUNC return from soreceive(). PR: 184601 Submitted & tested by: Viktor Velichkin Sponsored by: Nginx, Inc. Modified: head/sys/netgraph/ng_ksocket.c Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Sat Dec 21 13:58:55 2013 (r259680) +++ head/sys/netgraph/ng_ksocket.c Sat Dec 21 14:41:32 2013 (r259681) @@ -66,6 +66,7 @@ #include #include +#include #include #ifdef NG_SEPARATE_MALLOC @@ -1043,8 +1044,7 @@ ng_ksocket_incoming2(node_p node, hook_p struct socket *so = arg1; const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *response; - struct uio auio; - int flags, error; + int error; KASSERT(so == priv->so, ("%s: wrong socket", __func__)); @@ -1093,20 +1093,27 @@ ng_ksocket_incoming2(node_p node, hook_p if (priv->hook == NULL) return; - /* Read and forward available mbuf's */ - auio.uio_td = NULL; - auio.uio_resid = MJUMPAGESIZE; /* XXXGL: sane limit? */ - flags = MSG_DONTWAIT; + /* Read and forward available mbufs. */ while (1) { - struct sockaddr *sa = NULL; + struct uio uio; + struct sockaddr *sa; struct mbuf *m; + int flags; - /* Try to get next packet from socket */ + /* Try to get next packet from socket. */ + uio.uio_td = NULL; + uio.uio_resid = IP_MAXPACKET; + flags = MSG_DONTWAIT; + sa = NULL; if ((error = soreceive(so, (so->so_state & SS_ISCONNECTED) ? - NULL : &sa, &auio, &m, NULL, &flags)) != 0) + NULL : &sa, &uio, &m, NULL, &flags)) != 0) break; - /* See if we got anything */ + /* See if we got anything. */ + if (flags & MSG_TRUNC) { + m_freem(m); + m = NULL; + } if (m == NULL) { if (sa != NULL) free(sa, M_SONAME); From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 14:50:06 2013 Return-Path: Delivered-To: svn-src-all@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 9AA5016A; Sat, 21 Dec 2013 14:50:06 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 663041A15; Sat, 21 Dec 2013 14:50:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500G00V4L6W00@smtpauth2.wiscmail.wisc.edu>; Sat, 21 Dec 2013 08:49:59 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.143916, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY50015TVV89720@smtpauth2.wiscmail.wisc.edu>; Sat, 21 Dec 2013 08:49:58 -0600 (CST) Message-id: <52B5AA94.3060009@freebsd.org> Date: Sat, 21 Dec 2013 08:49:56 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> In-reply-to: <52AF2502.1060503@freebsd.org> X-Enigmail-Version: 1.5.2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 14:50:06 -0000 Could you please revert this and move the fix to the correct place? -Nathan On 12/16/13 10:06, Nathan Whitehorn wrote: > Please add this to release/rc.local instead under the console setup. > There is no guarantee that "auto" is running from an environment where > this is defined -- for example, it may be running from a serial > console or an xterm -- and the actual installer should not be polluted > with assumptions about the media from which it runs. > -Nathan > > On 12/16/13 09:50, Devin Teske wrote: >> Author: dteske >> Date: Mon Dec 16 15:50:59 2013 >> New Revision: 259468 >> URL: http://svnweb.freebsd.org/changeset/base/259468 >> >> Log: >> Add a fix for Long-standing problem with VMware. Described in >> below links: >> https://communities.vmware.com/thread/107230 >> https://communities.vmware.com/docs/DOC-11677 >> Basically, ignore the ``function 62'' and ``function 63'' >> interpretations >> of the left/right command key when we're in the lengthiest portion >> of the >> installation (initiated by the `auto' module). >> The net effect is that you can now (once you've started the >> installer from >> the media) escape the VM without prematurely terminating the >> current action >> due to spurious escape sequence. >> MFC after: 3 days >> >> Modified: >> head/usr.sbin/bsdinstall/scripts/auto >> >> Modified: head/usr.sbin/bsdinstall/scripts/auto >> ============================================================================== >> >> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >> 2013 (r259467) >> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >> 2013 (r259468) >> @@ -49,6 +49,10 @@ error() { >> ############################################################ MAIN >> +# Don't send ESC on function-key 62/63 (left/right command key) >> +f_quietly kbdcontrol -f 62 '' >> +f_quietly kbdcontrol -f 63 '' >> + >> f_dprintf "Began Installation at %s" "$( date )" >> rm -rf $BSDINSTALL_TMPETC > From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 15:02:48 2013 Return-Path: Delivered-To: svn-src-all@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 39BC052D; Sat, 21 Dec 2013 15:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 269BA1B19; Sat, 21 Dec 2013 15:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLF2l7h079591; Sat, 21 Dec 2013 15:02:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLF2lOc079590; Sat, 21 Dec 2013 15:02:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211502.rBLF2lOc079590@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 15:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259682 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 15:02:48 -0000 Author: gjb Date: Sat Dec 21 15:02:47 2013 New Revision: 259682 URL: http://svnweb.freebsd.org/changeset/base/259682 Log: Honor WITHOUT_CASPER. Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Dec 21 14:41:32 2013 (r259681) +++ head/etc/rc.d/Makefile Sat Dec 21 15:02:47 2013 (r259682) @@ -26,7 +26,7 @@ FILES= DAEMON \ bridge \ bsnmpd \ ${_bthidd} \ - casperd \ + ${_casperd} \ ccd \ cleanvar \ cleartmp \ @@ -188,6 +188,10 @@ _hcsecd= hcsecd _ubthidhci= ubthidhci .endif +.if ${MK_CASPER} != "no" +_casperd= casperd +.endif + .if ${MK_UNBOUND} != "no" _unbound= local_unbound .endif From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 15:16:29 2013 Return-Path: Delivered-To: svn-src-all@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 55D058A4; Sat, 21 Dec 2013 15:16:29 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41A271CE2; Sat, 21 Dec 2013 15:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLFGT95083894; Sat, 21 Dec 2013 15:16:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLFGT1E083893; Sat, 21 Dec 2013 15:16:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312211516.rBLFGT1E083893@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Dec 2013 15:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259683 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 15:16:29 -0000 Author: gjb Date: Sat Dec 21 15:16:28 2013 New Revision: 259683 URL: http://svnweb.freebsd.org/changeset/base/259683 Log: Honor WITHOUT_CASPER. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 15:02:47 2013 (r259682) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 21 15:16:28 2013 (r259683) @@ -358,6 +358,13 @@ OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz .endif +.if ${MK_CASPER} == no +OLD_FILES+=etc/rc.d/casperd +OLD_LIBS+=lib/libcasper.so.0 +OLD_FILES+=sbin/casper +OLD_FILES+=usr/lib/libcasper.a +.endif + .if ${MK_CDDL} == no OLD_LIBS+=lib/libavl.so.2 OLD_LIBS+=lib/libctf.so.2 From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 15:40:38 2013 Return-Path: Delivered-To: svn-src-all@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 F1E14EF6; Sat, 21 Dec 2013 15:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD8911E30; Sat, 21 Dec 2013 15:40:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLFebvX091648; Sat, 21 Dec 2013 15:40:37 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLFeblP091644; Sat, 21 Dec 2013 15:40:37 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312211540.rBLFeblP091644@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 21 Dec 2013 15:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259684 - in head/sys/dev/drm2: radeon ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 15:40:38 -0000 Author: dumbbell Date: Sat Dec 21 15:40:36 2013 New Revision: 259684 URL: http://svnweb.freebsd.org/changeset/base/259684 Log: drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS... ... for msleep/cv_*wait() return values, where wait_event*() is used on Linux. ERESTARTSYS is the return code expected by callers when the operation was interrupted. For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an error. Note that ERESTARTSYS is defined as ERESTART, but this keeps callers' code close to Linux. Submitted by: avg@ (previous version) Modified: head/sys/dev/drm2/radeon/radeon_fence.c head/sys/dev/drm2/radeon/radeon_sa.c head/sys/dev/drm2/ttm/ttm_bo.c head/sys/dev/drm2/ttm/ttm_lock.c Modified: head/sys/dev/drm2/radeon/radeon_fence.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_fence.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/radeon/radeon_fence.c Sat Dec 21 15:40:36 2013 (r259684) @@ -321,6 +321,8 @@ static int radeon_fence_wait_seq(struct &rdev->fence_queue_mtx, timeout); } + if (r == EINTR) + r = ERESTARTSYS; if (r != 0) { if (r == EWOULDBLOCK) { signaled = @@ -334,7 +336,7 @@ static int radeon_fence_wait_seq(struct mtx_unlock(&rdev->fence_queue_mtx); } radeon_irq_kms_sw_irq_put(rdev, ring); - if (unlikely(r == EINTR || r == ERESTART)) { + if (unlikely(r == ERESTARTSYS)) { return -r; } CTR2(KTR_DRM, "radeon fence: wait end (ring=%d, seq=%d)", @@ -514,6 +516,8 @@ static int radeon_fence_wait_any_seq(str &rdev->fence_queue_mtx, timeout); } + if (r == EINTR) + r = ERESTARTSYS; if (r != 0) { if (r == EWOULDBLOCK) { signaled = @@ -531,7 +535,7 @@ static int radeon_fence_wait_any_seq(str radeon_irq_kms_sw_irq_put(rdev, i); } } - if (unlikely(r == EINTR || r == ERESTART)) { + if (unlikely(r == ERESTARTSYS)) { return -r; } CTR2(KTR_DRM, "radeon fence: wait end (ring=%d, target_seq=%d)", Modified: head/sys/dev/drm2/radeon/radeon_sa.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_sa.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/radeon/radeon_sa.c Sat Dec 21 15:40:36 2013 (r259684) @@ -363,6 +363,8 @@ int radeon_sa_bo_new(struct radeon_devic while (!radeon_sa_event(sa_manager, size, align)) { r = -cv_wait_sig(&sa_manager->wq, &sa_manager->wq_lock); + if (r == -EINTR) + r = -ERESTARTSYS; if (r != 0) break; } Modified: head/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 21 15:40:36 2013 (r259684) @@ -147,6 +147,8 @@ ttm_bo_wait_unreserved_locked(struct ttm } while (ttm_bo_is_reserved(bo)) { ret = -msleep(bo, &bo->glob->lru_lock, flags, wmsg, 0); + if (ret == -EINTR) + ret = -ERESTARTSYS; if (ret != 0) break; } Modified: head/sys/dev/drm2/ttm/ttm_lock.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_lock.c Sat Dec 21 15:16:28 2013 (r259683) +++ head/sys/dev/drm2/ttm/ttm_lock.c Sat Dec 21 15:40:36 2013 (r259684) @@ -107,6 +107,8 @@ ttm_read_lock(struct ttm_lock *lock, boo mtx_lock(&lock->lock); while (!__ttm_read_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (ret != 0) break; } @@ -151,6 +153,8 @@ int ttm_read_trylock(struct ttm_lock *lo mtx_lock(&lock->lock); while (!__ttm_read_trylock(lock, &locked)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (ret != 0) break; } @@ -204,6 +208,8 @@ ttm_write_lock(struct ttm_lock *lock, bo /* XXXKIB: linux uses __ttm_read_lock for uninterruptible sleeps */ while (!__ttm_write_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (interruptible && ret != 0) { lock->flags &= ~TTM_WRITE_LOCK_PENDING; wakeup(lock); @@ -280,6 +286,8 @@ int ttm_vt_lock(struct ttm_lock *lock, mtx_lock(&lock->lock); while (!__ttm_vt_lock(lock)) { ret = msleep(lock, &lock->lock, flags, wmsg, 0); + if (ret == EINTR) + ret = ERESTARTSYS; if (interruptible && ret != 0) { lock->flags &= ~TTM_VT_LOCK_PENDING; wakeup(lock); From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:08:28 2013 Return-Path: Delivered-To: svn-src-all@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 56C3437E; Sat, 21 Dec 2013 16:08:28 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 121781F5B; Sat, 21 Dec 2013 16:08:27 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLG8Lel023986 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:08:21 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:08:19 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:08:18 +0000 Message-ID: References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> In-Reply-To: <52B5AA94.3060009@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: multipart/mixed; boundary="_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:08:28 -0000 --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I tried to rationalize... "in what case is it actually _desirably_ that the left or right command key _should_ generate an escape sequence and thus cancel the existing dialog" and I couldn't think of any. That being said... I'm still happy to move it. Can you have a look at the attached patch to see if matches what you envision? -- Devin On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: > Could you please revert this and move the fix to the correct place? > -Nathan > > On 12/16/13 10:06, Nathan Whitehorn wrote: >> Please add this to release/rc.local instead under the console setup. >> There is no guarantee that "auto" is running from an environment where >> this is defined -- for example, it may be running from a serial >> console or an xterm -- and the actual installer should not be polluted >> with assumptions about the media from which it runs. >> -Nathan >> >> On 12/16/13 09:50, Devin Teske wrote: >>> Author: dteske >>> Date: Mon Dec 16 15:50:59 2013 >>> New Revision: 259468 >>> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd= .org/changeset/base/259468&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs= 6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7Ca= Xvls%3D%0A&s=3Daed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459= e2a3 >>> >>> Log: >>> Add a fix for Long-standing problem with VMware. Described in >>> below links: >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmwa= re.com/thread/107230&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2= Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3= D%0A&s=3Deb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 >>> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmwa= re.com/docs/DOC-11677&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%= 2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%= 3D%0A&s=3D2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd >>> Basically, ignore the ``function 62'' and ``function 63'' >>> interpretations >>> of the left/right command key when we're in the lengthiest portion >>> of the >>> installation (initiated by the `auto' module). >>> The net effect is that you can now (once you've started the >>> installer from >>> the media) escape the VM without prematurely terminating the >>> current action >>> due to spurious escape sequence. >>> MFC after: 3 days >>> >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/auto >>> >>> Modified: head/usr.sbin/bsdinstall/scripts/auto >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> >>> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >>> 2013 (r259467) >>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >>> 2013 (r259468) >>> @@ -49,6 +49,10 @@ error() { >>> ############################################################ MAIN >>> +# Don't send ESC on function-key 62/63 (left/right command key) >>> +f_quietly kbdcontrol -f 62 '' >>> +f_quietly kbdcontrol -f 63 '' >>> + >>> f_dprintf "Began Installation at %s" "$( date )" >>> rm -rf $BSDINSTALL_TMPETC >> > _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_ Content-Type: text/plain; name="patch.txt" Content-Description: patch.txt Content-Disposition: attachment; filename="patch.txt"; size=1035; creation-date="Sat, 21 Dec 2013 16:08:18 GMT"; modification-date="Sat, 21 Dec 2013 16:08:18 GMT" Content-ID: <668BD9BA105D2E4C93304124F1A724C4@fisglobal.com> Content-Transfer-Encoding: base64 SW5kZXg6IHJlbGVhc2UvcmMubG9jYWwNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSByZWxlYXNlL3JjLmxvY2Fs CShyZXZpc2lvbiAyNTk2ODQpDQorKysgcmVsZWFzZS9yYy5sb2NhbAkod29ya2luZyBjb3B5KQ0K QEAgLTE5LDYgKzE5LDEwIEBAIGlmIFsgJD8gLWVxIDAgXTsgdGhlbg0KIAkJVEVSTT14dGVybQ0K IAlmaQ0KIA0KKwkjIERvbid0IHNlbmQgRVNDIG9uIGZ1bmN0aW9uLWtleSA2Mi82MyAobGVmdC9y aWdodCBjb21tYW5kIGtleSkNCisJZl9xdWlldGx5IGtiZGNvbnRyb2wgLWYgNjIgJycNCisJZl9x dWlldGx5IGtiZGNvbnRyb2wgLWYgNjMgJycNCisNCiAJaWYgWyAteiAiJEVYVEVSTkFMX1ZUWV9T VEFSVEVEIiBdOyB0aGVuDQogCQkjIEluaXQgd2lsbCBjbGVhbiB0aGVzZSBwcm9jZXNzZXMgdXAg aWYvd2hlbiB0aGUgc3lzdGVtDQogCQkjIGdvZXMgbXVsdGl1c2VyDQpJbmRleDogdXNyLnNiaW4v YnNkaW5zdGFsbC9zY3JpcHRzL2F1dG8NCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSB1c3Iuc2Jpbi9ic2RpbnN0 YWxsL3NjcmlwdHMvYXV0bwkocmV2aXNpb24gMjU5NjE4KQ0KKysrIHVzci5zYmluL2JzZGluc3Rh bGwvc2NyaXB0cy9hdXRvCSh3b3JraW5nIGNvcHkpDQpAQCAtNDksMTAgKzQ5LDYgQEAgZXJyb3Io KSB7DQogDQogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIE1BSU4NCiANCi0jIERvbid0IHNlbmQgRVNDIG9uIGZ1bmN0aW9uLWtleSA2 Mi82MyAobGVmdC9yaWdodCBjb21tYW5kIGtleSkNCi1mX3F1aWV0bHkga2JkY29udHJvbCAtZiA2 MiAnJw0KLWZfcXVpZXRseSBrYmRjb250cm9sIC1mIDYzICcnDQotDQogZl9kcHJpbnRmICJCZWdh biBJbnN0YWxsYXRpb24gYXQgJXMiICIkKCBkYXRlICkiDQogDQogcm0gLXJmICRCU0RJTlNUQUxM X1RNUEVUQw0K --_004_DE2B2BE16A884A1CAADAB6308630634Efisglobalcom_-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:12:11 2013 Return-Path: Delivered-To: svn-src-all@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 BBD1C5B4; Sat, 21 Dec 2013 16:12:11 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 817401FBA; Sat, 21 Dec 2013 16:12:11 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500F00YNS1N00@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:12:04 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.160315, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY5001HSZO1RK20@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:12:03 -0600 (CST) Message-id: <52B5BDD1.3000106@freebsd.org> Date: Sat, 21 Dec 2013 10:12:01 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> In-reply-to: X-Enigmail-Version: 1.5.2 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:12:11 -0000 Looks great, thanks -- although you don't need the f_quietly, which isn't defined there. The issue is that this patch very specific to running the installer on a video console. There are many circumstances in which it is not, in which case this will fail (e.g. a serial console). The other thing is that the installer should not reconfigure the host system unless it has been explicitly asked to. It isn't always run from the install media. If you think the default bindings for these keys don't make sense, then that should ultimately be fixed in the console driver as well. -Nathan On 12/21/13 10:08, Teske, Devin wrote: > I tried to rationalize... "in what case is it actually _desirably_ > that the > left or right command key _should_ generate an escape sequence > and thus cancel the existing dialog" and I couldn't think of any. > > That being said... I'm still happy to move it. Can you have a look at the > attached patch to see if matches what you envision? > > > -- > Devin > > > On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: > > > Could you please revert this and move the fix to the correct place? > > -Nathan > > > > On 12/16/13 10:06, Nathan Whitehorn wrote: > >> Please add this to release/rc.local instead under the console setup. > >> There is no guarantee that "auto" is running from an environment where > >> this is defined -- for example, it may be running from a serial > >> console or an xterm -- and the actual installer should not be polluted > >> with assumptions about the media from which it runs. > >> -Nathan > >> > >> On 12/16/13 09:50, Devin Teske wrote: > >>> Author: dteske > >>> Date: Mon Dec 16 15:50:59 2013 > >>> New Revision: 259468 > >>> URL: > https://urldefense.proofpoint.com/v1/url?u=http://svnweb.freebsd.org/changeset/base/259468&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=aed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459e2a3 > >>> > >>> Log: > >>> Add a fix for Long-standing problem with VMware. Described in > >>> below links: > >>> > https://urldefense.proofpoint.com/v1/url?u=https://communities.vmware.com/thread/107230&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=eb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 > >>> > https://urldefense.proofpoint.com/v1/url?u=https://communities.vmware.com/docs/DOC-11677&k=%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=Mrjs6vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=VPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0A&s=2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd > >>> Basically, ignore the ``function 62'' and ``function 63'' > >>> interpretations > >>> of the left/right command key when we're in the lengthiest portion > >>> of the > >>> installation (initiated by the `auto' module). > >>> The net effect is that you can now (once you've started the > >>> installer from > >>> the media) escape the VM without prematurely terminating the > >>> current action > >>> due to spurious escape sequence. > >>> MFC after: 3 days > >>> > >>> Modified: > >>> head/usr.sbin/bsdinstall/scripts/auto > >>> > >>> Modified: head/usr.sbin/bsdinstall/scripts/auto > >>> > ============================================================================== > >>> > >>> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 > >>> 2013 (r259467) > >>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 > >>> 2013 (r259468) > >>> @@ -49,6 +49,10 @@ error() { > >>> ############################################################ MAIN > >>> +# Don't send ESC on function-key 62/63 (left/right command key) > >>> +f_quietly kbdcontrol -f 62 '' > >>> +f_quietly kbdcontrol -f 63 '' > >>> + > >>> f_dprintf "Began Installation at %s" "$( date )" > >>> rm -rf $BSDINSTALL_TMPETC > >> > > > > _____________ > The information contained in this message is proprietary and/or > confidential. If you are not the intended recipient, please: (i) > delete the message and all copies; (ii) do not disclose, distribute or > use the message in any manner; and (iii) notify the sender > immediately. In addition, please be aware that any message addressed > to our domain is subject to archiving and review by persons other than > the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:23:32 2013 Return-Path: Delivered-To: svn-src-all@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 883107F8; Sat, 21 Dec 2013 16:23:32 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 744011048; Sat, 21 Dec 2013 16:23:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLGNW3Y008810; Sat, 21 Dec 2013 16:23:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLGNVaq008807; Sat, 21 Dec 2013 16:23:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312211623.rBLGNVaq008807@svn.freebsd.org> From: Warner Losh Date: Sat, 21 Dec 2013 16:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259685 - in head/sys: arm/at91 dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:23:32 -0000 Author: imp Date: Sat Dec 21 16:23:31 2013 New Revision: 259685 URL: http://svnweb.freebsd.org/changeset/base/259685 Log: Plumb the cn_grab and cn_ungrab routines down into the uart clients. Mask RX interrupts while grabbed on the atmel serial driver. This UART interrupts every character. When interrupts are enabled at the mountroot> prompt, this means the ISR eats the characters. Rather than try to create a cooperative buffering system for the low level kernel console, instead just mask out the ISR. For NS8250 and decsendents this isn't needed, since interrupts only happen after 14 or more characters (depending on the fifo settings). Plumb such that these are optional so there's no change in behavior for all the other UART clients. ddb worked on this platform because all interrupts were disabled while it was running, so this problem wasn't noticed. The mountroot> issue has been around for a very very long time. MFC after: 3 days Modified: head/sys/arm/at91/uart_dev_at91usart.c head/sys/dev/uart/uart_cpu.h head/sys/dev/uart/uart_tty.c Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Dec 21 16:23:31 2013 (r259685) @@ -219,6 +219,20 @@ at91_usart_param(struct uart_bas *bas, i return (0); } +static void +at91_usart_grab(struct uart_bas *bas) +{ + + WR4(bas, USART_IDR, USART_CSR_RXRDY); +} + +static void +at91_usart_ungrab(struct uart_bas *bas) +{ + + WR4(bas, USART_IER, USART_CSR_RXRDY); +} + static struct uart_ops at91_usart_ops = { .probe = at91_usart_probe, .init = at91_usart_init, @@ -226,6 +240,8 @@ static struct uart_ops at91_usart_ops = .putc = at91_usart_putc, .rxready = at91_usart_rxready, .getc = at91_usart_getc, + .grab = at91_usart_grab, + .ungrab = at91_usart_ungrab, }; static int Modified: head/sys/dev/uart/uart_cpu.h ============================================================================== --- head/sys/dev/uart/uart_cpu.h Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/dev/uart/uart_cpu.h Sat Dec 21 16:23:31 2013 (r259685) @@ -43,6 +43,8 @@ struct uart_ops { void (*putc)(struct uart_bas *, int); int (*rxready)(struct uart_bas *); int (*getc)(struct uart_bas *, struct mtx *); + void (*grab)(struct uart_bas *); + void (*ungrab)(struct uart_bas *); }; extern bus_space_tag_t uart_bus_space_io; @@ -135,6 +137,27 @@ uart_putc(struct uart_devinfo *di, int c uart_unlock(di->hwmtx); } +static __inline void +uart_grab(struct uart_devinfo *di) +{ + + uart_lock(di->hwmtx); + if (di->ops->grab) + di->ops->grab(&di->bas); + uart_unlock(di->hwmtx); +} + +static __inline void +uart_ungrab(struct uart_devinfo *di) +{ + + uart_lock(di->hwmtx); + if (di->ops->ungrab) + di->ops->ungrab(&di->bas); + uart_unlock(di->hwmtx); +} + + static __inline int uart_rxready(struct uart_devinfo *di) { Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Sat Dec 21 15:40:36 2013 (r259684) +++ head/sys/dev/uart/uart_tty.c Sat Dec 21 16:23:31 2013 (r259685) @@ -112,11 +112,15 @@ uart_cnterm(struct consdev *cp) static void uart_cngrab(struct consdev *cp) { + + uart_grab(cp->cn_arg); } static void uart_cnungrab(struct consdev *cp) { + + uart_ungrab(cp->cn_arg); } static void From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:25:21 2013 Return-Path: Delivered-To: svn-src-all@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 7F01394C; Sat, 21 Dec 2013 16:25:21 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF201052; Sat, 21 Dec 2013 16:25:20 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLGPKv3022286 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:25:20 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT06.FNFIS.com ([10.132.206.17]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:25:18 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:25:18 +0000 Message-ID: <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> In-Reply-To: <52B5BDD1.3000106@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <4F302BF9A69A994CA4E515C0147E9C49@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:25:21 -0000 On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: > Looks great, thanks -- although you don't need the f_quietly, which > isn't defined there. >=20 > The issue is that this patch very specific to running the installer on a > video console. There are many circumstances in which it is not, in which > case this will fail (e.g. a serial console). The other thing is that the > installer should not reconfigure the host system unless it has been > explicitly asked to. It isn't always run from the install media. If you > think the default bindings for these keys don't make sense, then that > should ultimately be fixed in the console driver as well. My inspiration for this change came from a tweet in which we were (unjustly or not; doesn't matter) slammed for not having addressed this issue since it (as the person claims) first appeared in 6.x. Having felt the persons pain (and verified that, indeed, we continue to be plagued in 10) I decided to do start researching the problem in-depth. The links I posted in the commit message give an excellent view of the issue and in-fact doesn't even mention using kbdcontrol. Instead it is suggested that we create an alternate keymap that ignores the command keys. That sounds like one approach (and wins points because it is opt- in) but it doesn't solve the problem for me or anyone else running the installer. Perhaps if we had this alternate keymap in the base which does the desired thing (ignore the command keys), then we could just say that the user ought to select said keymap at the onset of the installation process. But I'm not sure *I* like that approach because then it means that for my own testing, I have to select an alternate keymap everytime I run the installer in VMware. Rather, it seems to me that the installation process, if it ignored the command key on every non-serial platform... this would be fine. Afterall, once they get the system installed, they'll have the desired keymap set and they can forget. --=20 Devin > -Nathan >=20 > On 12/21/13 10:08, Teske, Devin wrote: >> I tried to rationalize... "in what case is it actually _desirably_ >> that the >> left or right command key _should_ generate an escape sequence >> and thus cancel the existing dialog" and I couldn't think of any. >>=20 >> That being said... I'm still happy to move it. Can you have a look at the >> attached patch to see if matches what you envision? >>=20 >>=20 >> --=20 >> Devin >>=20 >>=20 >> On Dec 21, 2013, at 6:49 AM, Nathan Whitehorn wrote: >>=20 >>> Could you please revert this and move the fix to the correct place? >>> -Nathan >>>=20 >>> On 12/16/13 10:06, Nathan Whitehorn wrote: >>>> Please add this to release/rc.local instead under the console setup. >>>> There is no guarantee that "auto" is running from an environment where >>>> this is defined -- for example, it may be running from a serial >>>> console or an xterm -- and the actual installer should not be polluted >>>> with assumptions about the media from which it runs. >>>> -Nathan >>>>=20 >>>> On 12/16/13 09:50, Devin Teske wrote: >>>>> Author: dteske >>>>> Date: Mon Dec 16 15:50:59 2013 >>>>> New Revision: 259468 >>>>> URL: >> https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.org/c= hangeset/base/259468&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2= Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3= D%0A&s=3Daed75882069cc72d4a372f6471f113be19fcb6eeeca132b424719ac3b459e2a3 >>>>>=20 >>>>> Log: >>>>> Add a fix for Long-standing problem with VMware. Described in >>>>> below links: >>>>>=20 >> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmware.= com/thread/107230&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2Faj= 2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%0= A&s=3Deb4a25314cb93209718bd46c3a142e1a92fac348d3cdf720b26f416b6061cd17 >>>>>=20 >> https://urldefense.proofpoint.com/v1/url?u=3Dhttps://communities.vmware.= com/docs/DOC-11677&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6vR4%2Fa= j2Ns9%2FssHJjg%3D%3D%0A&m=3DVPzUmM2go2WySxuU4i4nAG5Ox61QodkXwD4Z7CaXvls%3D%= 0A&s=3D2837df54aadfa9de8e081ac53a233ed2dc52f2f4a2be08ae75fefcdd4ee1ddbd >>>>> Basically, ignore the ``function 62'' and ``function 63'' >>>>> interpretations >>>>> of the left/right command key when we're in the lengthiest portion >>>>> of the >>>>> installation (initiated by the `auto' module). >>>>> The net effect is that you can now (once you've started the >>>>> installer from >>>>> the media) escape the VM without prematurely terminating the >>>>> current action >>>>> due to spurious escape sequence. >>>>> MFC after: 3 days >>>>>=20 >>>>> Modified: >>>>> head/usr.sbin/bsdinstall/scripts/auto >>>>>=20 >>>>> Modified: head/usr.sbin/bsdinstall/scripts/auto >>>>>=20 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >>>>>=20 >>>>> --- head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:08:30 >>>>> 2013 (r259467) >>>>> +++ head/usr.sbin/bsdinstall/scripts/auto Mon Dec 16 15:50:59 >>>>> 2013 (r259468) >>>>> @@ -49,6 +49,10 @@ error() { >>>>> ############################################################ MAIN >>>>> +# Don't send ESC on function-key 62/63 (left/right command key) >>>>> +f_quietly kbdcontrol -f 62 '' >>>>> +f_quietly kbdcontrol -f 63 '' >>>>> + >>>>> f_dprintf "Began Installation at %s" "$( date )" >>>>> rm -rf $BSDINSTALL_TMPETC >>>>=20 >>>=20 >>=20 >> _____________ >> The information contained in this message is proprietary and/or >> confidential. If you are not the intended recipient, please: (i) >> delete the message and all copies; (ii) do not disclose, distribute or >> use the message in any manner; and (iii) notify the sender >> immediately. In addition, please be aware that any message addressed >> to our domain is subject to archiving and review by persons other than >> the intended recipient. Thank you. >=20 _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:31:57 2013 Return-Path: Delivered-To: svn-src-all@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 3C240C1F; Sat, 21 Dec 2013 16:31:57 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03B5910C6; Sat, 21 Dec 2013 16:31:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MY500F00YNR1M00@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:31:55 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.21.162415, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (172-12-164-50.lightspeed.wlfrct.sbcglobal.net [172.12.164.50]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MY600K9W0L59000@smtpauth3.wiscmail.wisc.edu>; Sat, 21 Dec 2013 10:31:54 -0600 (CST) Message-id: <52B5C279.4020103@freebsd.org> Date: Sat, 21 Dec 2013 10:31:53 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> In-reply-to: <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> X-Enigmail-Version: 1.5.2 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:31:57 -0000 On 12/21/13 10:25, Teske, Devin wrote: > On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: > >> Looks great, thanks -- although you don't need the f_quietly, which >> isn't defined there. >> >> The issue is that this patch very specific to running the installer on a >> video console. There are many circumstances in which it is not, in which >> case this will fail (e.g. a serial console). The other thing is that the >> installer should not reconfigure the host system unless it has been >> explicitly asked to. It isn't always run from the install media. If you >> think the default bindings for these keys don't make sense, then that >> should ultimately be fixed in the console driver as well. > My inspiration for this change came from a tweet in which we were > (unjustly or not; doesn't matter) slammed for not having addressed > this issue since it (as the person claims) first appeared in 6.x. > > Having felt the persons pain (and verified that, indeed, we continue > to be plagued in 10) I decided to do start researching the problem > in-depth. > > The links I posted in the commit message give an excellent view of > the issue and in-fact doesn't even mention using kbdcontrol. Instead > it is suggested that we create an alternate keymap that ignores the > command keys. > > That sounds like one approach (and wins points because it is opt- > in) but it doesn't solve the problem for me or anyone else running > the installer. > > Perhaps if we had this alternate keymap in the base which does the > desired thing (ignore the command keys), then we could just say that > the user ought to select said keymap at the onset of the installation > process. > > But I'm not sure *I* like that approach because then it means that for > my own testing, I have to select an alternate keymap everytime I run > the installer in VMware. > > Rather, it seems to me that the installation process, if it ignored the > command key on every non-serial platform... this would be fine. > Afterall, once they get the system installed, they'll have the desired > keymap set and they can forget. I'd prefer opt-out -- having the default be the option that is least surprising is a good idea. In any case, moving it to rc.local solves all the immediate problem. -Nathan From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:43:41 2013 Return-Path: Delivered-To: svn-src-all@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 BE049DC0; Sat, 21 Dec 2013 16:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9DFC113C; Sat, 21 Dec 2013 16:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLGhfxD015769; Sat, 21 Dec 2013 16:43:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLGhfEZ015767; Sat, 21 Dec 2013 16:43:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312211643.rBLGhfEZ015767@svn.freebsd.org> From: Devin Teske Date: Sat, 21 Dec 2013 16:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259686 - in head: release usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:43:41 -0000 Author: dteske Date: Sat Dec 21 16:43:40 2013 New Revision: 259686 URL: http://svnweb.freebsd.org/changeset/base/259686 Log: Move the installer's keymap solution introduced by SVN r259468. The new location of /etc/rc.local on the install media is more appropriate as it knows serial vs. non-serial and can also do the change earlier (so that even the initial Install dialog can benefit from the change). MFC after: 3 days Modified: head/release/rc.local head/usr.sbin/bsdinstall/scripts/auto Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Sat Dec 21 16:23:31 2013 (r259685) +++ head/release/rc.local Sat Dec 21 16:43:40 2013 (r259686) @@ -19,6 +19,10 @@ if [ $? -eq 0 ]; then TERM=xterm fi + # Don't send ESC on function-key 62/63 (left/right command key) + kbdcontrol -f 62 '' > /dev/null 2>&1 + kbdcontrol -f 63 '' > /dev/null 2>&1 + if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system # goes multiuser Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sat Dec 21 16:23:31 2013 (r259685) +++ head/usr.sbin/bsdinstall/scripts/auto Sat Dec 21 16:43:40 2013 (r259686) @@ -49,10 +49,6 @@ error() { ############################################################ MAIN -# Don't send ESC on function-key 62/63 (left/right command key) -f_quietly kbdcontrol -f 62 '' -f_quietly kbdcontrol -f 63 '' - f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 16:45:18 2013 Return-Path: Delivered-To: svn-src-all@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 26257FA5; Sat, 21 Dec 2013 16:45:18 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA1421152; Sat, 21 Dec 2013 16:45:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id rBLGjGZP010314 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 21 Dec 2013 10:45:16 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Sat, 21 Dec 2013 10:45:15 -0600 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Topic: svn commit: r259468 - head/usr.sbin/bsdinstall/scripts Thread-Index: AQHO/mbdkcgFyHyrTEqBVO9KeR/sVQ== Date: Sat, 21 Dec 2013 16:45:14 +0000 Message-ID: <3D3536A7-B671-4170-99D0-B5C876BDEEAF@fisglobal.com> References: <201312161550.rBGFox0N001344@svn.freebsd.org> <52AF2502.1060503@freebsd.org> <52B5AA94.3060009@freebsd.org> <52B5BDD1.3000106@freebsd.org> <37E2A444-38C0-4E8C-A2E1-5FA23B9B0FFF@fisglobal.com> <52B5C279.4020103@freebsd.org> In-Reply-To: <52B5C279.4020103@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <1FB00AF9F40C0B489216B98A539BB101@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.87, 1.0.14, 0.0.0000 definitions=2013-12-21_01:2013-12-20,2013-12-21,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 16:45:18 -0000 On Dec 21, 2013, at 8:31 AM, Nathan Whitehorn wrote: > On 12/21/13 10:25, Teske, Devin wrote: >> On Dec 21, 2013, at 8:12 AM, Nathan Whitehorn wrote: >>=20 >>> Looks great, thanks -- although you don't need the f_quietly, which >>> isn't defined there. >>>=20 >>> The issue is that this patch very specific to running the installer on a >>> video console. There are many circumstances in which it is not, in which >>> case this will fail (e.g. a serial console). The other thing is that the >>> installer should not reconfigure the host system unless it has been >>> explicitly asked to. It isn't always run from the install media. If you >>> think the default bindings for these keys don't make sense, then that >>> should ultimately be fixed in the console driver as well. >> My inspiration for this change came from a tweet in which we were >> (unjustly or not; doesn't matter) slammed for not having addressed >> this issue since it (as the person claims) first appeared in 6.x. >>=20 >> Having felt the persons pain (and verified that, indeed, we continue >> to be plagued in 10) I decided to do start researching the problem >> in-depth. >>=20 >> The links I posted in the commit message give an excellent view of >> the issue and in-fact doesn't even mention using kbdcontrol. Instead >> it is suggested that we create an alternate keymap that ignores the >> command keys. >>=20 >> That sounds like one approach (and wins points because it is opt- >> in) but it doesn't solve the problem for me or anyone else running >> the installer. >>=20 >> Perhaps if we had this alternate keymap in the base which does the >> desired thing (ignore the command keys), then we could just say that >> the user ought to select said keymap at the onset of the installation >> process. >>=20 >> But I'm not sure *I* like that approach because then it means that for >> my own testing, I have to select an alternate keymap everytime I run >> the installer in VMware. >>=20 >> Rather, it seems to me that the installation process, if it ignored the >> command key on every non-serial platform... this would be fine. >> Afterall, once they get the system installed, they'll have the desired >> keymap set and they can forget. >=20 > I'd prefer opt-out -- having the default be the option that is least > surprising is a good idea. In any case, moving it to rc.local solves all > the immediate problem. We can think about changing keymaps for the base later; for now, I've moved the kbdcontrol invocations to the new spot (SVN r259686). Much better if I do say so myself; much thanks for the suggested new location. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 18:47:05 2013 Return-Path: Delivered-To: svn-src-all@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 A4560EDE; Sat, 21 Dec 2013 18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AFCE19EA; Sat, 21 Dec 2013 18:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLIl5mO059225; Sat, 21 Dec 2013 18:47:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLIl1an059190; Sat, 21 Dec 2013 18:47:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312211847.rBLIl1an059190@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 21 Dec 2013 18:47: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: r259694 - in stable/10/contrib: binutils/binutils gcc gcc/cp gcc/doc gcclibs/libiberty gcclibs/libiberty/testsuite libstdc++/include/bits libstdc++/include/ext libstdc++/libsupc++ libst... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 18:47:05 -0000 Author: pfg Date: Sat Dec 21 18:47:00 2013 New Revision: 259694 URL: http://svnweb.freebsd.org/changeset/base/259694 Log: MFC r258017, r258429, r258748, r258817: Merge updates from FSF pre4.3 GCC inspired on Apple's gcc: Updates to libiberty and mangling. New align attribute. Merge Apple updates to libstdc++. Added: stable/10/contrib/gcclibs/libiberty/ChangeLog.gcc43 - copied unchanged from r258817, head/contrib/gcclibs/libiberty/ChangeLog.gcc43 Modified: stable/10/contrib/binutils/binutils/cxxfilt.c stable/10/contrib/gcc/ChangeLog.gcc43 stable/10/contrib/gcc/builtins.c stable/10/contrib/gcc/c-common.c stable/10/contrib/gcc/c-decl.c stable/10/contrib/gcc/cp/ChangeLog.gcc43 stable/10/contrib/gcc/cp/decl.c stable/10/contrib/gcc/cp/mangle.c stable/10/contrib/gcc/cp/typeck.c stable/10/contrib/gcc/doc/extend.texi stable/10/contrib/gcc/flags.h stable/10/contrib/gcc/print-tree.c stable/10/contrib/gcc/toplev.c stable/10/contrib/gcc/tree.c stable/10/contrib/gcc/tree.h stable/10/contrib/gcc/varasm.c stable/10/contrib/gcclibs/libiberty/choose-temp.c stable/10/contrib/gcclibs/libiberty/cp-demangle.c stable/10/contrib/gcclibs/libiberty/cp-demangle.h stable/10/contrib/gcclibs/libiberty/floatformat.c stable/10/contrib/gcclibs/libiberty/functions.texi stable/10/contrib/gcclibs/libiberty/pex-unix.c stable/10/contrib/gcclibs/libiberty/strsignal.c stable/10/contrib/gcclibs/libiberty/testsuite/demangle-expected stable/10/contrib/gcclibs/libiberty/testsuite/test-demangle.c stable/10/contrib/libstdc++/include/bits/basic_string.h stable/10/contrib/libstdc++/include/bits/basic_string.tcc stable/10/contrib/libstdc++/include/bits/stl_algobase.h stable/10/contrib/libstdc++/include/bits/stl_tree.h stable/10/contrib/libstdc++/include/bits/stl_vector.h stable/10/contrib/libstdc++/include/ext/mt_allocator.h stable/10/contrib/libstdc++/include/ext/throw_allocator.h stable/10/contrib/libstdc++/libsupc++/eh_alloc.cc stable/10/contrib/libstdc++/src/mt_allocator.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/binutils/cxxfilt.c ============================================================================== --- stable/10/contrib/binutils/binutils/cxxfilt.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/binutils/binutils/cxxfilt.c Sat Dec 21 18:47:00 2013 (r259694) @@ -63,12 +63,12 @@ demangle_it (char *mangled_name) result = cplus_demangle (mangled_name + skip_first, flags); if (result == NULL) - printf (mangled_name); + printf ("%s",mangled_name); else { if (mangled_name[0] == '.') putchar ('.'); - printf (result); + printf ("%s",result); free (result); } } Modified: stable/10/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/ChangeLog.gcc43 Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/ChangeLog.gcc43 Sat Dec 21 18:47:00 2013 (r259694) @@ -4,6 +4,47 @@ * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New. * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New. +2007-07-12 Geoffrey Keating (r126588) + + * builtins.c (get_pointer_alignment): Honor DECL_ALIGN on a + FUNCTION_DECL. + * tree.c (build_decl_stat): Move code from here... + (make_node_stat): ... to here. Don't uselessly clear DECL_USER_ALIGN. + (expr_align): Honor DECL_ALIGN on a FUNCTION_DECL. Add comment + about using DECL_ALIGN of LABEL_DECL and CONST_DECL. + * tree.h (DECL_USER_ALIGN): Fix misplaced comment. + * varasm.c (assemble_start_function): Use DECL_ALIGN instead of + FUNCTION_BOUNDARY. + +2007-07-09 Geoffrey Keating (r126529) + + PR 32617 + * c-common.c (c_alignof_expr): Look at DECL_ALIGN of + FUNCTION_DECLs. + (handle_aligned_attribute): Allow use on FUNCTION_DECLs. + * varasm.c (assemble_start_function): Honor DECL_ALIGN + for FUNCTION_DECLs. Don't use align_functions_log if + DECL_USER_ALIGN. + * print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN + even for FUNCTION_DECLs. + * c-decl.c (merge_decls): Propagate DECL_ALIGN even for + FUNCTION_DECLs. + * tree.h (DECL_ALIGN): Update for new location of 'align'. + (DECL_FUNCTION_CODE): Update for new location and name of + 'function_code'. + (DECL_OFFSET_ALIGN): Update for new location of 'off_align'. + (struct tree_decl_common): Move 'align' and 'off_align' out + of union, ensure they're still on a 32-bit boundary. Remove + other fields in union 'u1'. + (struct tree_function_decl): Add field 'function_code' replacing + 'u1.f' in tree_decl_common. + * tree.c (build_decl_stat): Set initial value of DECL_ALIGN. + * doc/extend.texi (Function Attributes): Add 'aligned' attribute. + (Variable Attributes): Cross-reference 'aligned' attribute + to Function Attributes. + * flags.h (force_align_functions_log): Delete. + * toplev.c (force_align_functions_log): Delete. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 @@ -68,7 +109,7 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. -2007-04-16 Lawrence Crowl +2007-04-16 Lawrence Crowl (r123909) * doc/invoke.texi (Debugging Options): Add documentation for the -femit-struct-debug options -femit-struct-debug-baseonly, @@ -147,7 +188,7 @@ * config/i386/i386.c (override_options): Likewise. * doc/invoke.texi: Likewise. -2007-03-12 Seongbae Park +2007-03-12 Seongbae Park (r122851) * c-decl.c (warn_variable_length_array): New function. Refactored from grokdeclarator to handle warn_vla @@ -348,7 +389,7 @@ * config.gcc: Support core2 processor. -2007-01-05 Manuel Lopez-Ibanez +2007-01-05 Manuel Lopez-Ibanez (r120505) PR c/19978 * tree.h (TREE_OVERFLOW_P): New. Modified: stable/10/contrib/gcc/builtins.c ============================================================================== --- stable/10/contrib/gcc/builtins.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/builtins.c Sat Dec 21 18:47:00 2013 (r259694) @@ -315,9 +315,7 @@ get_pointer_alignment (tree exp, unsigne else if (offset) inner = MIN (inner, BITS_PER_UNIT); } - if (TREE_CODE (exp) == FUNCTION_DECL) - align = FUNCTION_BOUNDARY; - else if (DECL_P (exp)) + if (DECL_P (exp)) align = MIN (inner, DECL_ALIGN (exp)); #ifdef CONSTANT_ALIGNMENT else if (CONSTANT_CLASS_P (exp)) Modified: stable/10/contrib/gcc/c-common.c ============================================================================== --- stable/10/contrib/gcc/c-common.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/c-common.c Sat Dec 21 18:47:00 2013 (r259694) @@ -2995,16 +2995,16 @@ c_sizeof_or_alignof_type (tree type, boo } /* Implement the __alignof keyword: Return the minimum required - alignment of EXPR, measured in bytes. For VAR_DECL's and - FIELD_DECL's return DECL_ALIGN (which can be set from an - "aligned" __attribute__ specification). */ + alignment of EXPR, measured in bytes. For VAR_DECLs, + FUNCTION_DECLs and FIELD_DECLs return DECL_ALIGN (which can be set + from an "aligned" __attribute__ specification). */ tree c_alignof_expr (tree expr) { tree t; - if (TREE_CODE (expr) == VAR_DECL) + if (VAR_OR_FUNCTION_DECL_P (expr)) t = size_int (DECL_ALIGN_UNIT (expr)); else if (TREE_CODE (expr) == COMPONENT_REF @@ -4809,12 +4809,24 @@ handle_aligned_attribute (tree *node, tr TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT; TYPE_USER_ALIGN (*type) = 1; } - else if (TREE_CODE (decl) != VAR_DECL + else if (! VAR_OR_FUNCTION_DECL_P (decl) && TREE_CODE (decl) != FIELD_DECL) { error ("alignment may not be specified for %q+D", decl); *no_add_attrs = true; } + else if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_ALIGN (decl) > (1 << i) * BITS_PER_UNIT) + { + if (DECL_USER_ALIGN (decl)) + error ("alignment for %q+D was previously specified as %d " + "and may not be decreased", decl, + DECL_ALIGN (decl) / BITS_PER_UNIT); + else + error ("alignment for %q+D must be at least %d", decl, + DECL_ALIGN (decl) / BITS_PER_UNIT); + *no_add_attrs = true; + } else { DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT; Modified: stable/10/contrib/gcc/c-decl.c ============================================================================== --- stable/10/contrib/gcc/c-decl.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/c-decl.c Sat Dec 21 18:47:00 2013 (r259694) @@ -1690,12 +1690,11 @@ merge_decls (tree newdecl, tree olddecl, DECL_SIZE (newdecl) = DECL_SIZE (olddecl); DECL_SIZE_UNIT (newdecl) = DECL_SIZE_UNIT (olddecl); DECL_MODE (newdecl) = DECL_MODE (olddecl); - if (TREE_CODE (olddecl) != FUNCTION_DECL) - if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl)) - { - DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl); - DECL_USER_ALIGN (newdecl) |= DECL_ALIGN (olddecl); - } + if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl)) + { + DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl); + DECL_USER_ALIGN (newdecl) |= DECL_ALIGN (olddecl); + } } Modified: stable/10/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/cp/ChangeLog.gcc43 Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/cp/ChangeLog.gcc43 Sat Dec 21 18:47:00 2013 (r259694) @@ -1,3 +1,12 @@ +2007-07-09 Geoffrey Keating (r126529) + + PR 32617 + * decl.c (cxx_init_decl_processing): Don't set + force_align_functions_log. + (grokfndecl): Honour ptrmemfunc_vbit_in_pfn. + * typeck.c (cxx_alignof_expr): When alignof is used on a plain + FUNCTION_DECL, return its alignment. + 2007-06-28 Geoffrey Keating (r126080) * decl2.c (start_objects): Mark constructor-runnning function @@ -9,6 +18,13 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. +2007-05-05 Geoffrey Keating (r124467) + + PR 31775 + * mangle.c (write_mangled_name): Mangle static variable names. + (write_unqualified_name): Use local-source-name for + namespace-scope static variables. + 2007-03-12 Seongbae Park (r122851) * decl.c (compute_array_index_type): New warning flag warn_vla. Modified: stable/10/contrib/gcc/cp/decl.c ============================================================================== --- stable/10/contrib/gcc/cp/decl.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/cp/decl.c Sat Dec 21 18:47:00 2013 (r259694) @@ -3158,12 +3158,6 @@ cxx_init_decl_processing (void) if (flag_inline_functions) flag_inline_trees = 2; - /* Force minimum function alignment if using the least significant - bit of function pointers to store the virtual bit. */ - if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn - && force_align_functions_log < 1) - force_align_functions_log = 1; - /* Initially, C. */ current_lang_name = lang_name_c; @@ -6065,6 +6059,14 @@ grokfndecl (tree ctype, if (TYPE_VOLATILE (type)) TREE_THIS_VOLATILE (decl) = 1; + /* If pointers to member functions use the least significant bit to + indicate whether a function is virtual, ensure a pointer + to this function will have that bit clear. */ + if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn + && TREE_CODE (type) == METHOD_TYPE + && DECL_ALIGN (decl) < 2 * BITS_PER_UNIT) + DECL_ALIGN (decl) = 2 * BITS_PER_UNIT; + if (friendp && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR) { Modified: stable/10/contrib/gcc/cp/mangle.c ============================================================================== --- stable/10/contrib/gcc/cp/mangle.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/cp/mangle.c Sat Dec 21 18:47:00 2013 (r259694) @@ -688,7 +688,8 @@ write_mangled_name (const tree decl, boo } } else if (TREE_CODE (decl) == VAR_DECL - /* The names of global variables aren't mangled. */ + /* The names of non-static global variables aren't mangled. */ + && DECL_EXTERNAL_LINKAGE_P (decl) && (CP_DECL_CONTEXT (decl) == global_namespace /* And neither are `extern "C"' variables. */ || DECL_EXTERN_C_P (decl))) @@ -1086,7 +1087,10 @@ write_template_prefix (const tree node) ::= ::= - ::= */ + ::= + ::= + + ::= L */ static void write_unqualified_name (const tree decl) @@ -1126,6 +1130,16 @@ write_unqualified_name (const tree decl) write_string (oni[DECL_OVERLOADED_OPERATOR_P (decl)].mangled_name); } + else if (VAR_OR_FUNCTION_DECL_P (decl) && ! TREE_PUBLIC (decl) + && DECL_NAMESPACE_SCOPE_P (decl) + && decl_linkage (decl) == lk_internal) + { + MANGLE_TRACE_TREE ("local-source-name", decl); + write_char ('L'); + write_source_name (DECL_NAME (decl)); + /* The default discriminator is 1, and that's all we ever use, + so there's no code to output one here. */ + } else write_source_name (DECL_NAME (decl)); } Modified: stable/10/contrib/gcc/cp/typeck.c ============================================================================== --- stable/10/contrib/gcc/cp/typeck.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/cp/typeck.c Sat Dec 21 18:47:00 2013 (r259694) @@ -1358,7 +1358,10 @@ cxx_alignof_expr (tree e) { pedwarn ("ISO C++ forbids applying %<__alignof%> to an expression of " "function type"); - t = size_one_node; + if (TREE_CODE (e) == FUNCTION_DECL) + t = size_int (DECL_ALIGN_UNIT (e)); + else + t = size_one_node; } else if (type_unknown_p (e)) { Modified: stable/10/contrib/gcc/doc/extend.texi ============================================================================== --- stable/10/contrib/gcc/doc/extend.texi Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/doc/extend.texi Sat Dec 21 18:47:00 2013 (r259694) @@ -1577,6 +1577,7 @@ The keyword @code{__attribute__} allows attributes when making a declaration. This keyword is followed by an attribute specification inside double parentheses. The following attributes are currently defined for functions on all targets: +@code{aligned}, @code{noreturn}, @code{returns_twice}, @code{noinline}, @code{always_inline}, @code{flatten}, @code{pure}, @code{const}, @code{nothrow}, @code{sentinel}, @code{format}, @code{format_arg}, @code{no_instrument_function}, @@ -1615,6 +1616,27 @@ is not defined in the same translation u Not all target machines support this attribute. +@item aligned (@var{alignment}) +@cindex @code{aligned} attribute +This attribute specifies a minimum alignment for the function, +measured in bytes. + +You cannot use this attribute to decrease the alignment of a function, +only to increase it. However, when you explicitly specify a function +alignment this will override the effect of the +@option{-falign-functions} (@pxref{Optimize Options}) option for this +function. + +Note that the effectiveness of @code{aligned} attributes may be +limited by inherent limitations in your linker. On many systems, the +linker is only able to arrange for functions to be aligned up to a +certain maximum alignment. (For some linkers, the maximum supported +alignment may be very very small.) See your linker documentation for +further information. + +The @code{aligned} attribute can also be used for variables and fields +(@pxref{Variable Attributes}.) + @item always_inline @cindex @code{always_inline} function attribute Generally, functions are not inlined unless optimization is specified. @@ -3044,6 +3066,9 @@ up to a maximum of 8 byte alignment, the in an @code{__attribute__} will still only provide you with 8 byte alignment. See your linker documentation for further information. +The @code{aligned} attribute can also be used for functions +(@pxref{Function Attributes}.) + @item cleanup (@var{cleanup_function}) @cindex @code{cleanup} attribute The @code{cleanup} attribute runs a function when the variable goes Modified: stable/10/contrib/gcc/flags.h ============================================================================== --- stable/10/contrib/gcc/flags.h Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/flags.h Sat Dec 21 18:47:00 2013 (r259694) @@ -261,10 +261,6 @@ extern int align_labels_log; extern int align_labels_max_skip; extern int align_functions_log; -/* Like align_functions_log above, but used by front-ends to force the - minimum function alignment. Zero means no alignment is forced. */ -extern int force_align_functions_log; - /* Nonzero if we dump in VCG format, not plain text. */ extern int dump_for_graph; Modified: stable/10/contrib/gcc/print-tree.c ============================================================================== --- stable/10/contrib/gcc/print-tree.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/print-tree.c Sat Dec 21 18:47:00 2013 (r259694) @@ -439,17 +439,15 @@ print_node (FILE *file, const char *pref || DECL_INLINE (node) || DECL_BUILT_IN (node)) indent_to (file, indent + 3); - if (TREE_CODE (node) != FUNCTION_DECL) - { - if (DECL_USER_ALIGN (node)) - fprintf (file, " user"); - - fprintf (file, " align %d", DECL_ALIGN (node)); - if (TREE_CODE (node) == FIELD_DECL) - fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED, - DECL_OFFSET_ALIGN (node)); - } - else if (DECL_BUILT_IN (node)) + if (DECL_USER_ALIGN (node)) + fprintf (file, " user"); + + fprintf (file, " align %d", DECL_ALIGN (node)); + if (TREE_CODE (node) == FIELD_DECL) + fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED, + DECL_OFFSET_ALIGN (node)); + + if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node)) { if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD) fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node)); Modified: stable/10/contrib/gcc/toplev.c ============================================================================== --- stable/10/contrib/gcc/toplev.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/toplev.c Sat Dec 21 18:47:00 2013 (r259694) @@ -369,10 +369,6 @@ int align_labels_log; int align_labels_max_skip; int align_functions_log; -/* Like align_functions_log above, but used by front-ends to force the - minimum function alignment. Zero means no alignment is forced. */ -int force_align_functions_log; - typedef struct { const char *const string; Modified: stable/10/contrib/gcc/tree.c ============================================================================== --- stable/10/contrib/gcc/tree.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/tree.c Sat Dec 21 18:47:00 2013 (r259694) @@ -541,9 +541,13 @@ make_node_stat (enum tree_code code MEM_ DECL_IN_SYSTEM_HEADER (t) = in_system_header; if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) { - if (code != FUNCTION_DECL) + if (code == FUNCTION_DECL) + { + DECL_ALIGN (t) = FUNCTION_BOUNDARY; + DECL_MODE (t) = FUNCTION_MODE; + } + else DECL_ALIGN (t) = 1; - DECL_USER_ALIGN (t) = 0; /* We have not yet computed the alias set for this declaration. */ DECL_POINTER_ALIAS_SET (t) = -1; } @@ -1881,14 +1885,13 @@ expr_align (tree t) align1 = expr_align (TREE_OPERAND (t, 2)); return MIN (align0, align1); + /* FIXME: LABEL_DECL and CONST_DECL never have DECL_ALIGN set + meaningfully, it's always 1. */ case LABEL_DECL: case CONST_DECL: case VAR_DECL: case PARM_DECL: case RESULT_DECL: - if (DECL_ALIGN (t) != 0) - return DECL_ALIGN (t); - break; - case FUNCTION_DECL: - return FUNCTION_BOUNDARY; + gcc_assert (DECL_ALIGN (t) != 0); + return DECL_ALIGN (t); default: break; @@ -3174,8 +3177,6 @@ build_decl_stat (enum tree_code code, tr if (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL) layout_decl (t, 0); - else if (code == FUNCTION_DECL) - DECL_MODE (t) = FUNCTION_MODE; return t; } Modified: stable/10/contrib/gcc/tree.h ============================================================================== --- stable/10/contrib/gcc/tree.h Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/tree.h Sat Dec 21 18:47:00 2013 (r259694) @@ -2426,13 +2426,11 @@ struct tree_struct_field_tag GTY(()) /* Likewise for the size in bytes. */ #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit) /* Holds the alignment required for the datum, in bits. */ -#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.u1.a.align) +#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align) /* The alignment of NODE, in bytes. */ #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT) -/* For FIELD_DECLs, off_align holds the number of low-order bits of - DECL_FIELD_OFFSET which are known to be always zero. - DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET - has. */ +/* Set if the alignment of this DECL has been set by the user, for + example with an 'aligned' attribute. */ #define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.user_align) /* Holds the machine mode corresponding to the declaration of a variable or field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a @@ -2443,7 +2441,8 @@ struct tree_struct_field_tag GTY(()) operation it is. Note, however, that this field is overloaded, with DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be checked before any access to the former. */ -#define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_common.u1.f) +#define DECL_FUNCTION_CODE(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code) #define DECL_DEBUG_EXPR_IS_FROM(NODE) \ (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from) @@ -2581,20 +2580,9 @@ struct tree_decl_common GTY(()) unsigned gimple_reg_flag : 1; unsigned call_clobbered_flag : 1; - union tree_decl_u1 { - /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is - DECL_FUNCTION_CODE. */ - enum built_in_function f; - /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this - is used by language-dependent code. */ - HOST_WIDE_INT i; - /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for - FUNCTION_DECLs). */ - struct tree_decl_u1_a { - unsigned int align : 24; - unsigned int off_align : 8; - } a; - } GTY ((skip)) u1; + unsigned int align : 24; + /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ + unsigned int off_align : 8; tree size_unit; tree initial; @@ -2679,11 +2667,11 @@ struct tree_decl_with_rtl GTY(()) DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET has. */ #define DECL_OFFSET_ALIGN(NODE) \ - (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align) + (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align) /* Specify that DECL_ALIGN(NODE) is a multiple of X. */ #define SET_DECL_OFFSET_ALIGN(NODE, X) \ - (FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align = exact_log2 ((X) & -(X))) + (FIELD_DECL_CHECK (NODE)->decl_common.off_align = exact_log2 ((X) & -(X))) /* 1 if the alignment for this type was requested by "aligned" attribute, 0 if it is the default for this type. */ @@ -3096,6 +3084,10 @@ struct tree_function_decl GTY(()) { struct tree_decl_non_common common; + /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is + DECL_FUNCTION_CODE. Otherwise unused. */ + enum built_in_function function_code; + unsigned static_ctor_flag : 1; unsigned static_dtor_flag : 1; unsigned uninlinable : 1; Modified: stable/10/contrib/gcc/varasm.c ============================================================================== --- stable/10/contrib/gcc/varasm.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcc/varasm.c Sat Dec 21 18:47:00 2013 (r259694) @@ -1383,7 +1383,7 @@ assemble_start_function (tree decl, cons if (flag_reorder_blocks_and_partition) { switch_to_section (unlikely_text_section ()); - assemble_align (FUNCTION_BOUNDARY); + assemble_align (DECL_ALIGN (decl)); ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label); /* When the function starts with a cold section, we need to explicitly @@ -1393,7 +1393,7 @@ assemble_start_function (tree decl, cons && BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION) { switch_to_section (text_section); - assemble_align (FUNCTION_BOUNDARY); + assemble_align (DECL_ALIGN (decl)); ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label); hot_label_written = true; first_function_block_is_cold = true; @@ -1424,18 +1424,17 @@ assemble_start_function (tree decl, cons ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label); /* Tell assembler to move to target machine's alignment for functions. */ - align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); - if (align < force_align_functions_log) - align = force_align_functions_log; + align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT); if (align > 0) { ASM_OUTPUT_ALIGN (asm_out_file, align); } /* Handle a user-specified function alignment. - Note that we still need to align to FUNCTION_BOUNDARY, as above, + Note that we still need to align to DECL_ALIGN, as above, because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */ - if (align_functions_log > align + if (! DECL_USER_ALIGN (decl) + && align_functions_log > align && cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN Copied: stable/10/contrib/gcclibs/libiberty/ChangeLog.gcc43 (from r258817, head/contrib/gcclibs/libiberty/ChangeLog.gcc43) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/gcclibs/libiberty/ChangeLog.gcc43 Sat Dec 21 18:47:00 2013 (r259694, copy of r258817, head/contrib/gcclibs/libiberty/ChangeLog.gcc43) @@ -0,0 +1,60 @@ +2007-05-05 Geoffrey Keating (r124467) + + PR 31775 + * mangle.c (write_mangled_name): Mangle static variable names. + (write_unqualified_name): Use local-source-name for + namespace-scope static variables. + +2007-03-15 Geoffrey Keating (r122972) + + * cp-demangle.c (d_encoding): Exit early on error. + (d_pointer_to_member_type): Exit early if cplus_demangle_type + returns NULL. + (cplus_demangle_type): Likewise. + * testsuite/demangle-expected: New testcase. + +2007-01-31 Ben Elliston (r121364) + + * strsignal.c (psignal): Change type of signo to int. + * functions.texi: Regenerate. + +2007-01-12 Ben Elliston (r120702) + + * pex-unix.c (writeerr): Cast write result to void. + + * choose-temp.c (choose_temp_base): Check the result of the call + to mktemp rather than testing the length of the modified string. + +2006-12-20 Geoffrey Keating (r120097) + + * cp-demangle.h: Add comment explaining what to do to avoid + overrunning string. + (d_check_char): New. + (d_next_char): Don't advance past trailing '\0'. + * cp-demangle.c (cplus_demangle_mangled_name): Use d_check_char. + (d_nested_name): Likewise. + (d_special_name): Likewise. + (d_call_offset): Likewise. + (d_function_type): Likewise. + (d_array_type): Likewise. + (d_pointer_to_member_type): Likewise. + (d_template_param): Likewise. + (d_template_args): Likewise. + (d_template_arg): Likewise. + (d_expr_primary): Likewise. + (d_local_name): Likewise. + (d_substitution): Likewise. + (d_ctor_dtor_name): Use d_advance rather than d_next_char. + * testsuite/test-demangle.c: Include sys/mman.h. + (MAP_ANONYMOUS): Define. + (protect_end): New. + (main): Use protect_end. + * testsuite/demangle-expected: Add testcases for overrunning + the end of the string. + +2006-11-07 Julian Brown (r118552) + + * floatformat.c (get_field): Fix segfault with little-endian word + order on 64-bit hosts. + (put_field): Likewise. + (min): Move definition. Modified: stable/10/contrib/gcclibs/libiberty/choose-temp.c ============================================================================== --- stable/10/contrib/gcclibs/libiberty/choose-temp.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcclibs/libiberty/choose-temp.c Sat Dec 21 18:47:00 2013 (r259694) @@ -65,8 +65,7 @@ choose_temp_base (void) strcpy (temp_filename, base); strcpy (temp_filename + len, TEMP_FILE); - mktemp (temp_filename); - if (strlen (temp_filename) == 0) + if (mktemp (temp_filename) == 0) abort (); return temp_filename; } Modified: stable/10/contrib/gcclibs/libiberty/cp-demangle.c ============================================================================== --- stable/10/contrib/gcclibs/libiberty/cp-demangle.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcclibs/libiberty/cp-demangle.c Sat Dec 21 18:47:00 2013 (r259694) @@ -913,9 +913,9 @@ CP_STATIC_IF_GLIBCPP_V3 struct demangle_component * cplus_demangle_mangled_name (struct d_info *di, int top_level) { - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return NULL; - if (d_next_char (di) != 'Z') + if (! d_check_char (di, 'Z')) return NULL; return d_encoding (di, top_level); } @@ -1021,7 +1021,7 @@ d_encoding (struct d_info *di, int top_l } peek = d_peek_char (di); - if (peek == '\0' || peek == 'E') + if (dc == NULL || peek == '\0' || peek == 'E') return dc; return d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME, dc, d_bare_function_type (di, has_return_type (dc))); @@ -1054,6 +1054,9 @@ d_name (struct d_info *di) case 'Z': return d_local_name (di); + case 'L': + return d_unqualified_name (di); + case 'S': { int subst; @@ -1123,7 +1126,7 @@ d_nested_name (struct d_info *di) struct demangle_component *ret; struct demangle_component **pret; - if (d_next_char (di) != 'N') + if (! d_check_char (di, 'N')) return NULL; pret = d_cv_qualifiers (di, &ret, 1); @@ -1134,7 +1137,7 @@ d_nested_name (struct d_info *di) if (*pret == NULL) return NULL; - if (d_next_char (di) != 'E') + if (! d_check_char (di, 'E')) return NULL; return ret; @@ -1174,7 +1177,8 @@ d_prefix (struct d_info *di) if (IS_DIGIT (peek) || IS_LOWER (peek) || peek == 'C' - || peek == 'D') + || peek == 'D' + || peek == 'L') dc = d_unqualified_name (di); else if (peek == 'S') dc = d_substitution (di, 1); @@ -1208,6 +1212,9 @@ d_prefix (struct d_info *di) /* ::= ::= ::= + ::= + + ::= L */ static struct demangle_component * @@ -1229,6 +1236,19 @@ d_unqualified_name (struct d_info *di) } else if (peek == 'C' || peek == 'D') return d_ctor_dtor_name (di); + else if (peek == 'L') + { + struct demangle_component * ret; + + d_advance (di, 1); + + ret = d_source_name (di); + if (ret == NULL) + return NULL; + if (! d_discriminator (di)) + return NULL; + return ret; + } else return NULL; } @@ -1449,11 +1469,8 @@ d_operator_name (struct d_info *di) static struct demangle_component * d_special_name (struct d_info *di) { - char c; - di->expansion += 20; - c = d_next_char (di); - if (c == 'T') + if (d_check_char (di, 'T')) { switch (d_next_char (di)) { @@ -1502,7 +1519,7 @@ d_special_name (struct d_info *di) offset = d_number (di); if (offset < 0) return NULL; - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return NULL; base_type = cplus_demangle_type (di); /* We don't display the offset. FIXME: We should display @@ -1523,7 +1540,7 @@ d_special_name (struct d_info *di) return NULL; } } - else if (c == 'G') + else if (d_check_char (di, 'G')) { switch (d_next_char (di)) { @@ -1570,14 +1587,14 @@ d_call_offset (struct d_info *di, int c) else if (c == 'v') { d_number (di); - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return 0; d_number (di); } else return 0; - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return 0; return 1; @@ -1601,13 +1618,13 @@ d_ctor_dtor_name (struct d_info *di) else if (di->last_name->type == DEMANGLE_COMPONENT_SUB_STD) di->expansion += di->last_name->u.s_string.len; } - switch (d_next_char (di)) + switch (d_peek_char (di)) { case 'C': { enum gnu_v3_ctor_kinds kind; - switch (d_next_char (di)) + switch (d_peek_next_char (di)) { case '1': kind = gnu_v3_complete_object_ctor; @@ -1621,6 +1638,7 @@ d_ctor_dtor_name (struct d_info *di) default: return NULL; } + d_advance (di, 2); return d_make_ctor (di, kind, di->last_name); } @@ -1628,7 +1646,7 @@ d_ctor_dtor_name (struct d_info *di) { enum gnu_v3_dtor_kinds kind; - switch (d_next_char (di)) + switch (d_peek_next_char (di)) { case '0': kind = gnu_v3_deleting_dtor; @@ -1642,6 +1660,7 @@ d_ctor_dtor_name (struct d_info *di) default: return NULL; } + d_advance (di, 2); return d_make_dtor (di, kind, di->last_name); } @@ -1735,7 +1754,7 @@ cplus_demangle_type (struct d_info *di) if (pret == NULL) return NULL; *pret = cplus_demangle_type (di); - if (! d_add_substitution (di, ret)) + if (! *pret || ! d_add_substitution (di, ret)) return NULL; return ret; } @@ -1925,7 +1944,7 @@ d_function_type (struct d_info *di) { struct demangle_component *ret; - if (d_next_char (di) != 'F') + if (! d_check_char (di, 'F')) return NULL; if (d_peek_char (di) == 'Y') { @@ -1934,7 +1953,7 @@ d_function_type (struct d_info *di) d_advance (di, 1); } ret = d_bare_function_type (di, 1); - if (d_next_char (di) != 'E') + if (! d_check_char (di, 'E')) return NULL; return ret; } @@ -2021,7 +2040,7 @@ d_array_type (struct d_info *di) char peek; struct demangle_component *dim; - if (d_next_char (di) != 'A') + if (! d_check_char (di, 'A')) return NULL; peek = d_peek_char (di); @@ -2049,7 +2068,7 @@ d_array_type (struct d_info *di) return NULL; } - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return NULL; return d_make_comp (di, DEMANGLE_COMPONENT_ARRAY_TYPE, dim, @@ -2065,7 +2084,7 @@ d_pointer_to_member_type (struct d_info struct demangle_component *mem; struct demangle_component **pmem; - if (d_next_char (di) != 'M') + if (! d_check_char (di, 'M')) return NULL; cl = cplus_demangle_type (di); @@ -2090,6 +2109,8 @@ d_pointer_to_member_type (struct d_info if (pmem == NULL) return NULL; *pmem = cplus_demangle_type (di); + if (*pmem == NULL) + return NULL; if (pmem != &mem && (*pmem)->type != DEMANGLE_COMPONENT_FUNCTION_TYPE) { @@ -2109,7 +2130,7 @@ d_template_param (struct d_info *di) { long param; - if (d_next_char (di) != 'T') + if (! d_check_char (di, 'T')) return NULL; if (d_peek_char (di) == '_') @@ -2122,7 +2143,7 @@ d_template_param (struct d_info *di) param += 1; } - if (d_next_char (di) != '_') + if (! d_check_char (di, '_')) return NULL; ++di->did_subs; @@ -2144,7 +2165,7 @@ d_template_args (struct d_info *di) constructor or destructor. */ hold_last_name = di->last_name; - if (d_next_char (di) != 'I') + if (! d_check_char (di, 'I')) return NULL; al = NULL; @@ -2189,7 +2210,7 @@ d_template_arg (struct d_info *di) case 'X': d_advance (di, 1); ret = d_expression (di); - if (d_next_char (di) != 'E') + if (! d_check_char (di, 'E')) return NULL; return ret; @@ -2316,7 +2337,7 @@ d_expr_primary (struct d_info *di) { struct demangle_component *ret; - if (d_next_char (di) != 'L') + if (! d_check_char (di, 'L')) return NULL; if (d_peek_char (di) == '_') ret = cplus_demangle_mangled_name (di, 0); @@ -2362,7 +2383,7 @@ d_expr_primary (struct d_info *di) } ret = d_make_comp (di, t, type, d_make_name (di, s, d_str (di) - s)); } - if (d_next_char (di) != 'E') + if (! d_check_char (di, 'E')) return NULL; return ret; } @@ -2376,12 +2397,12 @@ d_local_name (struct d_info *di) { struct demangle_component *function; - if (d_next_char (di) != 'Z') + if (! d_check_char (di, 'Z')) return NULL; function = d_encoding (di, 0); - if (d_next_char (di) != 'E') + if (! d_check_char (di, 'E')) return NULL; if (d_peek_char (di) == 's') @@ -2486,7 +2507,7 @@ d_substitution (struct d_info *di, int p { char c; - if (d_next_char (di) != 'S') + if (! d_check_char (di, 'S')) return NULL; c = d_next_char (di); Modified: stable/10/contrib/gcclibs/libiberty/cp-demangle.h ============================================================================== --- stable/10/contrib/gcclibs/libiberty/cp-demangle.h Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcclibs/libiberty/cp-demangle.h Sat Dec 21 18:47:00 2013 (r259694) @@ -123,10 +123,16 @@ struct d_info int expansion; }; +/* To avoid running past the ending '\0', don't: + - call d_peek_next_char if d_peek_char returned '\0' + - call d_advance with an 'i' that is too large + - call d_check_char(di, '\0') + Everything else is safe. */ #define d_peek_char(di) (*((di)->n)) #define d_peek_next_char(di) ((di)->n[1]) #define d_advance(di, i) ((di)->n += (i)) -#define d_next_char(di) (*((di)->n++)) +#define d_check_char(di, c) (d_peek_char(di) == c ? ((di)->n++, 1) : 0) +#define d_next_char(di) (d_peek_char(di) == '\0' ? '\0' : *((di)->n++)) #define d_str(di) ((di)->n) /* Functions and arrays in cp-demangle.c which are referenced by Modified: stable/10/contrib/gcclibs/libiberty/floatformat.c ============================================================================== --- stable/10/contrib/gcclibs/libiberty/floatformat.c Sat Dec 21 18:17:41 2013 (r259693) +++ stable/10/contrib/gcclibs/libiberty/floatformat.c Sat Dec 21 18:47:00 2013 (r259694) @@ -249,53 +249,51 @@ const struct floatformat floatformat_ia6 floatformat_always_valid }; + +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + /* Extract a field which starts at START and is LEN bits long. DATA and TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ static unsigned long get_field (const unsigned char *data, enum floatformat_byteorders order, unsigned int total_len, unsigned int start, unsigned int len) { - unsigned long result; + unsigned long result = 0; unsigned int cur_byte; - int cur_bitshift; + int lo_bit, hi_bit, cur_bitshift = 0; + int nextbyte = (order == floatformat_little) ? 1 : -1; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 19:29:08 2013 Return-Path: Delivered-To: svn-src-all@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 E4AB4786; Sat, 21 Dec 2013 19:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D118E1D12; Sat, 21 Dec 2013 19:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLJT8FH073846; Sat, 21 Dec 2013 19:29:08 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLJT8Tc073845; Sat, 21 Dec 2013 19:29:08 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201312211929.rBLJT8Tc073845@svn.freebsd.org> From: Chris Rees Date: Sat, 21 Dec 2013 19:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259695 - head/bin/pax X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 19:29:09 -0000 Author: crees (doc,ports committer) Date: Sat Dec 21 19:29:08 2013 New Revision: 259695 URL: http://svnweb.freebsd.org/changeset/base/259695 Log: Document the lack of chflags support in pax(1) PR: docs/135516 Submitted by: arundel (based on) Approved by: gjb (mentor) Modified: head/bin/pax/pax.1 Modified: head/bin/pax/pax.1 ============================================================================== --- head/bin/pax/pax.1 Sat Dec 21 18:47:00 2013 (r259694) +++ head/bin/pax/pax.1 Sat Dec 21 19:29:08 2013 (r259695) @@ -33,7 +33,7 @@ .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 29, 2010 +.Dd December 21, 2013 .Dt PAX 1 .Os .Sh NAME @@ -587,6 +587,16 @@ precedence. For example, if .Dl Fl p Ar eme is specified, file modification times are still preserved. +.Pp +File flags set by +.Xr chflags 1 +are not understood by +.Nm , +however +.Xr tar 1 +and +.Xr dump 1 +will preserve these. .It Fl s Ar replstr Modify the file or archive member names specified by the .Ar pattern @@ -1195,3 +1205,11 @@ at the University of California, San Die The .Nm utility does not recognize multibyte characters. +.Pp +File flags set by +.Xr chflags 1 +are not preserved by +.Nm . +The BUGS section of +.Xr chflags 1 +has a list of utilities that are unaware of flags. From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 19:53:52 2013 Return-Path: Delivered-To: svn-src-all@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 64391B95; Sat, 21 Dec 2013 19:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 508F21E77; Sat, 21 Dec 2013 19:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLJrqSM083674; Sat, 21 Dec 2013 19:53:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLJrq7j083673; Sat, 21 Dec 2013 19:53:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312211953.rBLJrq7j083673@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 21 Dec 2013 19:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259696 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 19:53:52 -0000 Author: pfg Date: Sat Dec 21 19:53:51 2013 New Revision: 259696 URL: http://svnweb.freebsd.org/changeset/base/259696 Log: gcc: warnings from -Wformat-security Minor mismatch in r259666. Obtained from: Apple GCC 4.2 - 5646 (Radar 5764921) MFC after: 1 week Modified: head/contrib/gcc/gcov.c Modified: head/contrib/gcc/gcov.c ============================================================================== --- head/contrib/gcc/gcov.c Sat Dec 21 19:29:08 2013 (r259695) +++ head/contrib/gcc/gcov.c Sat Dec 21 19:53:51 2013 (r259696) @@ -414,10 +414,10 @@ print_usage (int error_p) static void print_version (void) { - fnotice (stdout, "%s", "gcov (GCC) %s\n", version_string); + fnotice (stdout, "gcov (GCC) %s\n", version_string); fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n", _("(C)")); - fnotice (stdout, + fnotice (stdout, "%s", _("This is free software; see the source for copying conditions.\n" "There is NO warranty; not even for MERCHANTABILITY or \n" "FITNESS FOR A PARTICULAR PURPOSE.\n\n")); From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 21:56:13 2013 Return-Path: Delivered-To: svn-src-all@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 3D13A980; Sat, 21 Dec 2013 21:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 292D8156C; Sat, 21 Dec 2013 21:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBLLuDoc026980; Sat, 21 Dec 2013 21:56:13 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBLLuDoY026979; Sat, 21 Dec 2013 21:56:13 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201312212156.rBLLuDoY026979@svn.freebsd.org> From: Chris Rees Date: Sat, 21 Dec 2013 21:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259697 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 21:56:13 -0000 Author: crees (doc,ports committer) Date: Sat Dec 21 21:56:12 2013 New Revision: 259697 URL: http://svnweb.freebsd.org/changeset/base/259697 Log: Minor grammar fix PR: docs/185057 Submitted by: Yuri (yuri@rawbw.com) Approved by: gjb (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Dec 21 19:53:51 2013 (r259696) +++ head/sbin/ipfw/ipfw.8 Sat Dec 21 21:56:12 2013 (r259697) @@ -335,8 +335,7 @@ Section below for details. If the world and the kernel get out of sync the .Nm ABI may break, preventing you from being able to add any rules. -This can -adversely effect the booting process. +This can adversely affect the booting process. You can use .Nm .Cm disable From owner-svn-src-all@FreeBSD.ORG Sat Dec 21 23:35:12 2013 Return-Path: Delivered-To: svn-src-all@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 0CFBCA92; Sat, 21 Dec 2013 23:35:12 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C7CD91ACB; Sat, 21 Dec 2013 23:35:11 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 328C7A71; Sun, 22 Dec 2013 00:28:19 +0100 (CET) Date: Sun, 22 Dec 2013 00:35:45 +0100 From: Pawel Jakub Dawidek To: Glen Barber Subject: Re: svn commit: r259678 - head/contrib/tcpdump Message-ID: <20131221233544.GA1673@garage.freebsd.pl> References: <201312211245.rBLCjaXQ029358@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312211245.rBLCjaXQ029358@svn.freebsd.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 23:35:12 -0000 On Sat, Dec 21, 2013 at 12:45:36PM +0000, Glen Barber wrote: > Author: gjb > Date: Sat Dec 21 12:45:35 2013 > New Revision: 259678 > URL: http://svnweb.freebsd.org/changeset/base/259678 > > Log: > Fix build with WITHOUT_CAPSICUM. Thanks. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com