From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 00:59:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 33994AB3; Sun, 16 Jun 2013 00:59:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6EC100A; Sun, 16 Jun 2013 00:59: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 r5G0xPsY096564; Sun, 16 Jun 2013 00:59:25 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5G0xPa8096562; Sun, 16 Jun 2013 00:59:25 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306160059.r5G0xPa8096562@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 16 Jun 2013 00:59:25 +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: r251798 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 00:59:26 -0000 Author: pfg Date: Sun Jun 16 00:59:24 2013 New Revision: 251798 URL: http://svnweb.freebsd.org/changeset/base/251798 Log: MFC r251677: Relax some unnecessary unsigned type changes in ext2fs. While the changes in r245820 are in line with the ext2 spec, the code derived from UFS can use negative values so it is better to relax some types to keep them as they were, and somewhat more similar to UFS. While here clean some casts. Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Sat Jun 15 22:22:03 2013 (r251797) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Sun Jun 16 00:59:24 2013 (r251798) @@ -223,7 +223,7 @@ ext2_reallocblks(struct vop_reallocblks_ brelse(sbp); return (ENOSPC); } - sbap = (int32_t *)sbp->b_data; + sbap = (u_int *)sbp->b_data; soff = idp->in_off; } /* @@ -239,7 +239,7 @@ ext2_reallocblks(struct vop_reallocblks_ ssize = len - (idp->in_off + 1); if (bread(vp, idp->in_lbn, (int)fs->e2fs_bsize, NOCRED, &ebp)) goto fail; - ebap = (int32_t *)ebp->b_data; + ebap = (u_int *)ebp->b_data; } /* * Find the preferred location for the cluster. @@ -442,10 +442,10 @@ ext2_dirpref(struct inode *pip) { struct m_ext2fs *fs; int cg, prefcg, dirsize, cgsize; - int avgifree, avgbfree, avgndir, curdirsize; - int minifree, minbfree, maxndir; - int mincg, minndir; - int maxcontigdirs; + u_int avgifree, avgbfree, avgndir, curdirsize; + u_int minifree, minbfree, maxndir; + u_int mincg, minndir; + u_int maxcontigdirs; mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Sat Jun 15 22:22:03 2013 (r251797) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Sun Jun 16 00:59:24 2013 (r251798) @@ -60,11 +60,11 @@ ext2_balloc(struct inode *ip, int32_t lb { struct m_ext2fs *fs; struct ext2mount *ump; - int32_t nb; struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); struct indir indirs[NIADDR + 2]; - uint32_t newb, *bap, pref; + uint32_t nb, newb; + int32_t *bap, pref; int osize, nsize, num, i, error; *bpp = NULL; @@ -165,8 +165,8 @@ ext2_balloc(struct inode *ip, int32_t lb EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); - if ((error = ext2_alloc(ip, lbn, pref, - (int)fs->e2fs_bsize, cred, &newb))) + if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, + &newb))) return (error); nb = newb; bp = getblk(vp, indirs[1].in_lbn, fs->e2fs_bsize, 0, 0, 0); From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 07:18:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41FB8980; Sun, 16 Jun 2013 07:18:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32A0E1D2E; Sun, 16 Jun 2013 07:18: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 r5G7I8n0016708; Sun, 16 Jun 2013 07:18:08 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5G7I714016705; Sun, 16 Jun 2013 07:18:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306160718.r5G7I714016705@svn.freebsd.org> From: Hiroki Sato Date: Sun, 16 Jun 2013 07:18: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: r251802 - stable/9/usr.bin/lsvfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 07:18:08 -0000 Author: hrs Date: Sun Jun 16 07:18:07 2013 New Revision: 251802 URL: http://svnweb.freebsd.org/changeset/base/251802 Log: MFC r251580: - Add file system type number (vfc_typenum) in the list. This is useful for debugging when changing vfs.typenumhash configuration. - Refactor fmt_flags(). Modified: stable/9/usr.bin/lsvfs/lsvfs.1 stable/9/usr.bin/lsvfs/lsvfs.c Directory Properties: stable/9/usr.bin/lsvfs/ (props changed) Modified: stable/9/usr.bin/lsvfs/lsvfs.1 ============================================================================== --- stable/9/usr.bin/lsvfs/lsvfs.1 Sun Jun 16 07:16:44 2013 (r251801) +++ stable/9/usr.bin/lsvfs/lsvfs.1 Sun Jun 16 07:18:07 2013 (r251802) @@ -2,7 +2,7 @@ .\" Garrett A. Wollman, September 1994 .\" This file is in the public domain. .\" -.Dd March 16, 1995 +.Dd June 9, 2013 .Dt LSVFS 1 .Os .Sh NAME @@ -36,6 +36,8 @@ and the .Fl t option to .Xr mount 8 +.It Num +the filesystem type number. .It Refs the number of references to this VFS; i.e., the number of currently mounted file systems of this type @@ -44,6 +46,7 @@ flag bits. .El .Sh SEE ALSO .Xr mount 2 , +.Xr getvfsbyname 3 , .Xr mount 8 .Sh HISTORY A Modified: stable/9/usr.bin/lsvfs/lsvfs.c ============================================================================== --- stable/9/usr.bin/lsvfs/lsvfs.c Sun Jun 16 07:16:44 2013 (r251801) +++ stable/9/usr.bin/lsvfs/lsvfs.c Sun Jun 16 07:18:07 2013 (r251802) @@ -17,9 +17,24 @@ __FBSDID("$FreeBSD$"); #include #include -#define FMT "%-32.32s %5d %s\n" -#define HDRFMT "%-32.32s %5.5s %s\n" -#define DASHES "-------------------------------- ----- ---------------\n" +#define FMT "%-32.32s 0x%08x %5d %s\n" +#define HDRFMT "%-32.32s %10s %5.5s %s\n" +#define DASHES "-------------------------------- " \ + "---------- ----- ---------------\n" + +static struct flaglist { + int flag; + const char str[32]; /* must be longer than the longest one. */ +} fl[] = { + { .flag = VFCF_STATIC, .str = "static", }, + { .flag = VFCF_NETWORK, .str = "network", }, + { .flag = VFCF_READONLY, .str = "read-only", }, + { .flag = VFCF_SYNTHETIC, .str = "synthetic", }, + { .flag = VFCF_LOOPBACK, .str = "loopback", }, + { .flag = VFCF_UNICODE, .str = "unicode", }, + { .flag = VFCF_JAIL, .str = "jail", }, + { .flag = VFCF_DELEGADMIN, .str = "delegated-administration", }, +}; static const char *fmt_flags(int); @@ -31,13 +46,14 @@ main(int argc, char **argv) size_t buflen; argc--, argv++; - printf(HDRFMT, "Filesystem", "Refs", "Flags"); + printf(HDRFMT, "Filesystem", "Num", "Refs", "Flags"); fputs(DASHES, stdout); if(argc) { for(; argc; argc--, argv++) { if (getvfsbyname(*argv, &vfc) == 0) { - printf(FMT, vfc.vfc_name, vfc.vfc_refcount, fmt_flags(vfc.vfc_flags)); + printf(FMT, vfc.vfc_name, vfc.vfc_typenum, vfc.vfc_refcount, + fmt_flags(vfc.vfc_flags)); } else { warnx("VFS %s unknown or not loaded", *argv); rv++; @@ -54,8 +70,8 @@ main(int argc, char **argv) cnt = buflen / sizeof(struct xvfsconf); for (i = 0; i < cnt; i++) { - printf(FMT, xvfsp[i].vfc_name, xvfsp[i].vfc_refcount, - fmt_flags(xvfsp[i].vfc_flags)); + printf(FMT, xvfsp[i].vfc_name, xvfsp[i].vfc_typenum, + xvfsp[i].vfc_refcount, fmt_flags(xvfsp[i].vfc_flags)); } free(xvfsp); } @@ -66,34 +82,16 @@ main(int argc, char **argv) static const char * fmt_flags(int flags) { - /* - * NB: if you add new flags, don't forget to add them here vvvvvv too. - */ - static char buf[sizeof - "static, network, read-only, synthetic, loopback, unicode, jail"]; - size_t len; - - buf[0] = '\0'; - - if(flags & VFCF_STATIC) - strlcat(buf, "static, ", sizeof(buf)); - if(flags & VFCF_NETWORK) - strlcat(buf, "network, ", sizeof(buf)); - if(flags & VFCF_READONLY) - strlcat(buf, "read-only, ", sizeof(buf)); - if(flags & VFCF_SYNTHETIC) - strlcat(buf, "synthetic, ", sizeof(buf)); - if(flags & VFCF_LOOPBACK) - strlcat(buf, "loopback, ", sizeof(buf)); - if(flags & VFCF_UNICODE) - strlcat(buf, "unicode, ", sizeof(buf)); - if(flags & VFCF_JAIL) - strlcat(buf, "jail, ", sizeof(buf)); - if(flags & VFCF_DELEGADMIN) - strlcat(buf, "delegated-administration, ", sizeof(buf)); - len = strlen(buf); - if (len > 2 && buf[len - 2] == ',') - buf[len - 2] = '\0'; + static char buf[sizeof(struct flaglist) * sizeof(fl)]; + int i; - return buf; + buf[0] = '\0'; + for (i = 0; i < (int)nitems(fl); i++) + if (flags & fl[i].flag) { + strlcat(buf, fl[i].str, sizeof(buf)); + strlcat(buf, ", ", sizeof(buf)); + } + if (buf[0] != '\0') + buf[strlen(buf) - 2] = '\0'; + return (buf); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 18:27:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E1B35A2; Sun, 16 Jun 2013 18:27:55 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE0212AC; Sun, 16 Jun 2013 18:27: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 r5GIRtBW028899; Sun, 16 Jun 2013 18:27:55 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5GIRren028888; Sun, 16 Jun 2013 18:27:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306161827.r5GIRren028888@svn.freebsd.org> From: Hiroki Sato Date: Sun, 16 Jun 2013 18:27:53 +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: r251812 - in stable/9/release: . amd64 i386 ia64 pc98 powerpc sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 18:27:55 -0000 Author: hrs Date: Sun Jun 16 18:27:53 2013 New Revision: 251812 URL: http://svnweb.freebsd.org/changeset/base/251812 Log: MFC r245177,r245346,r246283,r251650: - Set WITHOUT_SVN=yes for textproc/docproj. - Add CHECKSUM.* support in Makefile. - Use ln -fs to create a symlink. - Remove pkgadd for docports. - Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no. - Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE. - Use makefs(8) and gpart(8) for sparc64 ISO image. - Add publisher option to makefs(8). - Add missing copyright notice. - ISO 9660 specification allows only "d-characters" and "a-characters" in the Volume Descriptor (section 7.4). In short, uppercase alphanumeric + some symbols only. While the makefs utility automatically converts the characters, $LABEL should be consistent in the scripts. These fix a specification violation in 9.X iso9660 images, and cdrtools dependency and endianness issue for sparc64 release media. The label is now in uppercase letters only in all platforms. Modified: stable/9/release/Makefile stable/9/release/amd64/mkisoimages.sh stable/9/release/generate-release.sh stable/9/release/i386/mkisoimages.sh stable/9/release/ia64/mkisoimages.sh stable/9/release/pc98/mkisoimages.sh stable/9/release/powerpc/mkisoimages.sh stable/9/release/sparc64/mkisoimages.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/Makefile Sun Jun 16 18:27:53 2013 (r251812) @@ -34,6 +34,20 @@ TARGET_ARCH?= ${TARGET} IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= dist +# Define OSRELEASE by using newvars.sh +.if !defined(OSRELEASE) || empty(OSRELEASE) +.for _V in TYPE BRANCH REVISION +${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} +.endfor +.for _V in ${TARGET_ARCH} +.if !empty(TARGET:M${_V}) +OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} +.else +OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} +.endif +.endfor +.endif + .if !exists(${DOCDIR}) NODOC= true .endif @@ -117,7 +131,7 @@ system: packagesystem cp reldoc/* release .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf + ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf echo sendmail_enable=\"NONE\" > release/etc/rc.conf echo hostid_enable=\"NO\" >> release/etc/rc.conf cp ${.CURDIR}/rc.local release/etc @@ -142,7 +156,7 @@ bootonly: packagesystem cp reldoc/* bootonly .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf + ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc @@ -183,4 +197,9 @@ install: .if defined(DESTDIR) && !empty(DESTDIR) mkdir -p ${DESTDIR} .endif - cp -a ${IMAGES} ftp ${DESTDIR}/ + cp -a ftp ${DESTDIR}/ +.for I in ${IMAGES} + cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} +.endfor + cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 + cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 Modified: stable/9/release/amd64/mkisoimages.sh ============================================================================== --- stable/9/release/amd64/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/amd64/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -36,9 +36,10 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +publisher="The FreeBSD Project. http://www.FreeBSD.org/" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: stable/9/release/generate-release.sh ============================================================================== --- stable/9/release/generate-release.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/generate-release.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -1,89 +1,93 @@ #!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh [-r revision] [-d docrevision] \ -# [-p portsrevision] svn-branch scratch-dir +# Usage: generate-release.sh svn-branch[@revision] scratch-dir # # Environment variables: -# SVNROOT: SVN URL to FreeBSD source repository (by default, -# svn://svn.freebsd.org/base) -# MAKE_FLAGS: optional flags to pass to make (e.g. -j) -# RELSTRING: optional base name for media images (e.g. FreeBSD-9.0-RC2-amd64) -# -# Note: Since this requires a chroot, release cross-builds will not work! +# SVNROOTBASE: SVN base URL to FreeBSD repository (svn://svn.freebsd.org) +# SVNROOTSRC: URL to FreeBSD src tree (${SVNROOTBASE}/base) +# SVNROOTDOC: URL to FreeBSD doc tree (${SVNROOTBASE}/doc) +# SVNROOTPORTS:URL to FreeBSD ports tree (${SVNROOTBASE}/ports) +# BRANCHSRC: branch name of src (svn-branch[@revision]) +# BRANCHDOC: branch name of doc (head) +# BRANCHPORTS: branch name of ports (head) +# WORLD_FLAGS: optional flags to pass to buildworld (e.g. -j) +# KERNEL_FLAGS: optional flags to pass to buildkernel (e.g. -j) # -# $FreeBSD$ -# - -unset B_ARCH -unset ARCH -unset MACHINE_ARCH - -HOST_ARCH=`uname -p` usage() { - echo "Usage: $0 [-a arch] [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + echo "Usage: $0 svn-branch[@revision] scratch-dir" 2>&1 exit 1 } -arch_error () -{ - echo "Architecture ${OPTARG} cannot be built on host architecture ${HOST_ARCH}" - exit 1 -} - -REVISION= -DOCREVISION= -PORTSREVISION= -while getopts a:d:r:p: opt; do - case $opt in - a) - case "${OPTARG}" in - i386|amd64) - if [ "${HOST_ARCH}" != "amd64" ]; then - arch_error "${OPTARG}" - fi - ;; - powerpc|powerpc64) - if [ "${HOST_ARCH}" != "powerpc64" ]; then - arch_error "${OPTARG}" - fi - ;; - *) - arch_error "${OPTARG}" - ;; - esac - B_ARCH="$OPTARG" - ;; - d) - DOCREVISION="-r $OPTARG" - ;; - r) - REVISION="-r $OPTARG" - ;; - p) - PORTSREVISION="-r $OPTARG" - ;; - \?) - usage - ;; - esac -done -shift $(($OPTIND - 1)) - -# If target architecture is not specified, use hw.machine_arch -if [ "x${B_ARCH}" == "x" ]; then - B_ARCH="${HOST_ARCH}" -fi -ARCH_FLAGS="ARCH=${B_ARCH} TARGET_ARCH=${B_ARCH}" - if [ $# -lt 2 ]; then usage fi +: ${SVNROOTBASE:=svn://svn.freebsd.org} +: ${SVNROOTSRC:=${SVNROOTBASE}/base} +: ${SVNROOTDOC:=${SVNROOTBASE}/doc} +: ${SVNROOTPORTS:=${SVNROOTBASE}/ports} +: ${SVNROOT:=${SVNROOTSRC}} # for backward compatibility +: ${SVN_CMD:=/usr/local/bin/svn} +BRANCHSRC=$1 +: ${BRANCHDOC:=head} +: ${BRANCHPORTS:=head} +: ${WORLD_FLAGS:=${MAKE_FLAGS}} +: ${KERNEL_FLAGS:=${MAKE_FLAGS}} +: ${CHROOTDIR:=$2} + +if [ ! -r "${CHROOTDIR}" ]; then + echo "${CHROOTDIR}: scratch dir not found." + exit 1 +fi + +CHROOT_CMD="/usr/sbin/chroot ${CHROOTDIR}" +case ${TARGET} in +"") ;; +*) SETENV_TARGET="TARGET=$TARGET" ;; +esac +case ${TARGET_ARCH} in +"") ;; +*) SETENV_TARGET_ARCH="TARGET_ARCH=$TARGET_ARCH" ;; +esac +SETENV="env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin" +CROSSENV="${SETENV_TARGET} ${SETENV_TARGET_ARCH}" +WMAKE="make -C /usr/src ${WORLD_FLAGS}" +NWMAKE="${WMAKE} __MAKE_CONF=/dev/null SRCCONF=/dev/null" +KMAKE="make -C /usr/src ${KERNEL_FLAGS}" +RMAKE="make -C /usr/src/release" + if [ $(id -u) -ne 0 ]; then echo "Needs to be run as root." exit 1 @@ -91,93 +95,31 @@ fi set -e # Everything must succeed -svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src -svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION -svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION - -cd $2/usr/src -make $MAKE_FLAGS ${ARCH_FLAGS} buildworld -make $ARCH_FLAGS installworld distribution DESTDIR=$2 -mount -t devfs devfs $2/dev -trap "umount $2/dev" EXIT # Clean up devfs mount on exit - -# Most commands below are run in chroot, so fake getosreldate(3) right now -OSVERSION=$(grep '#define __FreeBSD_version' $2/usr/include/sys/param.h | awk '{print $3}') -export OSVERSION -BRANCH=$(grep '^BRANCH=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') -BRANCH=`echo ${BRANCH} | sed -e 's,",,g'` -REVISION=$(grep '^REVISION=' $2/usr/src/sys/conf/newvers.sh | awk -F\= '{print $2}') -REVISION=`echo ${REVISION} | sed -e 's,",,g'` -OSRELEASE="${REVISION}-${BRANCH}" - -pkgng_install_docports () -{ - # Attempt to install docproj port from pkgng package. - chroot ${CHROOTDIR} /bin/sh -c 'env ASSUME_ALWAYS_YES=1 /usr/sbin/pkg install -y docproj-nojadetex' - # Check if docproj was installed, since pkg(8) returns '0' if unable - # to install a package from the repository. If it is not installed, - # fallback to installing using pkg_add(1). - chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg info -q docproj-nojadetex' || \ - pkgadd_install_docports -} - -build_compat9_port () -{ - chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/misc/compat9x BATCH=yes install clean' -} - -pkgadd_install_docports () -{ - # Attempt to install docproj package with pkg_add(1). - # If not successful, build the docproj port. - if [ "${REVISION}" == "10.0" ]; then - # Packages for 10-CURRENT are still located in the 9-CURRENT - # directory. Override environment to use correct package - # location if building for 10-CURRENT. - PACKAGESITE="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/Latest/" - export PACKAGESITE - PACKAGEROOT="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/" - export PACKAGEROOT - PKG_PATH="ftp://ftp.freebsd.org/pub/FreeBSD/ports/${B_ARCH}/packages-9-current/All/" - export PKG_PATH - build_compat9_port - fi - chroot ${CHROOTDIR} /bin/sh -c '/usr/sbin/pkg_add -r docproj-nojadetex' || \ - build_docports -} - -build_docports() -{ - # Could not install textproc/docproj from pkg(8) or pkg_add(1). Build - # the port as final fallback. - chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ - { echo "*** Could not build the textproj/docproj port. Exiting."; exit 2; } -} +mkdir -p ${CHROOTDIR}/usr/src +${SVN_CMD} co ${SVNROOT}/${BRANCHSRC} ${CHROOTDIR}/usr/src +${SVN_CMD} co ${SVNROOTDOC}/${BRANCHDOC} ${CHROOTDIR}/usr/doc +${SVN_CMD} co ${SVNROOTPORTS}/${BRANCHPORTS} ${CHROOTDIR}/usr/ports + +${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src ${WORLD_FLAGS} buildworld +${SETENV} ${NWMAKE} -C ${CHROOTDIR}/usr/src installworld distribution DESTDIR=${CHROOTDIR} +mount -t devfs devfs ${CHROOTDIR}/dev +trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit -if [ -d $2/usr/doc ]; then - cp /etc/resolv.conf $2/etc/resolv.conf +if [ -d ${CHROOTDIR}/usr/doc ]; then + cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf # Install docproj to build release documentation - CHROOTDIR="$2" - set +e - pkgng_install_docports "${CHROOTDIR}" - set -e + ${CHROOT_CMD} /bin/sh -c \ + 'make -C /usr/ports/textproc/docproj \ + BATCH=yes \ + WITHOUT_SVN=yes \ + WITHOUT_JADETEX=yes \ + WITHOUT_X11=yes \ + WITHOUT_PYTHON=yes \ + install' fi -chroot $2 make -C /usr/src $MAKE_FLAGS ${ARCH_FLAGS} buildworld buildkernel -chroot $2 make -C /usr/src/release ${ARCH_FLAGS} release -chroot $2 make -C /usr/src/release install DESTDIR=/R - -if [ "x${OSVERSION}" == "x" ]; then - OSRELEASE=`chroot $2 uname -r` -fi - -: ${RELSTRING=`chroot $2 uname -s`-${OSRELEASE}-${B_ARCH}} - -cd $2/R -for i in release.iso bootonly.iso memstick; do - mv $i $RELSTRING-$i -done -sha256 $RELSTRING-* > CHECKSUM.SHA256 -md5 $RELSTRING-* > CHECKSUM.MD5 - +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${WMAKE} buildworld +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${KMAKE} buildkernel +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${RMAKE} release +${CHROOT_CMD} ${SETENV} ${CROSSENV} ${RMAKE} install DESTDIR=/R Modified: stable/9/release/i386/mkisoimages.sh ============================================================================== --- stable/9/release/i386/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/i386/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -36,9 +36,10 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +publisher="The FreeBSD Project. http://www.FreeBSD.org/" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: stable/9/release/ia64/mkisoimages.sh ============================================================================== --- stable/9/release/ia64/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/ia64/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -37,7 +37,7 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift BASE=$1; shift @@ -74,8 +74,9 @@ else BOOTOPTS="" fi +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $BASE/etc/fstab -makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL $NAME $BASE $* +makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $BASE $* rm $BASE/etc/fstab rm -f $EFIPART exit 0 Modified: stable/9/release/pc98/mkisoimages.sh ============================================================================== --- stable/9/release/pc98/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/pc98/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -36,9 +36,10 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +publisher="The FreeBSD Project. http://www.FreeBSD.org/" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab Modified: stable/9/release/powerpc/mkisoimages.sh ============================================================================== --- stable/9/release/powerpc/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/powerpc/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -58,12 +58,12 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* +publisher="The FreeBSD Project. http://www.FreeBSD.org/" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab rm /tmp/hfs-boot-block rm -rf $1/ppc - Modified: stable/9/release/sparc64/mkisoimages.sh ============================================================================== --- stable/9/release/sparc64/mkisoimages.sh Sun Jun 16 17:54:56 2013 (r251811) +++ stable/9/release/sparc64/mkisoimages.sh Sun Jun 16 18:27:53 2013 (r251812) @@ -22,51 +22,61 @@ # resulting ISO image, base-bits-dir contains the image contents and # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. - -publisher="The FreeBSD Project. http://www.freebsd.org/" -IMG=/tmp/bootfs -MNT=/mnt - -if [ "x$1" = "x-b" ]; then - dd if=/dev/zero of=${IMG} bs=512 count=1024 - MD=`mdconfig -a -t vnode -f ${IMG}` - sunlabel -w -B -b $4/boot/boot1 ${MD} auto - newfs -O1 -o space -m 0 /dev/${MD} - mount /dev/${MD} ${MNT} - mkdir ${MNT}/boot - cp $4/boot/loader ${MNT}/boot - umount ${MNT} - mdconfig -d -u ${MD#md} - bootable="-B ,,,,${IMG}" - shift -else - bootable="" -fi - if [ $# -lt 3 ]; then - echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' - rm -f ${IMG} + echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' > /dev/stderr exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - -LABEL=$1; shift +case $1 in +-b) BOPT=$1; shift ;; +esac +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +# Create an ISO image +publisher="The FreeBSD Project. http://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 -B be -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* rm $1/etc/fstab -rm -f ${IMG} + +if [ "x$BOPT" != "x-b" ]; then + mv ${NAME}.tmp ${NAME} + exit 0 +fi +TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1 +BOOTFSDIR="${TMPIMGDIR}/bootfs" +BOOTFSIMG="${TMPIMGDIR}/bootfs.img" + +# Create a boot filesystem +mkdir -p "${BOOTFSDIR}/boot" +cp $4/boot/loader "${BOOTFSDIR}/boot" +makefs -t ffs -B be -M 512k "${BOOTFSIMG}" "${BOOTFSDIR}" +dd if=$4/boot/boot1 of="${BOOTFSIMG}" bs=512 conv=notrunc,sync + +# Create a boot ISO image +: ${CYLSIZE:=640} +ISOSIZE=$(stat -f %z ${NAME}.tmp) +ISOBLKS=$(((${ISOSIZE} + 511) / 512)) +ISOCYLS=$(((${ISOBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE})) + +BOOTFSSIZE=$(stat -f %z "${BOOTFSIMG}") +BOOTFSBLKS=$(((${BOOTFSSIZE} + 511) / 512)) +BOOTFSCYLS=$(((${BOOTFSBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE})) + +ENDCYL=$((${ISOCYLS} + ${BOOTFSCYLS})) +NSECTS=$((${ENDCYL} * 1 * ${CYLSIZE})) + +dd if=${NAME}.tmp of=${NAME} bs=${CYLSIZE}b conv=notrunc,sync +dd if=${BOOTFSIMG} of=${NAME} bs=${CYLSIZE}b seek=${ISOCYLS} conv=notrunc,sync +# The number of alternative cylinders is always 2. +dd if=/dev/zero of=${NAME} bs=${CYLSIZE}b seek=${ENDCYL} count=2 conv=notrunc,sync +rm -rf ${NAME}.tmp ${TMPIMGDIR} + +# Write VTOC8 label to boot ISO image +MD=`mdconfig -a -t vnode -S 512 -y 1 -x ${CYLSIZE} -f ${NAME}` +gpart create -s VTOC8 ${MD} +# !4: usr, for ISO image part +gpart add -i 1 -s $((${ISOCYLS} * ${CYLSIZE} * 512))b -t \!4 ${MD} +# !2: root, for bootfs part. +gpart add -i 6 -s $((${BOOTFSCYLS} * ${CYLSIZE} * 512))b -t \!2 ${MD} +mdconfig -d -u ${MD#md} From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 18:32:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E98994A; Sun, 16 Jun 2013 18:32:03 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EAA0E12D9; Sun, 16 Jun 2013 18:32: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 r5GIW2rl031200; Sun, 16 Jun 2013 18:32:02 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5GIW2IZ031199; Sun, 16 Jun 2013 18:32:02 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306161832.r5GIW2IZ031199@svn.freebsd.org> From: Hiroki Sato Date: Sun, 16 Jun 2013 18:32: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: r251814 - in stable/9/release/doc: de_DE.ISO8859-1 fr_FR.ISO8859-1 ja_JP.eucJP ru_RU.KOI8-R zh_CN.GB2312 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 18:32:03 -0000 Author: hrs Date: Sun Jun 16 18:32:02 2013 New Revision: 251814 URL: http://svnweb.freebsd.org/changeset/base/251814 Log: Remove obsolete translations. Deleted: stable/9/release/doc/de_DE.ISO8859-1/ stable/9/release/doc/fr_FR.ISO8859-1/ stable/9/release/doc/ja_JP.eucJP/ stable/9/release/doc/ru_RU.KOI8-R/ stable/9/release/doc/zh_CN.GB2312/ From owner-svn-src-stable-9@FreeBSD.ORG Sun Jun 16 18:59:10 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10F026CC; Sun, 16 Jun 2013 18:59:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 002831396; Sun, 16 Jun 2013 18:59: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 r5GIx9tO038304; Sun, 16 Jun 2013 18:59:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5GIx7ZL038293; Sun, 16 Jun 2013 18:59:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306161859.r5GIx7ZL038293@svn.freebsd.org> From: Hiroki Sato Date: Sun, 16 Jun 2013 18:59: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: r251816 - in stable/9/release/doc: en_US.ISO8859-1 en_US.ISO8859-1/errata en_US.ISO8859-1/hardware en_US.ISO8859-1/installation en_US.ISO8859-1/readme en_US.ISO8859-1/relnotes share/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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jun 2013 18:59:10 -0000 Author: hrs Date: Sun Jun 16 18:59:07 2013 New Revision: 251816 URL: http://svnweb.freebsd.org/changeset/base/251816 Log: MFC r250746 and r250805: - Update the release notes to DocBook 4.5 XML to build with the updated documentation tree - Fix build after doc/projects/xml-tools integration. Added: stable/9/release/doc/share/xml/catalog.xml - copied unchanged from r250746, head/release/doc/share/xml/catalog.xml Modified: stable/9/release/doc/en_US.ISO8859-1/Makefile stable/9/release/doc/en_US.ISO8859-1/errata/article.xml stable/9/release/doc/en_US.ISO8859-1/hardware/Makefile stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml stable/9/release/doc/en_US.ISO8859-1/installation/article.xml stable/9/release/doc/en_US.ISO8859-1/readme/article.xml stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml stable/9/release/doc/share/mk/doc.relnotes.mk stable/9/release/doc/share/xml/Makefile stable/9/release/doc/share/xml/release.ent Directory Properties: stable/9/release/doc/ (props changed) stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/Makefile Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/Makefile Sun Jun 16 18:59:07 2013 (r251816) @@ -10,5 +10,8 @@ SUBDIR+= installation COMPAT_SYMLINK = en +LANGCODE=en_US.ISO8859-1 +_LANGCODE=en_US.ISO8859-1 + .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Sun Jun 16 18:59:07 2013 (r251816) @@ -1,3 +1,10 @@ + + +%release; +]> + - - -%entities; - -%release; -]>
- &os; -<![ %release.type.current [ - &release.current; -]]> -<![ %release.type.snapshot [ - &release.prev; -]]> -<![ %release.type.release [ - &release.current; -]]> - Errata + &os; &release.current; Errata The &os; Project @@ -51,16 +41,7 @@ - This document lists errata items for &os; - - - + This document lists errata items for &os; &release.current;, containing significant information discovered after the release or too late in the release cycle to be otherwise included in the release documentation. @@ -70,16 +51,7 @@ should always be consulted before installing this version of &os;. - This errata document for &os; - - - + This errata document for &os; &release.current; will be maintained until the release of &os; &release.next;. @@ -87,16 +59,7 @@ Introduction This errata document contains late-breaking news - about &os; - - - + about &os; &release.current; Before installing this version, it is important to consult this document to learn about any post-release discoveries or problems that may already have been found and fixed. @@ -124,9 +87,9 @@ Security Advisories Problems described in the following security advisories have - been fixed in &release.current;. For more information, consult - the individual advisories available from . + been fixed in &release.current;. For more information, consult + the individual advisories available from + . Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/Makefile ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/Makefile Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/Makefile Sun Jun 16 18:59:07 2013 (r251816) @@ -18,7 +18,7 @@ JADEFLAGS+= -V %generate-article-toc% # SGML content SRCS+= article.xml SRCS+= ${DEV-AUTODIR}/catalog-auto -SRCS+= ${DEV-AUTODIR}/dev-auto.xml +SRCS+= ${DEV-AUTODIR}/dev-auto.ent CATALOGS+= -c ${DEV-AUTODIR}/catalog-auto Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Jun 16 18:59:07 2013 (r251816) @@ -1,11 +1,9 @@ - - -%entities; - - + + %release; - + %devauto; ]> @@ -334,7 +332,7 @@ Apple iMac G5 - Apple Power Macintosh G3 (Blue & White) + Apple Power Macintosh G3 (Blue & White) Apple Power Macintosh G4 @@ -535,7 +533,7 @@ The following systems are partially supported by &os;. In particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller - supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI + supported by the &man.esp.4; driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). Modified: stable/9/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/installation/article.xml Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/installation/article.xml Sun Jun 16 18:59:07 2013 (r251816) @@ -1,15 +1,8 @@ - - -%entities; - - + + %release; - - - - - ]>
Modified: stable/9/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/readme/article.xml Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/readme/article.xml Sun Jun 16 18:59:07 2013 (r251816) @@ -1,10 +1,8 @@ - - -%entities; - - -%release; + + + %release; ]>
@@ -84,59 +82,46 @@ Target Audience -This &release.type; is aimed primarily at early adopters + This &release.type; is aimed primarily at early adopters and various other users who want to get involved with the ongoing development of &os;. While the &os; development team tries its best to ensure that each &release.type; works as advertised, &release.branch; is very much a work-in-progress. - The basic requirements for using this &release.type; are + The basic requirements for using this &release.type; are technical proficiency with &os; and an understanding of the ongoing development process of &os; &release.branch; (as discussed on the &a.current;). - For those more interested in doing business with &os; than + For those more interested in doing business with &os; than in experimenting with new &os; technology, formal releases - (such as &release.prev.stable;) are frequently more appropriate. + (such as &release.prev;) are frequently more appropriate. Releases undergo a period of testing and quality assurance checking to ensure high reliability and dependability. -]]> - -This &release.type; is aimed primarily at early adopters + This &release.type; is aimed primarily at early adopters and various other users who want to get involved with the ongoing development of &os;. While the &os; development team tries its best to ensure that each &release.type; works as advertised, &release.branch; is very much a work-in-progress. - The basic requirements for using this &release.type; are + The basic requirements for using this &release.type; are technical proficiency with &os; and an understanding of the ongoing development process of &os; &release.branch; (as discussed on the &a.current;). - For those more interested in doing business with &os; than + For those more interested in doing business with &os; than in experimenting with new &os; technology, formal releases - (such as &release.prev.stable;) are frequently more appropriate. + (such as &release.prev;) are frequently more appropriate. Releases undergo a period of testing and quality assurance checking to ensure high reliability and dependability. -]]> - -This &release.type; of &os; is suitable for all users. It + This &release.type; of &os; is suitable for all users. It has undergone a period of testing and quality assurance checking to ensure the highest reliability and dependability. - -]]> - Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Jun 16 18:59:07 2013 (r251816) @@ -1,10 +1,8 @@ - - -%entities; - - -%release; + + + %release; ]>
Modified: stable/9/release/doc/share/mk/doc.relnotes.mk ============================================================================== --- stable/9/release/doc/share/mk/doc.relnotes.mk Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/share/mk/doc.relnotes.mk Sun Jun 16 18:59:07 2013 (r251816) @@ -2,12 +2,21 @@ DOC_PREFIX?= ${RELN_ROOT}/../../../doc +# XXX +RELEASETYPE!= grep -o 'release.type "[a-z]*"' ${RELN_ROOT}/share/xml/release.ent | sed 's|[a-z.]* "\([a-z]*\)"|\1|' +.if ${RELEASETYPE} == "current" +PROFILING+= --param profile.attribute "'releasetype'" --param profile.value "'current'" +.elif ${RELEASETYPE} == "snapshot" +PROFILING+= --param profile.attribute "'releasetype'" --param profile.value "'snapshot'" +.elif ${RELEASETYPE} == "release" +PROFILING+= --param profile.attribute "'releasetype'" --param profile.value "'release'" +.endif + # Find the RELNOTESng document catalogs -EXTRA_CATALOGS+= ${RELN_ROOT}/${LANGCODE}/share/xml/catalog -EXTRA_CATALOGS+= ${RELN_ROOT}/share/xml/catalog +EXTRA_CATALOGS+= file://${RELN_ROOT}/${LANGCODE}/share/xml/catalog.xml \ + file://${RELN_ROOT}/share/xml/catalog.xml # Use the appropriate architecture-dependent RELNOTESng stylesheet -DSLHTML?= ${RELN_ROOT}/share/xml/default.dsl DSLPRINT?= ${RELN_ROOT}/share/xml/default.dsl # @@ -23,7 +32,7 @@ MAN4DIR?= ${RELN_ROOT}/../../share/man/m MAN4PAGES?= ${MAN4DIR}/*.4 ${MAN4DIR}/man4.*/*.4 ARCHLIST?= ${RELN_ROOT}/share/misc/dev.archlist.txt DEV-AUTODIR= ${RELN_ROOT:S/${.CURDIR}/${.OBJDIR}/}/share/xml -CLEANFILES+= ${DEV-AUTODIR}/dev-auto.xml ${DEV-AUTODIR}/catalog-auto +CLEANFILES+= ${DEV-AUTODIR}/dev-auto.ent MAN2HWNOTES_CMD=${RELN_ROOT}/share/misc/man2hwnotes.pl .if defined(HWNOTES_MI) @@ -33,7 +42,7 @@ MAN2HWNOTES_FLAGS= -c .endif # Dependency that the article makefiles can use to pull in -# dev-auto.xml. -${DEV-AUTODIR}/catalog-auto ${DEV-AUTODIR}/dev-auto.xml: ${MAN4PAGES} \ +# dev-auto.ent. +${DEV-AUTODIR}/catalog-auto ${DEV-AUTODIR}/dev-auto.ent: ${MAN4PAGES} \ ${ARCHLIST} ${MAN2HWNOTES_CMD} - cd ${RELN_ROOT}/share/xml && make MAN2HWNOTES_FLAGS=${MAN2HWNOTES_FLAGS} dev-auto.xml + cd ${RELN_ROOT}/share/xml && make MAN2HWNOTES_FLAGS=${MAN2HWNOTES_FLAGS} dev-auto.ent Modified: stable/9/release/doc/share/xml/Makefile ============================================================================== --- stable/9/release/doc/share/xml/Makefile Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/share/xml/Makefile Sun Jun 16 18:59:07 2013 (r251816) @@ -5,11 +5,7 @@ RELN_ROOT?= ${.CURDIR}/../.. .include "${RELN_ROOT}/share/mk/doc.relnotes.mk" .include "${DOC_PREFIX}/share/mk/doc.project.mk" -dev-auto.xml: ${MAN4PAGES} ${ARCHLIST} ${MAN2HWNOTES_CMD} catalog-auto +dev-auto.ent: ${MAN4PAGES} ${ARCHLIST} ${MAN2HWNOTES_CMD} ${PERL} ${MAN2HWNOTES_CMD} ${MAN2HWNOTES_FLAGS} -a ${ARCHLIST} -o ${.TARGET} ${MAN4PAGES} -catalog-auto: - ${ECHO_CMD} 'PUBLIC "-//FreeBSD//ENTITIES Auto Generated Device Lists//EN"' \ - '"dev-auto.xml"' > ${.TARGET} - -all: dev-auto.xml +all: dev-auto.ent Copied: stable/9/release/doc/share/xml/catalog.xml (from r250746, head/release/doc/share/xml/catalog.xml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/release/doc/share/xml/catalog.xml Sun Jun 16 18:59:07 2013 (r251816, copy of r250746, head/release/doc/share/xml/catalog.xml) @@ -0,0 +1,14 @@ + + + + + + + + + Modified: stable/9/release/doc/share/xml/release.ent ============================================================================== --- stable/9/release/doc/share/xml/release.ent Sun Jun 16 18:32:59 2013 (r251815) +++ stable/9/release/doc/share/xml/release.ent Sun Jun 16 18:59:07 2013 (r251816) @@ -24,10 +24,24 @@ - + + + - - + + + + +]]> + +]]> + +]]> + From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 04:40:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F04B882; Mon, 17 Jun 2013 04:40:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB101A95; Mon, 17 Jun 2013 04:40: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 r5H4eSXk024568; Mon, 17 Jun 2013 04:40:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5H4eSHs024567; Mon, 17 Jun 2013 04:40:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201306170440.r5H4eSHs024567@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 17 Jun 2013 04:40: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: r251829 - stable/9/sys/dev/fxp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 04:40:28 -0000 Author: yongari Date: Mon Jun 17 04:40:27 2013 New Revision: 251829 URL: http://svnweb.freebsd.org/changeset/base/251829 Log: MFC r251600: Avoid unnecessary controller reinitialization by checking driver running state. fxp(4) requires controller reinitialization for the following cases. o RX lockup condition on i82557 o promiscuous mode change o multicast filter change o WOL configuration o TSO/VLAN hardware tagging/checksum offloading configuration o MAC reprogramming after speed/duplex/flow-control resolution o Any events that result in MAC reprogramming(link UP/DOWN, remote link partner's restart of auto-negotiation etc) o Microcode loading/unloading Apart from above cases which come from hardware limitation, upper stack also blindly reinitializes controller whenever an IP address is assigned. After r194573, fxp(4) no longer needs to reinitialize the controller to program multicast filter after upping the interface. So keeping track of driver running state should remove all unnecessary controller reinitializations. This change will also address endless controller reinitialization triggered by dhclient(8). Modified: stable/9/sys/dev/fxp/if_fxp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/9/sys/dev/fxp/if_fxp.c Mon Jun 17 04:00:46 2013 (r251828) +++ stable/9/sys/dev/fxp/if_fxp.c Mon Jun 17 04:40:27 2013 (r251829) @@ -1075,7 +1075,8 @@ fxp_suspend(device_t dev) pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; sc->flags |= FXP_FLAG_WOL; /* Reconfigure hardware to accept magic frames. */ - fxp_init_body(sc, 1); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + fxp_init_body(sc, 0); } pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } @@ -2141,8 +2142,10 @@ fxp_tick(void *xsc) */ if (sc->rx_idle_secs > FXP_MAX_RX_IDLE) { sc->rx_idle_secs = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 1); + } return; } /* @@ -2240,6 +2243,7 @@ fxp_watchdog(struct fxp_softc *sc) device_printf(sc->dev, "device timeout\n"); sc->ifp->if_oerrors++; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 1); } @@ -2274,6 +2278,10 @@ fxp_init_body(struct fxp_softc *sc, int int i, prm; FXP_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel any pending I/O */ @@ -2813,6 +2821,7 @@ fxp_miibus_statchg(device_t dev) */ if (sc->revision == FXP_REV_82557) return; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); } @@ -2836,9 +2845,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && ((ifp->if_flags ^ sc->if_flags) & - (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) + (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); - else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) fxp_init_body(sc, 1); } else { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) @@ -2851,8 +2861,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm case SIOCADDMULTI: case SIOCDELMULTI: FXP_LOCK(sc); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); + } FXP_UNLOCK(sc); break; @@ -2942,8 +2954,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); reinit++; } - if (reinit > 0 && ifp->if_flags & IFF_UP) + if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); + } FXP_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 06:21:43 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D238B07; Mon, 17 Jun 2013 06:21:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0FF1E0A; Mon, 17 Jun 2013 06:21: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 r5H6LhLf056460; Mon, 17 Jun 2013 06:21:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5H6Lgqu056459; Mon, 17 Jun 2013 06:21:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306170621.r5H6Lgqu056459@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 17 Jun 2013 06:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251832 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 06:21:43 -0000 Author: kib Date: Mon Jun 17 06:21:42 2013 New Revision: 251832 URL: http://svnweb.freebsd.org/changeset/base/251832 Log: MFC r251322: Instead of yielding, pause for 1 tick when donating the current thread time to the owner of the vnode lock while iterating over the free vnode list. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Mon Jun 17 06:15:52 2013 (r251831) +++ stable/9/sys/kern/vfs_subr.c Mon Jun 17 06:21:42 2013 (r251832) @@ -4824,7 +4824,7 @@ restart: if (ALWAYS_YIELD || should_yield()) { TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_USER); + pause("vnacti", 1); mtx_lock(&vnode_free_list_mtx); goto restart; } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 07:11:18 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4674F4D7; Mon, 17 Jun 2013 07:11:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38B8E1001; Mon, 17 Jun 2013 07:11: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 r5H7BIZM072296; Mon, 17 Jun 2013 07:11:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5H7BI8N072294; Mon, 17 Jun 2013 07:11:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306170711.r5H7BI8N072294@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 17 Jun 2013 07:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251833 - stable/9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 07:11:18 -0000 Author: kib Date: Mon Jun 17 07:11:17 2013 New Revision: 251833 URL: http://svnweb.freebsd.org/changeset/base/251833 Log: MFC r250013 (by davidxu): Remove extra code for SA_RESETHAND, it is not needed because kernel has already done this. Approved by: davidxu Modified: stable/9/lib/libthr/thread/thr_sig.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/9/lib/libthr/thread/thr_sig.c Mon Jun 17 06:21:42 2013 (r251832) +++ stable/9/lib/libthr/thread/thr_sig.c Mon Jun 17 07:11:17 2013 (r251833) @@ -341,13 +341,6 @@ check_deferred_signal(struct pthread *cu memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); /* remove signal */ curthread->deferred_siginfo.si_signo = 0; - if (act.sa_flags & SA_RESETHAND) { - struct sigaction tact; - - tact = act; - tact.sa_handler = SIG_DFL; - _sigaction(info.si_signo, &tact, NULL); - } handle_signal(&act, info.si_signo, &info, uc); } } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 07:12:35 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8456E652; Mon, 17 Jun 2013 07:12:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 754071016; Mon, 17 Jun 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 r5H7CZWu072576; Mon, 17 Jun 2013 07:12:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5H7CZH8072575; Mon, 17 Jun 2013 07:12:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306170712.r5H7CZH8072575@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 17 Jun 2013 07:12:35 +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: r251834 - stable/9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 07:12:35 -0000 Author: kib Date: Mon Jun 17 07:12:34 2013 New Revision: 251834 URL: http://svnweb.freebsd.org/changeset/base/251834 Log: MFC r251284: Unify the code of check_deferred_signal() for all architectures. Modified: stable/9/lib/libthr/thread/thr_sig.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/9/lib/libthr/thread/thr_sig.c Mon Jun 17 07:11:17 2013 (r251833) +++ stable/9/lib/libthr/thread/thr_sig.c Mon Jun 17 07:12:34 2013 (r251834) @@ -318,31 +318,23 @@ check_deferred_signal(struct pthread *cu ucontext_t *uc; struct sigaction act; siginfo_t info; + int uc_len; if (__predict_true(curthread->deferred_siginfo.si_signo == 0)) return; -#if defined(__amd64__) || defined(__i386__) - int uc_len; uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); if (curthread->deferred_siginfo.si_signo == 0) return; __fillcontextx2((char *)uc); -#else - ucontext_t ucv; - uc = &ucv; - getcontext(uc); -#endif - if (curthread->deferred_siginfo.si_signo != 0) { - act = curthread->deferred_sigact; - uc->uc_sigmask = curthread->deferred_sigmask; - memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); - /* remove signal */ - curthread->deferred_siginfo.si_signo = 0; - handle_signal(&act, info.si_signo, &info, uc); - } + act = curthread->deferred_sigact; + uc->uc_sigmask = curthread->deferred_sigmask; + memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); + /* remove signal */ + curthread->deferred_siginfo.si_signo = 0; + handle_signal(&act, info.si_signo, &info, uc); } static void From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 10:14:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED926150; Mon, 17 Jun 2013 10:14:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFE34191A; Mon, 17 Jun 2013 10:14: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 r5HAE8SA029859; Mon, 17 Jun 2013 10:14:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HAE80p029858; Mon, 17 Jun 2013 10:14:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201306171014.r5HAE80p029858@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Jun 2013 10:14:08 +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: r251841 - 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 10:14:09 -0000 Author: gjb Date: Mon Jun 17 10:14:08 2013 New Revision: 251841 URL: http://svnweb.freebsd.org/changeset/base/251841 Log: MFC r251563: Add freebsd-update.conf(5) to OptionalObsoleteFiles.inc PR: 179437 Approved by: kib (mentor) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/9/tools/build/ (props changed) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Mon Jun 17 10:03:31 2013 (r251840) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Mon Jun 17 10:14:08 2013 (r251841) @@ -1412,6 +1412,7 @@ OLD_FILES+=usr/share/man/man8/fdcontrol. OLD_FILES+=etc/freebsd-update.conf OLD_FILES+=usr/sbin/freebsd-update OLD_FILES+=usr/share/examples/etc/freebsd-update.conf +OLD_FILES+=usr/share/man/man5/freebsd-update.conf.5.gz OLD_FILES+=usr/share/man/man8/freebsd-update.8.gz .endif From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 14:21:32 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9EACDCD7; Mon, 17 Jun 2013 14:21:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 798E719CF; Mon, 17 Jun 2013 14:21: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 r5HELW1Z010846; Mon, 17 Jun 2013 14:21:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HELWGG010845; Mon, 17 Jun 2013 14:21:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306171421.r5HELWGG010845@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jun 2013 14:21:32 +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: r251846 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 14:21:32 -0000 Author: mav Date: Mon Jun 17 14:21:31 2013 New Revision: 251846 URL: http://svnweb.freebsd.org/changeset/base/251846 Log: MFC r249205: Replicate r245306 from SCSI to ATA. The problem didn't appear so far, covered by multilevel freeze mechanism, but it is better to be safe. Modified: stable/9/sys/cam/ata/ata_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Mon Jun 17 13:02:39 2013 (r251845) +++ stable/9/sys/cam/ata/ata_da.c Mon Jun 17 14:21:31 2013 (r251846) @@ -657,6 +657,9 @@ adaschedule(struct cam_periph *periph) struct ada_softc *softc = (struct ada_softc *)periph->softc; uint32_t prio; + if (softc->state != ADA_STATE_NORMAL) + return; + /* Check if cam_periph_getccb() was called. */ prio = periph->immediate_priority; From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 14:41:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D41AB873; Mon, 17 Jun 2013 14:41:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C64EB1ACD; Mon, 17 Jun 2013 14:41: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 r5HEfdcQ017486; Mon, 17 Jun 2013 14:41:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HEfdIZ017485; Mon, 17 Jun 2013 14:41:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306171441.r5HEfdIZ017485@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jun 2013 14:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251847 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 14:41:39 -0000 Author: mav Date: Mon Jun 17 14:41:39 2013 New Revision: 251847 URL: http://svnweb.freebsd.org/changeset/base/251847 Log: MFC r250298, r250301: Fix byte order of ATA WWN when converting it to SCSI LUN ID. Modified: stable/9/sys/cam/ata/ata_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Mon Jun 17 14:21:31 2013 (r251846) +++ stable/9/sys/cam/ata/ata_xpt.c Mon Jun 17 14:41:39 2013 (r251847) @@ -917,6 +917,7 @@ noerror: path->device->device_id, 8); bcopy(ident_buf->wwn, path->device->device_id + 8, 8); + ata_bswap(path->device->device_id + 8, 8); } } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 14:52:41 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B81AF29; Mon, 17 Jun 2013 14:52:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DB0A1BE8; Mon, 17 Jun 2013 14:52: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 r5HEqfS7020897; Mon, 17 Jun 2013 14:52:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HEqdVE020883; Mon, 17 Jun 2013 14:52:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306171452.r5HEqdVE020883@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jun 2013 14:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251849 - in stable/9: sbin/camcontrol sys/cam sys/cam/scsi sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 14:52:41 -0000 Author: mav Date: Mon Jun 17 14:52:39 2013 New Revision: 251849 URL: http://svnweb.freebsd.org/changeset/base/251849 Log: MFC r251654, r251664: Make CAM return and GEOM DISK pass through new GEOM::lunid attribute. SPC-4 specification states that serial number may be property of device, but not a specific logical unit. People reported about FC storages using serial number in that way, making it unusable for purposes of LUN multipath detection. SPC-4 states that designators associated with logical unit from the VPD page 83h "Device Identification" should be used for that purpose. Report first of them in the new attribute in such preference order: NAA, EUI-64, T10 and SCSI name string. While there, make GEOM DISK properly report GEOM::ident in XML output also using d_getattr() method, if available. This fixes serial numbers reporting for SCSI disks in `geom disk list` output and confxml. Modified: stable/9/sbin/camcontrol/camcontrol.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_enc_ses.c stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Jun 17 14:52:39 2013 (r251849) @@ -6946,18 +6946,18 @@ findsasdevice(struct cam_devlist *devlis struct cam_devitem *item; STAILQ_FOREACH(item, &devlist->dev_queue, links) { - uint8_t *item_addr; + struct scsi_vpd_id_descriptor *idd; /* * XXX KDM look for LUN IDs as well? */ - item_addr = scsi_get_devid(item->device_id, + idd = scsi_get_devid(item->device_id, item->device_id_len, scsi_devid_is_sas_target); - if (item_addr == NULL) + if (idd == NULL) continue; - if (scsi_8btou64(item_addr) == sasaddr) + if (scsi_8btou64(idd->identifier) == sasaddr) return (item); } Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sys/cam/cam_xpt.c Mon Jun 17 14:52:39 2013 (r251849) @@ -1126,8 +1126,9 @@ xpt_announce_quirks(struct cam_periph *p int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) { - int ret = -1; + int ret = -1, l; struct ccb_dev_advinfo cdai; + struct scsi_vpd_id_descriptor *idd; mtx_assert(path->bus->sim->mtx, MA_OWNED); @@ -1140,7 +1141,10 @@ xpt_getattr(char *buf, size_t len, const cdai.buftype = CDAI_TYPE_SERIAL_NUM; else if (!strcmp(attr, "GEOM::physpath")) cdai.buftype = CDAI_TYPE_PHYS_PATH; - else + else if (!strcmp(attr, "GEOM::lunid")) { + cdai.buftype = CDAI_TYPE_SCSI_DEVID; + cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; + } else goto out; cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); @@ -1153,9 +1157,42 @@ xpt_getattr(char *buf, size_t len, const cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); if (cdai.provsiz == 0) goto out; - ret = 0; - if (strlcpy(buf, cdai.buf, len) >= len) - ret = EFAULT; + if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) { + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + cdai.provsiz, scsi_devid_is_lun_naa); + if (idd == NULL) + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + cdai.provsiz, scsi_devid_is_lun_eui64); + if (idd == NULL) + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + cdai.provsiz, scsi_devid_is_lun_t10); + if (idd == NULL) + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + cdai.provsiz, scsi_devid_is_lun_name); + if (idd == NULL) + goto out; + ret = 0; + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII || + (idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { + l = strnlen(idd->identifier, idd->length); + if (l < len) { + bcopy(idd->identifier, buf, l); + buf[l] = 0; + } else + ret = EFAULT; + } else { + if (idd->length * 2 < len) { + for (l = 0; l < idd->length; l++) + sprintf(buf + l * 2, "%02x", + idd->identifier[l]); + } else + ret = EFAULT; + } + } else { + ret = 0; + if (strlcpy(buf, cdai.buf, len) >= len) + ret = EFAULT; + } out: if (cdai.buf != NULL) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sys/cam/scsi/scsi_all.c Mon Jun 17 14:52:39 2013 (r251849) @@ -5173,7 +5173,59 @@ scsi_devid_is_sas_target(uint8_t *bufp) return 1; } -uint8_t * +int +scsi_devid_is_lun_eui64(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_LUN) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_EUI64) + return 0; + return 1; +} + +int +scsi_devid_is_lun_naa(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_LUN) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + return 1; +} + +int +scsi_devid_is_lun_t10(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_LUN) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_T10) + return 0; + return 1; +} + +int +scsi_devid_is_lun_name(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_LUN) + return 0; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_SCSI_NAME) + return 0; + return 1; +} + +struct scsi_vpd_id_descriptor * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t page_len, scsi_devid_checkfn_t ck_fn) { @@ -5194,7 +5246,7 @@ scsi_get_devid(struct scsi_vpd_device_id + desc->length)) { if (ck_fn == NULL || ck_fn((uint8_t *)desc) != 0) - return (desc->identifier); + return (desc); } return (NULL); Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sys/cam/scsi/scsi_all.h Mon Jun 17 14:52:39 2013 (r251849) @@ -1292,6 +1292,7 @@ struct scsi_vpd_id_descriptor #define SVPD_ID_PROTO_SHIFT 4 #define SVPD_ID_CODESET_BINARY 0x01 #define SVPD_ID_CODESET_ASCII 0x02 +#define SVPD_ID_CODESET_UTF8 0x03 #define SVPD_ID_CODESET_MASK 0x0f u_int8_t id_type; #define SVPD_ID_PIV 0x80 @@ -2315,7 +2316,12 @@ u_int scsi_calc_syncparam(u_int period) typedef int (*scsi_devid_checkfn_t)(uint8_t *); int scsi_devid_is_naa_ieee_reg(uint8_t *bufp); int scsi_devid_is_sas_target(uint8_t *bufp); -uint8_t * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, +int scsi_devid_is_lun_eui64(uint8_t *bufp); +int scsi_devid_is_lun_naa(uint8_t *bufp); +int scsi_devid_is_lun_name(uint8_t *bufp); +int scsi_devid_is_lun_t10(uint8_t *bufp); +struct scsi_vpd_id_descriptor * + scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, scsi_devid_checkfn_t ck_fn); void scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries, Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc_ses.c Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sys/cam/scsi/scsi_enc_ses.c Mon Jun 17 14:52:39 2013 (r251849) @@ -1056,7 +1056,8 @@ ses_set_physpath(enc_softc_t *enc, enc_e ses_setphyspath_callback_args_t args; int i, ret; struct sbuf sb; - uint8_t *devid, *elmaddr; + struct scsi_vpd_id_descriptor *idd; + uint8_t *devid; ses_element_t *elmpriv; const char *c; @@ -1084,9 +1085,9 @@ ses_set_physpath(enc_softc_t *enc, enc_e if (cdai.ccb_h.status != CAM_REQ_CMP) goto out; - elmaddr = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, cdai.provsiz, scsi_devid_is_naa_ieee_reg); - if (elmaddr == NULL) + if (idd == NULL) goto out; if (sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND) == NULL) { @@ -1095,7 +1096,7 @@ ses_set_physpath(enc_softc_t *enc, enc_e } /* Next, generate the physical path string */ sbuf_printf(&sb, "id1,enc@n%jx/type@%x/slot@%x", - scsi_8btou64(elmaddr), iter->type_index, + scsi_8btou64(idd->identifier), iter->type_index, iter->type_element_index); /* Append the element descriptor if one exists */ elmpriv = elm->elm_private; Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Mon Jun 17 14:46:54 2013 (r251848) +++ stable/9/sys/geom/geom_disk.c Mon Jun 17 14:52:39 2013 (r251849) @@ -398,8 +398,11 @@ g_disk_start(struct bio *bp) static void g_disk_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp) { + struct bio *bp; struct disk *dp; struct g_disk_softc *sc; + char *buf; + int res = 0; sc = gp->softc; if (sc == NULL || (dp = sc->dp) == NULL) @@ -414,7 +417,27 @@ g_disk_dumpconf(struct sbuf *sb, const c indent, dp->d_fwheads); sbuf_printf(sb, "%s%u\n", indent, dp->d_fwsectors); - sbuf_printf(sb, "%s%s\n", indent, dp->d_ident); + if (dp->d_getattr != NULL) { + buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); + bp = g_alloc_bio(); + bp->bio_disk = dp; + bp->bio_attribute = "GEOM::ident"; + bp->bio_length = DISK_IDENT_SIZE; + bp->bio_data = buf; + res = dp->d_getattr(bp); + sbuf_printf(sb, "%s%s\n", indent, + res == 0 ? buf: dp->d_ident); + bp->bio_attribute = "GEOM::lunid"; + bp->bio_length = DISK_IDENT_SIZE; + bp->bio_data = buf; + if (dp->d_getattr(bp) == 0) + sbuf_printf(sb, "%s%s\n", + indent, buf); + g_destroy_bio(bp); + g_free(buf); + } else + sbuf_printf(sb, "%s%s\n", indent, + dp->d_ident); sbuf_printf(sb, "%s%s\n", indent, dp->d_descr); } } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 14:55:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 605AE18E; Mon, 17 Jun 2013 14:55:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2C51C16; Mon, 17 Jun 2013 14:55: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 r5HEt3tW021333; Mon, 17 Jun 2013 14:55:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HEt3WH021332; Mon, 17 Jun 2013 14:55:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306171455.r5HEt3WH021332@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jun 2013 14:55:03 +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: r251850 - stable/9/sys/dev/mvs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 14:55:03 -0000 Author: mav Date: Mon Jun 17 14:55:02 2013 New Revision: 251850 URL: http://svnweb.freebsd.org/changeset/base/251850 Log: MFC r251661: Replicate r242422 from ata(4) to mvs(4): Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in mvs(4). This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`. Modified: stable/9/sys/dev/mvs/mvs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mvs/mvs.c ============================================================================== --- stable/9/sys/dev/mvs/mvs.c Mon Jun 17 14:52:39 2013 (r251849) +++ stable/9/sys/dev/mvs/mvs.c Mon Jun 17 14:55:02 2013 (r251850) @@ -894,7 +894,7 @@ mvs_legacy_intr(device_t dev, int poll) if (ccb->ataio.dxfer_len > ch->donecount) { /* Set this transfer size according to HW capabilities */ ch->transfersize = min(ccb->ataio.dxfer_len - ch->donecount, - ch->curr[ccb->ccb_h.target_id].bytecount); + ch->transfersize); /* If data write command - put them */ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { if (mvs_wait(dev, ATA_S_DRQ, ATA_S_BUSY, 1000) < 0) { @@ -1344,8 +1344,14 @@ mvs_legacy_execute_transaction(struct mv return; } ch->donecount = 0; - ch->transfersize = min(ccb->ataio.dxfer_len, - ch->curr[port].bytecount); + if (ccb->ataio.cmd.command == ATA_READ_MUL || + ccb->ataio.cmd.command == ATA_READ_MUL48 || + ccb->ataio.cmd.command == ATA_WRITE_MUL || + ccb->ataio.cmd.command == ATA_WRITE_MUL48) { + ch->transfersize = min(ccb->ataio.dxfer_len, + ch->curr[port].bytecount); + } else + ch->transfersize = min(ccb->ataio.dxfer_len, 512); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) ch->fake_busy = 1; /* If data write command - output the data */ From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 14:59:23 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 949CF582; Mon, 17 Jun 2013 14:59:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 877AF1C3D; Mon, 17 Jun 2013 14:59: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 r5HExNj0022102; Mon, 17 Jun 2013 14:59:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HExNeW022101; Mon, 17 Jun 2013 14:59:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306171459.r5HExNeW022101@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Jun 2013 14:59:23 +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: r251852 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 14:59:23 -0000 Author: mav Date: Mon Jun 17 14:59:23 2013 New Revision: 251852 URL: http://svnweb.freebsd.org/changeset/base/251852 Log: MFC r251659: Use CAM_DIR_NONE for requests without data. Wrong values there confuse some drivers. Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Jun 17 14:56:49 2013 (r251851) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Jun 17 14:59:23 2013 (r251852) @@ -1784,7 +1784,7 @@ ata_read_native_max(struct cam_device *d error = ata_do_cmd(device, ccb, retry_count, - /*flags*/CAM_DIR_IN, + /*flags*/CAM_DIR_NONE, /*protocol*/protocol, /*ata_flags*/AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, @@ -1828,7 +1828,7 @@ atahpa_set_max(struct cam_device *device error = ata_do_cmd(device, ccb, retry_count, - /*flags*/CAM_DIR_OUT, + /*flags*/CAM_DIR_NONE, /*protocol*/protocol, /*ata_flags*/AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, @@ -1895,7 +1895,7 @@ atahpa_lock(struct cam_device *device, i error = ata_do_cmd(device, ccb, retry_count, - /*flags*/CAM_DIR_OUT, + /*flags*/CAM_DIR_NONE, /*protocol*/protocol, /*ata_flags*/AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, @@ -1962,7 +1962,7 @@ atahpa_freeze_lock(struct cam_device *de error = ata_do_cmd(device, ccb, retry_count, - /*flags*/CAM_DIR_OUT, + /*flags*/CAM_DIR_NONE, /*protocol*/protocol, /*ata_flags*/AP_FLAG_CHK_COND, /*tag_action*/MSG_SIMPLE_Q_TAG, From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 15:42:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50F28BD4; Mon, 17 Jun 2013 15:42:22 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28A001E80; Mon, 17 Jun 2013 15:42: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 r5HFgM3J038846; Mon, 17 Jun 2013 15:42:22 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HFgMSj038845; Mon, 17 Jun 2013 15:42:22 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201306171542.r5HFgMSj038845@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 17 Jun 2013 15:42: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: r251857 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 15:42:22 -0000 Author: gnn Date: Mon Jun 17 15:42:21 2013 New Revision: 251857 URL: http://svnweb.freebsd.org/changeset/base/251857 Log: MFC: 248848 Commit a patch that fixes a problem in the #pragma statement when searching for and loading dependent modules. This addresses a bug seen with io.d where it was being doubly included. PR: 171678 Submitted by: Mark Johnston Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Mon Jun 17 15:34:22 2013 (r251856) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Mon Jun 17 15:42:21 2013 (r251857) @@ -241,6 +241,8 @@ dt_pragma_depends(const char *prname, dt int found; dt_lib_depend_t *dld; char lib[MAXPATHLEN]; + size_t plen; + char *provs, *cpy, *tok; if (cnp == NULL || nnp == NULL || cnp->dn_kind != DT_NODE_IDENT || nnp->dn_kind != DT_NODE_IDENT) { @@ -248,9 +250,31 @@ dt_pragma_depends(const char *prname, dt " \n", prname); } - if (strcmp(cnp->dn_string, "provider") == 0) - found = dt_provider_lookup(dtp, nnp->dn_string) != NULL; - else if (strcmp(cnp->dn_string, "module") == 0) { + if (strcmp(cnp->dn_string, "provider") == 0) { + /* + * First try to get the provider list using the + * debug.dtrace.providers sysctl, since that'll work even if + * we're not running as root. + */ + provs = NULL; + if (sysctlbyname("debug.dtrace.providers", NULL, &plen, NULL, 0) || + ((provs = dt_alloc(dtp, plen)) == NULL) || + sysctlbyname("debug.dtrace.providers", provs, &plen, NULL, 0)) + found = dt_provider_lookup(dtp, nnp->dn_string) != NULL; + else { + found = B_FALSE; + for (cpy = provs; (tok = strsep(&cpy, " ")) != NULL; ) + if (strcmp(tok, nnp->dn_string) == 0) { + found = B_TRUE; + break; + } + if (found == B_FALSE) + found = dt_provider_lookup(dtp, + nnp->dn_string) != NULL; + } + if (provs != NULL) + dt_free(dtp, provs); + } else if (strcmp(cnp->dn_string, "module") == 0) { dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string); found = mp != NULL && dt_module_getctf(dtp, mp) != NULL; } else if (strcmp(cnp->dn_string, "library") == 0) { From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 19:45:27 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8F79F7D1; Mon, 17 Jun 2013 19:45:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 816321B7E; Mon, 17 Jun 2013 19:45: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 r5HJjRE3015521; Mon, 17 Jun 2013 19:45:27 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HJjR12015520; Mon, 17 Jun 2013 19:45:27 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306171945.r5HJjR12015520@svn.freebsd.org> From: Scott Long Date: Mon, 17 Jun 2013 19:45:27 +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: r251860 - stable/9/sys/mips/mips X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 19:45:27 -0000 Author: scottl Date: Mon Jun 17 19:45:27 2013 New Revision: 251860 URL: http://svnweb.freebsd.org/changeset/base/251860 Log: MFC r242465: Free the dma map -after- it's checked, not before. Or you'll be potentially referencing already-freed memory. MFC r242466: Drop this from 500 to 128, to save a little space on memory constrained platforms. Submitted by: adrian Obtained from: Netflix Modified: stable/9/sys/mips/mips/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/9/sys/mips/mips/busdma_machdep.c Mon Jun 17 19:31:03 2013 (r251859) +++ stable/9/sys/mips/mips/busdma_machdep.c Mon Jun 17 19:45:27 2013 (r251860) @@ -152,7 +152,7 @@ static STAILQ_HEAD(, bus_dmamap) bounce_ static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = TAILQ_HEAD_INITIALIZER(dmamap_freelist); -#define BUSDMA_STATIC_MAPS 500 +#define BUSDMA_STATIC_MAPS 128 static struct bus_dmamap map_pool[BUSDMA_STATIC_MAPS]; static struct mtx busdma_mtx; @@ -533,7 +533,6 @@ int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - _busdma_free_dmamap(map); if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); @@ -542,6 +541,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b if (dmat->bounce_zone) dmat->bounce_zone->map_count--; dmat->map_count--; + _busdma_free_dmamap(map); CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 19:54:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B9FBD9E; Mon, 17 Jun 2013 19:54:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE3F1C2C; Mon, 17 Jun 2013 19:54: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 r5HJsmkN018561; Mon, 17 Jun 2013 19:54:48 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HJsmnR018560; Mon, 17 Jun 2013 19:54:48 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201306171954.r5HJsmnR018560@svn.freebsd.org> From: Brooks Davis Date: Mon, 17 Jun 2013 19:54:48 +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: r251861 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 19:54:48 -0000 Author: brooks Date: Mon Jun 17 19:54:47 2013 New Revision: 251861 URL: http://svnweb.freebsd.org/changeset/base/251861 Log: MFC r251689 Be more agressive about bootstrapping ctfmerge and ctfconvert so builds from existing releases have a chance of working properly when WITH_CLANG_IS_CC is enabled. Modified: stable/9/Makefile.inc1 (contents, props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Mon Jun 17 19:45:27 2013 (r251860) +++ stable/9/Makefile.inc1 Mon Jun 17 19:54:47 2013 (r251861) @@ -1166,8 +1166,9 @@ _clang_tblgen= \ .endif .if ${MK_CDDL} != "no" && \ - ${BOOTSTRAPPING} < 800038 && \ - !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) + ((${BOOTSTRAPPING} < 1000034 && \ + !(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 999999)) \ + || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 20:17:56 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E3095A42; Mon, 17 Jun 2013 20:17:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4EC41D4D; Mon, 17 Jun 2013 20:17: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 r5HKHuJp026092; Mon, 17 Jun 2013 20:17:56 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HKHuIu026091; Mon, 17 Jun 2013 20:17:56 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201306172017.r5HKHuIu026091@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 17 Jun 2013 20:17:56 +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: r251864 - 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 20:17:57 -0000 Author: ae Date: Mon Jun 17 20:17:56 2013 New Revision: 251864 URL: http://svnweb.freebsd.org/changeset/base/251864 Log: MFC r249252: Remove reference to the nonexistent sysctl node net.inet6.mld.stats. Also add cross reference to the icmp6(4). PR: 177696 Modified: stable/9/share/man/man4/mld.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mld.4 ============================================================================== --- stable/9/share/man/man4/mld.4 Mon Jun 17 20:15:39 2013 (r251863) +++ stable/9/share/man/man4/mld.4 Mon Jun 17 20:17:56 2013 (r251864) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2009 +.Dd April 8, 2013 .Dt MLD 4 .Os .Sh NAME @@ -68,11 +68,6 @@ to the protocol. .Sh SYSCTL VARIABLES .Bl -tag -width indent .\" -.It net.inet6.mld.stats -This opaque read-only variable exposes the stack-wide MLDv2 -protocol statistics to -.Xr netstat 1 . -.\" .It net.inet6.mld.ifinfo This opaque read-only variable exposes the per-link MLDv2 status to .Xr ifmcstat 8 . @@ -94,6 +89,7 @@ This sysctl is normally enabled by defau .\" .El .Sh SEE ALSO +.Xr icmp6 4 , .Xr ifmcstat 8 , .Xr inet 4 , .Xr multicast 4 , From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 20:26:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53533EDF; Mon, 17 Jun 2013 20:26:25 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 442381DB1; Mon, 17 Jun 2013 20:26: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 r5HKQPMe029102; Mon, 17 Jun 2013 20:26:25 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HKQJpJ029063; Mon, 17 Jun 2013 20:26:19 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306172026.r5HKQJpJ029063@svn.freebsd.org> From: Scott Long Date: Mon, 17 Jun 2013 20:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251866 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 20:26:25 -0000 Author: scottl Date: Mon Jun 17 20:26:19 2013 New Revision: 251866 URL: http://svnweb.freebsd.org/changeset/base/251866 Log: MFC r236991: Final whitespace trim. Submitted by: imp Approved by: marius Obtained from: Netflix Modified: stable/9/sys/arm/arm/bcopyinout_xscale.S stable/9/sys/arm/arm/bootconfig.c stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/arm/arm/cpufunc.c stable/9/sys/arm/arm/cpufunc_asm.S stable/9/sys/arm/arm/cpufunc_asm_arm10.S stable/9/sys/arm/arm/cpufunc_asm_arm11.S stable/9/sys/arm/arm/cpufunc_asm_arm7tdmi.S stable/9/sys/arm/arm/cpufunc_asm_arm8.S stable/9/sys/arm/arm/cpufunc_asm_arm9.S stable/9/sys/arm/arm/cpufunc_asm_armv4.S stable/9/sys/arm/arm/cpufunc_asm_armv5.S stable/9/sys/arm/arm/cpufunc_asm_sa1.S stable/9/sys/arm/arm/cpufunc_asm_xscale.S stable/9/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/9/sys/arm/arm/db_disasm.c stable/9/sys/arm/arm/db_interface.c stable/9/sys/arm/arm/db_trace.c stable/9/sys/arm/arm/disassem.c stable/9/sys/arm/arm/dump_machdep.c stable/9/sys/arm/arm/elf_trampoline.c stable/9/sys/arm/arm/exception.S stable/9/sys/arm/arm/gdb_machdep.c stable/9/sys/arm/arm/in_cksum.c stable/9/sys/arm/arm/intr.c stable/9/sys/arm/arm/irq_dispatch.S stable/9/sys/arm/arm/machdep.c stable/9/sys/arm/arm/mem.c stable/9/sys/arm/arm/nexus.c stable/9/sys/arm/arm/pmap.c stable/9/sys/arm/arm/support.S stable/9/sys/arm/arm/swtch.S stable/9/sys/arm/arm/sys_machdep.c stable/9/sys/arm/arm/trap.c stable/9/sys/arm/arm/undefined.c stable/9/sys/arm/arm/vectors.S stable/9/sys/arm/arm/vm_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- stable/9/sys/arm/arm/bcopyinout_xscale.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/bcopyinout_xscale.S Mon Jun 17 20:26:19 2013 (r251866) @@ -333,10 +333,10 @@ ENTRY(copyin) str r6, [r1], #0x04 str r7, [r1], #0x04 .Lcopyin_bad1: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyin_bad1_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 @@ -394,10 +394,10 @@ ENTRY(copyin) str r6, [r1], #0x04 str r7, [r1], #0x04 .Lcopyin_bad2: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyin_bad2_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 @@ -455,10 +455,10 @@ ENTRY(copyin) str r6, [r1], #0x04 str r7, [r1], #0x04 .Lcopyin_bad3: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyin_bad3_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 @@ -785,10 +785,10 @@ ENTRY(copyout) strt r6, [r1], #0x04 strt r7, [r1], #0x04 .Lcopyout_bad1: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyout_bad1_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 @@ -846,10 +846,10 @@ ENTRY(copyout) strt r6, [r1], #0x04 strt r7, [r1], #0x04 .Lcopyout_bad2: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyout_bad2_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 @@ -907,10 +907,10 @@ ENTRY(copyout) strt r6, [r1], #0x04 strt r7, [r1], #0x04 .Lcopyout_bad3: - subs r2, r2, #0x10 + subs r2, r2, #0x10 bge .Lcopyout_bad3_loop16 - adds r2, r2, #0x10 + adds r2, r2, #0x10 ldmeqfd sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 Modified: stable/9/sys/arm/arm/bootconfig.c ============================================================================== --- stable/9/sys/arm/arm/bootconfig.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/bootconfig.c Mon Jun 17 20:26:19 2013 (r251866) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include -/* +/* * Function to identify and process different types of boot argument */ Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 20:26:19 2013 (r251866) @@ -156,7 +156,7 @@ struct bus_dmamap { static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = +static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = TAILQ_HEAD_INITIALIZER(dmamap_freelist); #define BUSDMA_STATIC_MAPS 500 @@ -210,7 +210,7 @@ arm_dmamap_freelist_init(void *dummy) { int i; - for (i = 0; i < BUSDMA_STATIC_MAPS; i++) + for (i = 0; i < BUSDMA_STATIC_MAPS; i++) TAILQ_INSERT_HEAD(&dmamap_freelist, &map_pool[i], freelist); } @@ -231,7 +231,7 @@ _bus_dma_can_bounce(vm_offset_t lowaddr, int i; for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) - || (lowaddr < phys_avail[i] && + || (lowaddr < phys_avail[i] && highaddr > phys_avail[i])) return (1); } @@ -313,7 +313,7 @@ _busdma_alloc_dmamap(void) return (map); } -static __inline void +static __inline void _busdma_free_dmamap(bus_dmamap_t map) { if (map->flags & DMAMAP_ALLOCATED) @@ -633,7 +633,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi *vaddr = tmpaddr; } else newmap->origbuffer = newmap->allocbuffer = NULL; - } else + } else newmap->origbuffer = newmap->allocbuffer = NULL; return (0); } @@ -844,7 +844,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma if (seg >= 0 && curaddr == lastaddr && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && (dmat->boundary == 0 || - (segs[seg].ds_addr & bmask) == + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) { segs[seg].ds_len += sgsize; goto segdone; @@ -941,7 +941,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, - dm_segments, map, m->m_data, m->m_len, + dm_segments, map, m->m_data, m->m_len, pmap_kernel(), flags, &lastaddr, &nsegs); map->len += m->m_len; } @@ -951,7 +951,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, } if (error) { - /* + /* * force "no valid mappings" on error in callback. */ (*callback)(callback_arg, dm_segments, 0, 0, error); @@ -1057,7 +1057,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, } if (error) { - /* + /* * force "no valid mappings" on error in callback. */ (*callback)(callback_arg, dm_segments, 0, 0, error); @@ -1092,7 +1092,7 @@ bus_dmamap_sync_buf(void *buf, int len, { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; register_t s; - int partial; + int partial; if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) { cpu_dcache_wb_range((vm_offset_t)buf, len); @@ -1116,7 +1116,7 @@ bus_dmamap_sync_buf(void *buf, int len, ~arm_dcache_align_mask), (vm_offset_t)buf & arm_dcache_align_mask); if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy(_tmp_clend, + memcpy(_tmp_clend, (void *)((vm_offset_t)buf + len), arm_dcache_align - (((vm_offset_t)(buf) + len) & arm_dcache_align_mask)); @@ -1126,11 +1126,11 @@ bus_dmamap_sync_buf(void *buf, int len, if (partial) { if ((vm_offset_t)buf & arm_dcache_align_mask) memcpy((void *)((vm_offset_t)buf & - ~arm_dcache_align_mask), _tmp_cl, + ~arm_dcache_align_mask), _tmp_cl, (vm_offset_t)buf & arm_dcache_align_mask); if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf + len), - _tmp_clend, arm_dcache_align - + memcpy((void *)((vm_offset_t)buf + len), + _tmp_clend, arm_dcache_align - (((vm_offset_t)(buf) + len) & arm_dcache_align_mask)); intr_restore(s); @@ -1146,7 +1146,7 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, STAILQ_FOREACH(bpage, &map->bpages, links) { if (op & BUS_DMASYNC_PREWRITE) { bcopy((void *)bpage->datavaddr, - (void *)(bpage->vaddr_nocache != 0 ? + (void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), bpage->datacount); if (bpage->vaddr_nocache == 0) { @@ -1164,7 +1164,7 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, cpu_l2cache_inv_range(bpage->vaddr, bpage->datacount); } - bcopy((void *)(bpage->vaddr_nocache != 0 ? + bcopy((void *)(bpage->vaddr_nocache != 0 ? bpage->vaddr_nocache : bpage->vaddr), (void *)bpage->datavaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; @@ -1179,7 +1179,7 @@ _bus_dma_buf_is_in_bp(bus_dmamap_t map, STAILQ_FOREACH(bpage, &map->bpages, links) { if ((vm_offset_t)buf >= bpage->datavaddr && - (vm_offset_t)buf + len <= bpage->datavaddr + + (vm_offset_t)buf + len <= bpage->datavaddr + bpage->datacount) return (1); } Modified: stable/9/sys/arm/arm/cpufunc.c ============================================================================== --- stable/9/sys/arm/arm/cpufunc.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc.c Mon Jun 17 20:26:19 2013 (r251866) @@ -222,7 +222,7 @@ struct cpu_functions arm8_cpufuncs = { arm8_context_switch, /* context_switch */ arm8_setup /* cpu setup */ -}; +}; #endif /* CPU_ARM8 */ #ifdef CPU_ARM9 @@ -328,7 +328,7 @@ struct cpu_functions armv5_ec_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ - + /* Other functions */ cpufunc_nullop, /* flush_prefetchbuf */ @@ -530,7 +530,7 @@ struct cpu_functions sa110_cpufuncs = { sa110_context_switch, /* context_switch */ sa110_setup /* cpu setup */ -}; +}; #endif /* CPU_SA110 */ #if defined(CPU_SA1100) || defined(CPU_SA1110) @@ -591,7 +591,7 @@ struct cpu_functions sa11x0_cpufuncs = { sa11x0_context_switch, /* context_switch */ sa11x0_setup /* cpu setup */ -}; +}; #endif /* CPU_SA1100 || CPU_SA1110 */ #ifdef CPU_IXP12X0 @@ -652,7 +652,7 @@ struct cpu_functions ixp12x0_cpufuncs = ixp12x0_context_switch, /* context_switch */ ixp12x0_setup /* cpu setup */ -}; +}; #endif /* CPU_IXP12X0 */ #if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ @@ -841,7 +841,7 @@ struct cpu_functions fa526_cpufuncs = { fa526_context_switch, /* context_switch */ fa526_setup /* cpu setup */ -}; +}; #endif /* CPU_FA526 || CPU_FA626TE */ @@ -1099,7 +1099,7 @@ set_cpufuncs() cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); arm10_dcache_sets_inc = 1U << arm_dcache_l2_linesize; - arm10_dcache_sets_max = + arm10_dcache_sets_max = (1U << (arm_dcache_l2_linesize + arm_dcache_l2_nsets)) - arm10_dcache_sets_inc; arm10_dcache_index_inc = 1U << (32 - arm_dcache_l2_assoc); @@ -1353,7 +1353,7 @@ early_abort_fixup(arg) int loop; int count; int *registers = &frame->tf_r0; - + DFC_PRINTF(("LDM/STM\n")); DFC_DISASSEMBLE(fault_pc); if (fault_instruction & (1 << 21)) { @@ -1533,7 +1533,7 @@ late_abort_fixup(arg) offset = fault_instruction & 0x0f; if (offset == base) return ABORT_FIXUP_FAILED; - + /* * Register offset - hard we have to * cope with shifts ! @@ -1647,8 +1647,8 @@ static u_int parse_cpu_options(char *, s static u_int parse_cpu_options(args, optlist, cpuctrl) char *args; - struct cpu_option *optlist; - u_int cpuctrl; + struct cpu_option *optlist; + u_int cpuctrl; { int integer; @@ -1811,7 +1811,7 @@ arm8_setup(args) ctrl = cpuctrl; cpu_control(0xffffffff, cpuctrl); - /* Set the clock/test register */ + /* Set the clock/test register */ if (setclock) arm8_clock_config(0x7f, clocktest); } @@ -1891,7 +1891,7 @@ arm10_setup(args) int cpuctrl, cpuctrlmask; cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE + | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_BPRD_ENABLE; cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE @@ -2031,7 +2031,7 @@ sa110_setup(args) /* cpu_control(cpuctrlmask, cpuctrl);*/ cpu_control(0xffffffff, cpuctrl); - /* + /* * enable clockswitching, note that this doesn't read or write to r0, * r0 is just to make it valid asm */ @@ -2089,7 +2089,7 @@ sa11x0_setup(args) cpuctrl |= CPU_CONTROL_VECRELOC; /* Clear out the cache */ cpu_idcache_wbinv_all(); - /* Set the control register */ + /* Set the control register */ ctrl = cpuctrl; cpu_control(0xffffffff, cpuctrl); } @@ -2198,7 +2198,7 @@ ixp12x0_setup(args) /* Clear out the cache */ cpu_idcache_wbinv_all(); - /* Set the control register */ + /* Set the control register */ ctrl = cpuctrl; /* cpu_control(0xffffffff, cpuctrl); */ cpu_control(cpuctrlmask, cpuctrl); @@ -2292,5 +2292,5 @@ xscale_setup(args) __asm __volatile("mcr p15, 0, %0, c1, c0, 1" : : "r" (auxctl)); } -#endif /* CPU_XSCALE_80200 || CPU_XSCALE_80321 || CPU_XSCALE_PXA2X0 || CPU_XSCALE_IXP425 +#endif /* CPU_XSCALE_80200 || CPU_XSCALE_80321 || CPU_XSCALE_PXA2X0 || CPU_XSCALE_IXP425 CPU_XSCALE_80219 */ Modified: stable/9/sys/arm/arm/cpufunc_asm.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm.S Mon Jun 17 20:26:19 2013 (r251866) @@ -34,14 +34,14 @@ * * RiscBSD kernel project * - * cpufunc.S + * cpufunc.S * * Assembly functions for CPU / MMU / TLB specific operations * * Created : 30/01/97 * */ - + #include __FBSDID("$FreeBSD$"); @@ -86,13 +86,13 @@ ENTRY(cpufunc_faultaddress) * Generic functions to write the internal coprocessor registers * * - * Currently these registers are + * Currently these registers are * c1 - CPU Control * c3 - Domain Access Control * * All other registers are CPU architecture specific */ - + #if 0 /* See below. */ ENTRY(cpufunc_control) mcr p15, 0, r0, c1, c0, 0 @@ -107,12 +107,12 @@ ENTRY(cpufunc_domains) * Generic functions to read/modify/write the internal coprocessor registers * * - * Currently these registers are + * Currently these registers are * c1 - CPU Control * * All other registers are CPU architecture specific */ - + ENTRY(cpufunc_control) mrc p15, 0, r3, c1, c0, 0 /* Read the control register */ bic r2, r3, r0 /* Clear bits */ Modified: stable/9/sys/arm/arm/cpufunc_asm_arm10.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_arm10.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_arm10.S Mon Jun 17 20:26:19 2013 (r251866) @@ -31,7 +31,7 @@ * ARM10 assembly functions for CPU / MMU / TLB specific operations * */ - + #include __FBSDID("$FreeBSD$"); @@ -255,7 +255,7 @@ ENTRY(arm10_context_switch) /* * Parameters for the cache cleaning code. Note that the order of these - * four variables is assumed in the code above. Hence the reason for + * four variables is assumed in the code above. Hence the reason for * declaring them in the assembler file. */ .align 0 Modified: stable/9/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_arm11.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_arm11.S Mon Jun 17 20:26:19 2013 (r251866) @@ -33,7 +33,7 @@ * XXX We make no attempt at present to take advantage of the v6 memroy * architecture or physically tagged cache. */ - + #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/arm/arm/cpufunc_asm_arm7tdmi.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_arm7tdmi.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_arm7tdmi.S Mon Jun 17 20:26:19 2013 (r251866) @@ -34,7 +34,7 @@ * ARM7TDMI assembly functions for CPU / MMU / TLB specific operations * */ - + #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/arm/arm/cpufunc_asm_arm8.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_arm8.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_arm8.S Mon Jun 17 20:26:19 2013 (r251866) @@ -35,7 +35,7 @@ * ARM8 assembly functions for CPU / MMU / TLB specific operations * */ - + #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/arm/arm/cpufunc_asm_arm9.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_arm9.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_arm9.S Mon Jun 17 20:26:19 2013 (r251866) @@ -30,7 +30,7 @@ * * ARM9 assembly functions for CPU / MMU / TLB specific operations */ - + #include __FBSDID("$FreeBSD$"); @@ -242,7 +242,7 @@ ENTRY(arm9_context_switch) /* * Parameters for the cache cleaning code. Note that the order of these - * four variables is assumed in the code above. Hence the reason for + * four variables is assumed in the code above. Hence the reason for * declaring them in the assembler file. */ .align 0 Modified: stable/9/sys/arm/arm/cpufunc_asm_armv4.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_armv4.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_armv4.S Mon Jun 17 20:26:19 2013 (r251866) @@ -36,7 +36,7 @@ * ARM9 assembly functions for CPU / MMU / TLB specific operations * */ - + #include __FBSDID("$FreeBSD$"); Modified: stable/9/sys/arm/arm/cpufunc_asm_armv5.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_armv5.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_armv5.S Mon Jun 17 20:26:19 2013 (r251866) @@ -32,7 +32,7 @@ * These routines can be used by any core that supports the set/index * operations. */ - + #include __FBSDID("$FreeBSD$"); @@ -224,7 +224,7 @@ ENTRY(armv5_dcache_wbinv_all) /* * Parameters for the cache cleaning code. Note that the order of these - * four variables is assumed in the code above. Hence the reason for + * four variables is assumed in the code above. Hence the reason for * declaring them in the assembler file. */ .align 0 Modified: stable/9/sys/arm/arm/cpufunc_asm_sa1.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_sa1.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_sa1.S Mon Jun 17 20:26:19 2013 (r251866) @@ -35,7 +35,7 @@ * SA-1 assembly functions for CPU / MMU / TLB specific operations * */ - + #include __FBSDID("$FreeBSD$"); @@ -58,7 +58,7 @@ ENTRY(sa1_setttb) #else ldr r3, .Lblock_userspace_access ldr r2, [r3] - orr r1, r2, #1 + orr r1, r2, #1 str r1, [r3] #endif stmfd sp!, {r0-r3, lr} @@ -67,7 +67,7 @@ ENTRY(sa1_setttb) mcr p15, 0, r0, c7, c5, 0 /* invalidate I$ and BTB */ mcr p15, 0, r0, c7, c10, 4 /* drain write and fill buffer */ - /* Write the TTB */ + /* Write the TTB */ mcr p15, 0, r0, c2, c0, 0 /* If we have updated the TTB we must flush the TLB */ Modified: stable/9/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_xscale.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_xscale.S Mon Jun 17 20:26:19 2013 (r251866) @@ -71,7 +71,7 @@ * * XScale assembly functions for CPU / MMU / TLB specific operations */ - + #include __FBSDID("$FreeBSD$"); @@ -138,7 +138,7 @@ ENTRY(xscale_setttb) #else ldr r3, .Lblock_userspace_access ldr r2, [r3] - orr r1, r2, #1 + orr r1, r2, #1 str r1, [r3] #endif stmfd sp!, {r0-r3, lr} @@ -150,7 +150,7 @@ ENTRY(xscale_setttb) ldmfd sp!, {r0-r3, lr} - /* Write the TTB */ + /* Write the TTB */ mcr p15, 0, r0, c2, c0, 0 /* If we have updated the TTB we must flush the TLB */ Modified: stable/9/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/9/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Jun 17 20:26:19 2013 (r251866) @@ -72,7 +72,7 @@ * * XScale core 3 assembly functions for CPU / MMU / TLB specific operations */ - + #include __FBSDID("$FreeBSD$"); @@ -339,7 +339,7 @@ ENTRY(xscalec3_setttb) #else ldr r3, .Lblock_userspace_access ldr r2, [r3] - orr r1, r2, #1 + orr r1, r2, #1 str r1, [r3] #endif stmfd sp!, {r0-r3, lr} @@ -354,7 +354,7 @@ ENTRY(xscalec3_setttb) #ifdef ARM_USE_L2_CACHE orr r0, r0, #0x18 /* cache the page table in L2 */ #endif - /* Write the TTB */ + /* Write the TTB */ mcr p15, 0, r0, c2, c0, 0 /* If we have updated the TTB we must flush the TLB */ Modified: stable/9/sys/arm/arm/db_disasm.c ============================================================================== --- stable/9/sys/arm/arm/db_disasm.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/db_disasm.c Mon Jun 17 20:26:19 2013 (r251866) @@ -50,7 +50,7 @@ static u_int db_disasm_read_word(u_int); static void db_disasm_printaddr(u_int); static const disasm_interface_t db_disasm_interface = { - db_disasm_read_word, + db_disasm_read_word, db_disasm_printaddr, db_printf }; Modified: stable/9/sys/arm/arm/db_interface.c ============================================================================== --- stable/9/sys/arm/arm/db_interface.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/db_interface.c Mon Jun 17 20:26:19 2013 (r251866) @@ -6,24 +6,24 @@ * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * @@ -325,7 +325,7 @@ branch_taken(u_int insn, db_addr_t pc) break; default: break; /* XXX */ - } + } } return (addr + offset); Modified: stable/9/sys/arm/arm/db_trace.c ============================================================================== --- stable/9/sys/arm/arm/db_trace.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/db_trace.c Mon Jun 17 20:26:19 2013 (r251866) @@ -7,24 +7,24 @@ * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * a structure to represent them is a good idea. * * Here's the diagram from the APCS. Increasing address is _up_ the page. - * + * * save code pointer [fp] <- fp points to here * return link value [fp, #-4] * return sp value [fp, #-8] @@ -72,9 +72,9 @@ __FBSDID("$FreeBSD$"); * [saved a2 value] * [saved a1 value] * - * The save code pointer points twelve bytes beyond the start of the - * code sequence (usually a single STM) that created the stack frame. - * We have to disassemble it if we want to know which of the optional + * The save code pointer points twelve bytes beyond the start of the + * code sequence (usually a single STM) that created the stack frame. + * We have to disassemble it if we want to know which of the optional * fields are actually present. */ Modified: stable/9/sys/arm/arm/disassem.c ============================================================================== --- stable/9/sys/arm/arm/disassem.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/disassem.c Mon Jun 17 20:26:19 2013 (r251866) @@ -131,9 +131,9 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, { 0x0e1f0000, 0x080d0000, "stm", "YnWl" },/* separate out r13 base */ - { 0x0e1f0000, 0x081d0000, "ldm", "YnWl" },/* separate out r13 base */ + { 0x0e1f0000, 0x081d0000, "ldm", "YnWl" },/* separate out r13 base */ { 0x0e100000, 0x08000000, "stm", "XnWl" }, - { 0x0e100000, 0x08100000, "ldm", "XnWl" }, + { 0x0e100000, 0x08100000, "ldm", "XnWl" }, { 0x0e1000f0, 0x00100090, "ldrb", "de" }, { 0x0e1000f0, 0x00000090, "strb", "de" }, { 0x0e1000f0, 0x001000d0, "ldrsb", "de" }, @@ -329,7 +329,7 @@ disasm(const disasm_interface_t *di, vm_ di->di_printf("#0x%08x", (insn & 0xff) << (32 - rotate) | (insn & 0xff) >> rotate); - } else { + } else { disasm_register_shift(di, insn); } break; Modified: stable/9/sys/arm/arm/dump_machdep.c ============================================================================== --- stable/9/sys/arm/arm/dump_machdep.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/dump_machdep.c Mon Jun 17 20:26:19 2013 (r251866) @@ -197,7 +197,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr #ifdef SW_WATCHDOG wdog_kern_pat(WD_LASTVAL); #endif - error = dump_write(di, + error = dump_write(di, (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo, sz); if (error) break; Modified: stable/9/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/9/sys/arm/arm/elf_trampoline.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/elf_trampoline.c Mon Jun 17 20:26:19 2013 (r251866) @@ -202,7 +202,7 @@ _startC(void) "orr %0, %0, %1\n" "mrc p15, 0, %1, c1, c0, 0\n" "bic %1, %1, #1\n" /* Disable MMU */ - "orr %1, %1, #(4 | 8)\n" /* Add DC enable, + "orr %1, %1, #(4 | 8)\n" /* Add DC enable, WBUF enable */ "orr %1, %1, #0x1000\n" /* Add IC enable */ "orr %1, %1, #(0x800)\n" /* BPRD enable */ @@ -397,7 +397,7 @@ inflate_kernel(void *kernel, void *start #endif void * -load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end, +load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end, int d) { Elf32_Ehdr *eh; @@ -436,7 +436,7 @@ load_kernel(unsigned int kstart, unsigne if (phdr[j].p_type == PT_LOAD && shdr[i].sh_offset >= phdr[j].p_offset && - (shdr[i].sh_offset + + (shdr[i].sh_offset + shdr[i].sh_size <= phdr[j].p_offset + phdr[j].p_filesz)) { @@ -445,7 +445,7 @@ load_kernel(unsigned int kstart, unsigne j = eh->e_phnum; } } - if (shdr[i].sh_offset != 0 && + if (shdr[i].sh_offset != 0 && shdr[i].sh_size != 0) { symtabindex = i; symstrindex = shdr[i].sh_link; @@ -457,7 +457,7 @@ load_kernel(unsigned int kstart, unsigne ssym = lastaddr; if (d) { memcpy((void *)func_end, (void *)( - shdr[symtabindex].sh_offset + kstart), + shdr[symtabindex].sh_offset + kstart), shdr[symtabindex].sh_size); memcpy((void *)(func_end + shdr[symtabindex].sh_size), @@ -469,7 +469,7 @@ load_kernel(unsigned int kstart, unsigne sizeof(shdr[symtabindex].sh_size)); lastaddr += sizeof(shdr[symstrindex].sh_size); lastaddr += shdr[symstrindex].sh_size; - lastaddr = roundup(lastaddr, + lastaddr = roundup(lastaddr, sizeof(shdr[symstrindex].sh_size)); } @@ -488,13 +488,13 @@ load_kernel(unsigned int kstart, unsigne (void*)(kstart + phdr[i].p_offset), phdr[i].p_filesz); /* Clean space from oversized segments, eg: bss. */ if (phdr[i].p_filesz < phdr[i].p_memsz) - bzero((void *)(phdr[i].p_vaddr - KERNVIRTADDR + + bzero((void *)(phdr[i].p_vaddr - KERNVIRTADDR + curaddr + phdr[i].p_filesz), phdr[i].p_memsz - phdr[i].p_filesz); } /* Now grab the symbol tables. */ if (symtabindex >= 0 && symstrindex >= 0) { - *(Elf_Size *)lastaddr = + *(Elf_Size *)lastaddr = shdr[symtabindex].sh_size; lastaddr += sizeof(shdr[symtabindex].sh_size); memcpy((void*)lastaddr, @@ -511,7 +511,7 @@ load_kernel(unsigned int kstart, unsigne shdr[symtabindex].sh_size), shdr[symstrindex].sh_size); lastaddr += shdr[symstrindex].sh_size; - lastaddr = roundup(lastaddr, + lastaddr = roundup(lastaddr, sizeof(shdr[symstrindex].sh_size)); *(Elf_Addr *)curaddr = MAGIC_TRAMP_NUMBER; *((Elf_Addr *)curaddr + 1) = ssym - curaddr + KERNVIRTADDR; @@ -572,10 +572,10 @@ setup_pagetables(unsigned int pt_addr, v "sub pc, pc, #4\n" : "=r" (tmp) : "r" (pd), "r" (domain)); - /* + /* * XXX: This is the most stupid workaround I've ever wrote. * For some reason, the KB9202 won't boot the kernel unless - * we access an address which is not in the + * we access an address which is not in the * 0x20000000 - 0x20ffffff range. I hope I'll understand * what's going on later. */ @@ -596,7 +596,7 @@ __start(void) curaddr = (void*)((unsigned int)curaddr & 0xfff00000); #ifdef KZIP if (*kernel == 0x1f && kernel[1] == 0x8b) { - pt_addr = (((int)&_end + KERNSIZE + 0x100) & + pt_addr = (((int)&_end + KERNSIZE + 0x100) & ~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE; #ifdef CPU_ARM9 @@ -609,15 +609,15 @@ __start(void) /* Gzipped kernel */ dst = inflate_kernel(kernel, &_end); kernel = (char *)&_end; - altdst = 4 + load_kernel((unsigned int)kernel, + altdst = 4 + load_kernel((unsigned int)kernel, (unsigned int)curaddr, (unsigned int)&func_end + 800 , 0); if (altdst > dst) dst = altdst; } else #endif - dst = 4 + load_kernel((unsigned int)&kernel_start, - (unsigned int)curaddr, + dst = 4 + load_kernel((unsigned int)&kernel_start, + (unsigned int)curaddr, (unsigned int)&func_end, 0); dst = (void *)(((vm_offset_t)dst & ~3)); pt_addr = ((unsigned int)dst &~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE; @@ -626,8 +626,8 @@ __start(void) sp = pt_addr + L1_TABLE_SIZE + 8192; sp = sp &~3; dst = (void *)(sp + 4); - memcpy((void *)dst, (void *)&load_kernel, (unsigned int)&func_end - + memcpy((void *)dst, (void *)&load_kernel, (unsigned int)&func_end - (unsigned int)&load_kernel + 800); - do_call(dst, kernel, dst + (unsigned int)(&func_end) - + do_call(dst, kernel, dst + (unsigned int)(&func_end) - (unsigned int)(&load_kernel) + 800, sp); } Modified: stable/9/sys/arm/arm/exception.S ============================================================================== --- stable/9/sys/arm/arm/exception.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/exception.S Mon Jun 17 20:26:19 2013 (r251866) @@ -189,7 +189,7 @@ Laddress_exception_msg: * This function uses PULLFRAMEFROMSVCANDEXIT and * DO_AST * only be called if the exception handler used PUSHFRAMEINSVC - * + * */ exception_exit: Modified: stable/9/sys/arm/arm/gdb_machdep.c ============================================================================== --- stable/9/sys/arm/arm/gdb_machdep.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/gdb_machdep.c Mon Jun 17 20:26:19 2013 (r251866) @@ -70,8 +70,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 12: return (&kdb_thrctx->un_32.pcb32_r12); case 13: stacktest = kdb_thrctx->un_32.pcb32_sp + 5 * 4; return (&stacktest); - case 15: - /* + case 15: + /* * On context switch, the PC is not put in the PCB, but * we can retrieve it from the stack. */ Modified: stable/9/sys/arm/arm/in_cksum.c ============================================================================== --- stable/9/sys/arm/arm/in_cksum.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/in_cksum.c Mon Jun 17 20:26:19 2013 (r251866) @@ -149,4 +149,4 @@ u_int in_cksum_hdr(const struct ip *ip) union l_util l_util; REDUCE16; return (~sum & 0xffff); -} +} Modified: stable/9/sys/arm/arm/intr.c ============================================================================== --- stable/9/sys/arm/arm/intr.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/intr.c Mon Jun 17 20:26:19 2013 (r251866) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -62,7 +62,7 @@ void arm_handler_execute(struct trapfram void (*arm_post_filter)(void *) = NULL; void -arm_setup_irqhandler(const char *name, driver_filter_t *filt, +arm_setup_irqhandler(const char *name, driver_filter_t *filt, void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) { struct intr_event *event; @@ -78,7 +78,7 @@ arm_setup_irqhandler(const char *name, d if (error) return; intr_events[irq] = event; - last_printed += + last_printed += snprintf(intrnames + last_printed, MAXCOMLEN + 1, "irq%d: %s", irq, name); Modified: stable/9/sys/arm/arm/irq_dispatch.S ============================================================================== --- stable/9/sys/arm/arm/irq_dispatch.S Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/irq_dispatch.S Mon Jun 17 20:26:19 2013 (r251866) @@ -103,7 +103,7 @@ ASENTRY_NP(irq_entry) .global _C_LABEL(intrnames), _C_LABEL(sintrnames) .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt) -_C_LABEL(intrnames): +_C_LABEL(intrnames): .space NIRQ * (MAXCOMLEN + 1) _C_LABEL(intrcnt): .space NIRQ * 4 Modified: stable/9/sys/arm/arm/machdep.c ============================================================================== --- stable/9/sys/arm/arm/machdep.c Mon Jun 17 20:18:12 2013 (r251865) +++ stable/9/sys/arm/arm/machdep.c Mon Jun 17 20:26:19 2013 (r251866) @@ -139,14 +139,14 @@ sendsig(catcher, ksi, mask) /* Allocate and validate space for the signal handler context. */ if ((td->td_flags & TDP_ALTSTACK) != 0 && !(onstack) && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)(td->td_sigstk.ss_sp + + fp = (struct sigframe *)(td->td_sigstk.ss_sp + td->td_sigstk.ss_size); #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif } else fp = (struct sigframe *)td->td_frame->tf_usr_sp; - + /* make room on the stack */ fp--; @@ -156,7 +156,7 @@ sendsig(catcher, ksi, mask) get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; frame.sf_uc.uc_stack = td->td_sigstk; mtx_unlock(&psp->ps_mtx); @@ -449,7 +449,7 @@ ptrace_single_step(struct thread *td) ("Didn't clear single step")); p = td->td_proc; PROC_UNLOCK(p); - error = ptrace_read_int(td, td->td_frame->tf_pc + 4, + error = ptrace_read_int(td, td->td_frame->tf_pc + 4, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 20:40:17 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4775F6B0; Mon, 17 Jun 2013 20:40:17 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 383D61E61; Mon, 17 Jun 2013 20:40: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 r5HKeHPd032772; Mon, 17 Jun 2013 20:40:17 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HKeGRq032770; Mon, 17 Jun 2013 20:40:16 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306172040.r5HKeGRq032770@svn.freebsd.org> From: Scott Long Date: Mon, 17 Jun 2013 20:40:16 +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: r251868 - in stable/9/sys: arm/arm mips/mips X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 20:40:17 -0000 Author: scottl Date: Mon Jun 17 20:40:16 2013 New Revision: 251868 URL: http://svnweb.freebsd.org/changeset/base/251868 Log: MFC r240177: Dynamically allocate the S/G lists passed to callback routines rather than allocating them on the stack of various bus_dmamap_load*() functions. The S/G lists are stored in the DMA tags. This matches the implementation on all other platforms. Submitted by: jhb Approved by: marius, adrian Obtained from: Netflix Modified: stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/mips/mips/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 20:27:20 2013 (r251867) +++ stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 20:40:16 2013 (r251868) @@ -81,6 +81,7 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; /* * DMA range for this tag. If the page doesn't fall within * one of these ranges, an error is returned. The caller @@ -374,6 +375,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } + newtag->segments = NULL; + /* * Take into account any restrictions imposed by our parent tag */ @@ -447,7 +450,6 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) #endif if (dmat != NULL) { - if (dmat->map_count != 0) return (EBUSY); @@ -457,6 +459,8 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -484,6 +488,17 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bus_dmamap_t newmap; int error = 0; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -585,6 +600,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; @@ -883,11 +908,6 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ { vm_offset_t lastaddr = 0; int error, nsegs = -1; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); @@ -898,14 +918,14 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, - dm_segments, map, buf, buflen, kernel_pmap, + dmat->segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); if (error == EINPROGRESS) return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else - (*callback)(callback_arg, dm_segments, nsegs + 1, error); + (*callback)(callback_arg, dmat->segments, nsegs + 1, error); CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); @@ -921,11 +941,6 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs = -1, error = 0; M_ASSERTPKTHDR(m0); @@ -941,7 +956,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, - dm_segments, map, m->m_data, m->m_len, + dmat->segments, map, m->m_data, m->m_len, pmap_kernel(), flags, &lastaddr, &nsegs); map->len += m->m_len; } @@ -954,9 +969,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs + 1, + (*callback)(callback_arg, dmat->segments, nsegs + 1, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", @@ -1012,11 +1027,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, int flags) { vm_offset_t lastaddr = 0; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, i, error; bus_size_t resid; struct iovec *iov; @@ -1048,8 +1058,8 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dm_segments, map, - addr, minlen, pmap, flags, &lastaddr, &nsegs); + error = bus_dmamap_load_buffer(dmat, dmat->segments, + map, addr, minlen, pmap, flags, &lastaddr, &nsegs); map->len += minlen; resid -= minlen; @@ -1060,9 +1070,9 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs+1, + (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); } Modified: stable/9/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/9/sys/mips/mips/busdma_machdep.c Mon Jun 17 20:27:20 2013 (r251867) +++ stable/9/sys/mips/mips/busdma_machdep.c Mon Jun 17 20:40:16 2013 (r251868) @@ -80,6 +80,7 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; struct bounce_zone *bounce_zone; }; @@ -352,6 +353,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } + newtag->segments = NULL; + /* * Take into account any restrictions imposed by our parent tag */ @@ -434,6 +437,8 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -442,7 +447,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) */ dmat = parent; } else - dmat = NULL; + dmat = NULL; } } CTR2(KTR_BUSDMA, "%s tag %p", __func__, dmat_copy); @@ -461,6 +466,17 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bus_dmamap_t newmap; int error = 0; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -563,6 +579,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; @@ -824,11 +850,6 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ { vm_offset_t lastaddr = 0; int error, nsegs = -1; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); @@ -839,14 +860,14 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, - dm_segments, map, buf, buflen, kernel_pmap, + dmat->segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); if (error == EINPROGRESS) return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else - (*callback)(callback_arg, dm_segments, nsegs + 1, error); + (*callback)(callback_arg, dmat->segments, nsegs + 1, error); CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); @@ -862,11 +883,6 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs = -1, error = 0; M_ASSERTPKTHDR(m0); @@ -882,7 +898,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, - dm_segments, map, m->m_data, m->m_len, + dmat->segments, map, m->m_data, m->m_len, kernel_pmap, flags, &lastaddr, &nsegs); map->len += m->m_len; } @@ -895,9 +911,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs + 1, + (*callback)(callback_arg, dmat->segments, nsegs + 1, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", @@ -953,11 +969,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, int flags) { vm_offset_t lastaddr = 0; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, i, error; bus_size_t resid; struct iovec *iov; @@ -990,8 +1001,8 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dm_segments, map, - addr, minlen, pmap, flags, &lastaddr, &nsegs); + error = bus_dmamap_load_buffer(dmat, dmat->segments, + map, addr, minlen, pmap, flags, &lastaddr, &nsegs); map->len += minlen; resid -= minlen; @@ -1002,9 +1013,9 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs+1, + (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 21:41:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0C884F2; Mon, 17 Jun 2013 21:41:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B17911192; Mon, 17 Jun 2013 21:41: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 r5HLfFIt054040; Mon, 17 Jun 2013 21:41:15 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HLfEMW054031; Mon, 17 Jun 2013 21:41:14 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306172141.r5HLfEMW054031@svn.freebsd.org> From: Scott Long Date: Mon, 17 Jun 2013 21:41:14 +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: r251871 - in stable/9/sys: arm/arm arm/include conf kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 21:41:15 -0000 Author: scottl Date: Mon Jun 17 21:41:14 2013 New Revision: 251871 URL: http://svnweb.freebsd.org/changeset/base/251871 Log: MFC r244414: Properly implement pmap_[get|set]_memattr MFC r244466: Create an architecture-agnostic buffer pool manager that uses uma(9) to manage a set of power-of-2 sized buffers for bus_dmamem_alloc(). MFC r244471: Busdma enhancements, especially for managing small uncacheable buffers. MFC r244743: Use C comments instead of C++ comments. MFC r244474: We want to build subr_busdma_bufalloc.c on arm. Submitted by: cognet Approved by: marius Obtained from: Netflix Added: stable/9/sys/kern/subr_busdma_bufalloc.c - copied unchanged from r244466, head/sys/kern/subr_busdma_bufalloc.c stable/9/sys/sys/busdma_bufalloc.h - copied unchanged from r244466, head/sys/sys/busdma_bufalloc.h Modified: stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/arm/arm/pmap.c stable/9/sys/arm/include/pmap.h stable/9/sys/arm/include/vm.h stable/9/sys/conf/files.arm Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 21:36:29 2013 (r251870) +++ stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 21:41:14 2013 (r251871) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2012 Ian Lepore * Copyright (c) 2004 Olivier Houchard * Copyright (c) 2002 Peter Grehan * Copyright (c) 1997, 1998 Justin T. Gibbs. @@ -32,7 +33,23 @@ __FBSDID("$FreeBSD$"); /* - * ARM bus dma support routines + * ARM bus dma support routines. + * + * XXX Things to investigate / fix some day... + * - What is the earliest that this API can be called? Could there be any + * fallout from changing the SYSINIT() order from SI_SUB_VM to SI_SUB_KMEM? + * - The manpage mentions the BUS_DMA_NOWAIT flag only in the context of the + * bus_dmamap_load() function. This code has historically (and still does) + * honor it in bus_dmamem_alloc(). If we got rid of that we could lose some + * error checking because some resource management calls would become WAITOK + * and thus "cannot fail." + * - The decisions made by _bus_dma_can_bounce() should be made once, at tag + * creation time, and the result stored in the tag. + * - It should be possible to take some shortcuts when mapping a buffer we know + * came from the uma(9) allocators based on what we know about such buffers + * (aligned, contiguous, etc). + * - The allocation of bounce pages could probably be cleaned up, then we could + * retire arm_remap_nocache(). */ #define _ARM32_BUS_DMA_PRIVATE @@ -40,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -50,7 +68,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include @@ -81,7 +102,6 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; - bus_dma_segment_t *segments; /* * DMA range for this tag. If the page doesn't fall within * one of these ranges, an error is returned. The caller @@ -91,6 +111,13 @@ struct bus_dma_tag { struct arm32_dma_range *ranges; int _nranges; struct bounce_zone *bounce_zone; + /* + * Most tags need one or two segments, and can use the local tagsegs + * array. For tags with a larger limit, we'll allocate a bigger array + * on first use. + */ + bus_dma_segment_t *segments; + bus_dma_segment_t tagsegs[2]; }; struct bounce_page { @@ -134,7 +161,7 @@ SYSCTL_INT(_hw_busdma, OID_AUTO, total_b #define DMAMAP_LINEAR 0x1 #define DMAMAP_MBUF 0x2 #define DMAMAP_UIO 0x4 -#define DMAMAP_ALLOCATED 0x10 +#define DMAMAP_CACHE_ALIGNED 0x10 #define DMAMAP_TYPE_MASK (DMAMAP_LINEAR|DMAMAP_MBUF|DMAMAP_UIO) #define DMAMAP_COHERENT 0x8 struct bus_dmamap { @@ -144,9 +171,6 @@ struct bus_dmamap { bus_dma_tag_t dmat; int flags; void *buffer; - void *origbuffer; - void *allocbuffer; - TAILQ_ENTRY(bus_dmamap) freelist; int len; STAILQ_ENTRY(bus_dmamap) links; bus_dmamap_callback_t *callback; @@ -157,12 +181,6 @@ struct bus_dmamap { static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = - TAILQ_HEAD_INITIALIZER(dmamap_freelist); - -#define BUSDMA_STATIC_MAPS 500 -static struct bus_dmamap map_pool[BUSDMA_STATIC_MAPS]; - static struct mtx busdma_mtx; MTX_SYSINIT(busdma_mtx, &busdma_mtx, "busdma lock", MTX_DEF); @@ -180,6 +198,91 @@ static void free_bounce_page(bus_dma_tag bus_dma_tag_t arm_root_dma_tag; /* + * ---------------------------------------------------------------------------- + * Begin block of code useful to transplant to other implementations. + */ + +static uma_zone_t dmamap_zone; /* Cache of struct bus_dmamap items */ + +static busdma_bufalloc_t coherent_allocator; /* Cache of coherent buffers */ +static busdma_bufalloc_t standard_allocator; /* Cache of standard buffers */ + +/* + * This is the ctor function passed to uma_zcreate() for the pool of dma maps. + * It'll need platform-specific changes if this code is copied. + */ +static int +dmamap_ctor(void *mem, int size, void *arg, int flags) +{ + bus_dmamap_t map; + bus_dma_tag_t dmat; + + map = (bus_dmamap_t)mem; + dmat = (bus_dma_tag_t)arg; + + dmat->map_count++; + + map->dmat = dmat; + map->flags = 0; + STAILQ_INIT(&map->bpages); + + return (0); +} + +/* + * This is the dtor function passed to uma_zcreate() for the pool of dma maps. + * It may need platform-specific changes if this code is copied . + */ +static void +dmamap_dtor(void *mem, int size, void *arg) +{ + bus_dmamap_t map; + + map = (bus_dmamap_t)mem; + + map->dmat->map_count--; +} + +static void +busdma_init(void *dummy) +{ + + /* Create a cache of maps for bus_dmamap_create(). */ + dmamap_zone = uma_zcreate("dma maps", sizeof(struct bus_dmamap), + dmamap_ctor, dmamap_dtor, NULL, NULL, UMA_ALIGN_PTR, 0); + + /* Create a cache of buffers in standard (cacheable) memory. */ + standard_allocator = busdma_bufalloc_create("buffer", + arm_dcache_align, /* minimum_alignment */ + NULL, /* uma_alloc func */ + NULL, /* uma_free func */ + 0); /* uma_zcreate_flags */ + + /* + * Create a cache of buffers in uncacheable memory, to implement the + * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. + */ + coherent_allocator = busdma_bufalloc_create("coherent", + arm_dcache_align, /* minimum_alignment */ + busdma_bufalloc_alloc_uncacheable, + busdma_bufalloc_free_uncacheable, + 0); /* uma_zcreate_flags */ +} + +/* + * This init historically used SI_SUB_VM, but now the init code requires + * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by + * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using + * SI_SUB_KMEM and SI_ORDER_THIRD. + */ +SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL); + +/* + * End block of code useful to transplant to other implementations. + * ---------------------------------------------------------------------------- + */ + +/* * Return true if a match is made. * * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. @@ -206,30 +309,26 @@ run_filter(bus_dma_tag_t dmat, bus_addr_ return (retval); } -static void -arm_dmamap_freelist_init(void *dummy) -{ - int i; - - for (i = 0; i < BUSDMA_STATIC_MAPS; i++) - TAILQ_INSERT_HEAD(&dmamap_freelist, &map_pool[i], freelist); -} - -SYSINIT(busdma, SI_SUB_VM, SI_ORDER_ANY, arm_dmamap_freelist_init, NULL); - /* - * Check to see if the specified page is in an allowed DMA range. + * This routine checks the exclusion zone constraints from a tag against the + * physical RAM available on the machine. If a tag specifies an exclusion zone + * but there's no RAM in that zone, then we avoid allocating resources to bounce + * a request, and we can use any memory allocator (as opposed to needing + * kmem_alloc_contig() just because it can allocate pages in an address range). + * + * Most tags have BUS_SPACE_MAXADDR or BUS_SPACE_MAXADDR_32BIT (they are the + * same value on 32-bit architectures) as their lowaddr constraint, and we can't + * possibly have RAM at an address higher than the highest address we can + * express, so we take a fast out. */ - -static __inline int -bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs, - bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap, - int flags, vm_offset_t *lastaddrp, int *segp); - static __inline int _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) { int i; + + if (lowaddr >= BUS_SPACE_MAXADDR) + return (0); + for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) || (lowaddr < phys_avail[i] && @@ -294,38 +393,6 @@ dflt_lock(void *arg, bus_dma_lock_op_t o #endif } -static __inline bus_dmamap_t -_busdma_alloc_dmamap(void) -{ - bus_dmamap_t map; - - mtx_lock(&busdma_mtx); - map = TAILQ_FIRST(&dmamap_freelist); - if (map) - TAILQ_REMOVE(&dmamap_freelist, map, freelist); - mtx_unlock(&busdma_mtx); - if (!map) { - map = malloc(sizeof(*map), M_DEVBUF, M_NOWAIT | M_ZERO); - if (map) - map->flags = DMAMAP_ALLOCATED; - } else - map->flags = 0; - STAILQ_INIT(&map->bpages); - return (map); -} - -static __inline void -_busdma_free_dmamap(bus_dmamap_t map) -{ - if (map->flags & DMAMAP_ALLOCATED) - free(map, M_DEVBUF); - else { - mtx_lock(&busdma_mtx); - TAILQ_INSERT_HEAD(&dmamap_freelist, map, freelist); - mtx_unlock(&busdma_mtx); - } -} - /* * Allocate a device specific dma_tag. */ @@ -354,7 +421,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, } newtag->parent = parent; - newtag->alignment = alignment; + newtag->alignment = alignment ? alignment : 1; newtag->boundary = boundary; newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); @@ -375,9 +442,19 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - newtag->segments = NULL; - - /* + /* + * If all the segments we need fit into the local tagsegs array, set the + * pointer now. Otherwise NULL the pointer and an array of segments + * will be allocated later, on first use. We don't pre-allocate now + * because some tags exist just to pass contraints to children in the + * device hierarchy, and they tend to use BUS_SPACE_UNRESTRICTED and we + * sure don't want to try to allocate an array for that. + */ + if (newtag->nsegments <= nitems(newtag->tagsegs)) + newtag->segments = newtag->tagsegs; + else + newtag->segments = NULL; + /* * Take into account any restrictions imposed by our parent tag */ if (parent != NULL) { @@ -450,6 +527,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) #endif if (dmat != NULL) { + if (dmat->map_count != 0) return (EBUSY); @@ -459,7 +537,8 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { - if (dmat->segments != NULL) + if (dmat->segments != NULL && + dmat->segments != dmat->tagsegs) free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* @@ -485,29 +564,19 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { - bus_dmamap_t newmap; + bus_dmamap_t map; int error = 0; - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - M_NOWAIT); - if (dmat->segments == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } - } + map = uma_zalloc_arg(dmamap_zone, dmat, M_WAITOK); + *mapp = map; - newmap = _busdma_alloc_dmamap(); - if (newmap == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); - return (ENOMEM); - } - *mapp = newmap; - newmap->dmat = dmat; - newmap->allocbuffer = NULL; - dmat->map_count++; + /* + * If the tag's segments haven't been allocated yet we need to do it + * now, because we can't sleep for resources at map load time. + */ + if (dmat->segments == NULL) + dmat->segments = malloc(dmat->nsegments * + sizeof(*dmat->segments), M_DEVBUF, M_WAITOK); /* * Bouncing might be required if the driver asks for an active @@ -522,7 +591,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) { - _busdma_free_dmamap(newmap); + uma_zfree(dmamap_zone, map); *mapp = NULL; return (error); } @@ -575,118 +644,129 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b __func__, dmat, EBUSY); return (EBUSY); } - _busdma_free_dmamap(map); + uma_zfree(dmamap_zone, map); if (dmat->bounce_zone) dmat->bounce_zone->map_count--; - 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. + * Allocate a piece of memory that can be efficiently mapped into bus device + * space based on the constraints listed in the dma tag. Returns a pointer to + * the allocated memory, and a pointer to an associated bus_dmamap. */ int -bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, +bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddrp, int flags, bus_dmamap_t *mapp) { - bus_dmamap_t newmap = NULL; - + void * vaddr; + struct busdma_bufzone *bufzone; + busdma_bufalloc_t ba; + bus_dmamap_t map; int mflags; + vm_memattr_t memattr; if (flags & BUS_DMA_NOWAIT) mflags = M_NOWAIT; else mflags = M_WAITOK; - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - mflags); - if (dmat->segments == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - return (ENOMEM); - } + + /* + * If the tag's segments haven't been allocated yet we need to do it + * now, because we can't sleep for resources at map load time. + */ + if (dmat->segments == NULL) + dmat->segments = malloc(dmat->nsegments * + sizeof(*dmat->segments), M_DEVBUF, mflags); + + map = uma_zalloc_arg(dmamap_zone, dmat, mflags); + if (map == NULL) + return (ENOMEM); + + if (flags & BUS_DMA_COHERENT) { + memattr = VM_MEMATTR_UNCACHEABLE; + ba = coherent_allocator; + map->flags |= DMAMAP_COHERENT; + } else { + memattr = VM_MEMATTR_DEFAULT; + ba = standard_allocator; } + /* All buffers we allocate are cache-aligned. */ + map->flags |= DMAMAP_CACHE_ALIGNED; + if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; - newmap = _busdma_alloc_dmamap(); - if (newmap == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - return (ENOMEM); + /* + * Try to find a bufzone in the allocator that holds a cache of buffers + * of the right size for this request. If the buffer is too big to be + * held in the allocator cache, this returns NULL. + */ + bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); + + /* + * Allocate the buffer from the uma(9) allocator if... + * - It's small enough to be in the allocator (bufzone not NULL). + * - The alignment constraint isn't larger than the allocation size + * (the allocator aligns buffers to their size boundaries). + * - There's no need to handle lowaddr/highaddr exclusion zones. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed nsegments. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. + */ + if (bufzone != NULL && dmat->alignment <= bufzone->size && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { + vaddr = uma_zalloc(bufzone->umazone, mflags); + } else if (dmat->nsegments >= btoc(dmat->maxsize) && + dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { + vaddr = (void *)kmem_alloc_attr(kernel_map, dmat->maxsize, + mflags, 0, dmat->lowaddr, memattr); + } else { + vaddr = (void *)kmem_alloc_contig(kernel_map, dmat->maxsize, + mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, + memattr); } - dmat->map_count++; - *mapp = newmap; - newmap->dmat = dmat; - - if (dmat->maxsize <= PAGE_SIZE && - (dmat->alignment < dmat->maxsize) && - !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { - *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); - } else { - /* - * XXX Use Contigmalloc until it is merged into this facility - * and handles multi-seg allocations. Nobody is doing - * multi-seg allocations yet though. - */ - *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, - 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, - dmat->boundary); - } - if (*vaddr == NULL) { - if (newmap != NULL) { - _busdma_free_dmamap(newmap); - dmat->map_count--; - } - *mapp = NULL; - return (ENOMEM); + + if (vaddr == NULL) { + uma_zfree(dmamap_zone, map); + map = NULL; } - if (flags & BUS_DMA_COHERENT) { - void *tmpaddr = arm_remap_nocache( - (void *)((vm_offset_t)*vaddr &~ PAGE_MASK), - dmat->maxsize + ((vm_offset_t)*vaddr & PAGE_MASK)); - - if (tmpaddr) { - tmpaddr = (void *)((vm_offset_t)(tmpaddr) + - ((vm_offset_t)*vaddr & PAGE_MASK)); - newmap->origbuffer = *vaddr; - newmap->allocbuffer = tmpaddr; - *vaddr = tmpaddr; - } else - newmap->origbuffer = newmap->allocbuffer = NULL; - } else - newmap->origbuffer = newmap->allocbuffer = NULL; - return (0); + + *vaddrp = vaddr; + *mapp = map; + + return (vaddr == NULL ? ENOMEM : 0); } /* - * Free a piece of memory and it's allocated dmamap, that was allocated - * via bus_dmamem_alloc. Make the same choice for free/contigfree. + * Free a piece of memory that was allocated via bus_dmamem_alloc, along with + * its associated map. */ void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { - if (map->allocbuffer) { - KASSERT(map->allocbuffer == vaddr, - ("Trying to freeing the wrong DMA buffer")); - vaddr = map->origbuffer; - arm_unmap_nocache(map->allocbuffer, - dmat->maxsize + ((vm_offset_t)vaddr & PAGE_MASK)); - } - if (dmat->maxsize <= PAGE_SIZE && - dmat->alignment < dmat->maxsize && + struct busdma_bufzone *bufzone; + busdma_bufalloc_t ba; + + if (map->flags & DMAMAP_COHERENT) + ba = coherent_allocator; + else + ba = standard_allocator; + uma_zfree(dmamap_zone, map); + + /* Be careful not to access map from here on. */ + + bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); + + if (bufzone != NULL && dmat->alignment <= bufzone->size && !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) - free(vaddr, M_DEVBUF); - else { - contigfree(vaddr, dmat->maxsize, M_DEVBUF); - } - dmat->map_count--; - _busdma_free_dmamap(map); - CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); + uma_zfree(bufzone->umazone, vaddr); + else + kmem_free(kernel_map, (vm_offset_t)vaddr, dmat->maxsize); } static int @@ -795,10 +875,6 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma else curaddr = (*pde & L1_S_FRAME) | (vaddr & L1_S_OFFSET); - if (*pde & L1_S_CACHE_MASK) { - map->flags &= - ~DMAMAP_COHERENT; - } } else { pte = *ptep; KASSERT((pte & L2_TYPE_MASK) != L2_TYPE_INV, @@ -807,18 +883,9 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma == L2_TYPE_L)) { curaddr = (pte & L2_L_FRAME) | (vaddr & L2_L_OFFSET); - if (pte & L2_L_CACHE_MASK) { - map->flags &= - ~DMAMAP_COHERENT; - - } } else { curaddr = (pte & L2_S_FRAME) | (vaddr & L2_S_OFFSET); - if (pte & L2_S_CACHE_MASK) { - map->flags &= - ~DMAMAP_COHERENT; - } } } } else { @@ -914,7 +981,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ map->callback = callback; map->callback_arg = callback_arg; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_LINEAR|DMAMAP_COHERENT; + map->flags |= DMAMAP_LINEAR; map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, @@ -935,6 +1002,15 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ /* * Like bus_dmamap_load(), but for mbufs. + * + * Note that the manpage states that BUS_DMA_NOWAIT is implied for mbufs. + * + * We know that the way the system allocates and uses mbufs implies that we can + * treat them as DMAMAP_CACHE_ALIGNED in terms of handling partial cache line + * flushes. Even though the flush may reference the data area within the mbuf + * that isn't aligned to a cache line, we know the overall mbuf itself is + * properly aligned, and we know that the CPU will not touch the header fields + * before the data area while the DMA is in progress. */ int bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, @@ -945,8 +1021,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; + map->flags |= DMAMAP_MBUF | DMAMAP_CACHE_ALIGNED; map->buffer = m0; map->len = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { @@ -969,7 +1046,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); + (*callback)(callback_arg, NULL, 0, 0, error); } else { (*callback)(callback_arg, dmat->segments, nsegs + 1, m0->m_pkthdr.len, error); @@ -991,7 +1068,7 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm flags |= BUS_DMA_NOWAIT; *nsegs = -1; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; + map->flags |= DMAMAP_MBUF | DMAMAP_CACHE_ALIGNED; map->buffer = m0; map->len = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { @@ -1035,7 +1112,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, resid = uio->uio_resid; iov = uio->uio_iov; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_UIO|DMAMAP_COHERENT; + map->flags |= DMAMAP_UIO; map->buffer = uio; map->len = 0; @@ -1058,7 +1135,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dmat->segments, + error = bus_dmamap_load_buffer(dmat, dmat->segments, map, addr, minlen, pmap, flags, &lastaddr, &nsegs); map->len += minlen; @@ -1070,7 +1147,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); + (*callback)(callback_arg, NULL, 0, 0, error); } else { (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); @@ -1098,7 +1175,7 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b } static void -bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) +bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op, int bufaligned) { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; register_t s; @@ -1108,7 +1185,25 @@ bus_dmamap_sync_buf(void *buf, int len, cpu_dcache_wb_range((vm_offset_t)buf, len); cpu_l2cache_wb_range((vm_offset_t)buf, len); } + + /* + * If the caller promises the buffer is properly aligned to a cache line + * (even if the call parms make it look like it isn't) we can avoid + * attempting to preserve the non-DMA part of the cache line in the + * POSTREAD case, but we MUST still do a writeback in the PREREAD case. + * + * This covers the case of mbufs, where we know how they're aligned and + * know the CPU doesn't touch the header in front of the DMA data area + * during the IO, but it may have touched it right before invoking the + * sync, so a PREREAD writeback is required. + * + * It also handles buffers we created in bus_dmamem_alloc(), which are + * always aligned and padded to cache line size even if the IO length + * isn't a multiple of cache line size. In this case the PREREAD + * writeback probably isn't required, but it's harmless. + */ partial = (((vm_offset_t)buf) | len) & arm_dcache_align_mask; + if (op & BUS_DMASYNC_PREREAD) { if (!(op & BUS_DMASYNC_PREWRITE) && !partial) { cpu_dcache_inv_range((vm_offset_t)buf, len); @@ -1119,7 +1214,7 @@ bus_dmamap_sync_buf(void *buf, int len, } } if (op & BUS_DMASYNC_POSTREAD) { - if (partial) { + if (partial && !bufaligned) { s = intr_disable(); if ((vm_offset_t)buf & arm_dcache_align_mask) memcpy(_tmp_cl, (void *)((vm_offset_t)buf & @@ -1133,7 +1228,7 @@ bus_dmamap_sync_buf(void *buf, int len, } cpu_dcache_inv_range((vm_offset_t)buf, len); cpu_l2cache_inv_range((vm_offset_t)buf, len); - if (partial) { + if (partial && !bufaligned) { if ((vm_offset_t)buf & arm_dcache_align_mask) memcpy((void *)((vm_offset_t)buf & ~arm_dcache_align_mask), _tmp_cl, @@ -1204,25 +1299,29 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus struct uio *uio; int resid; struct iovec *iov; - + int bufaligned; + if (op == BUS_DMASYNC_POSTWRITE) return; + if (map->flags & DMAMAP_COHERENT) + goto drain; if (STAILQ_FIRST(&map->bpages)) _bus_dmamap_sync_bp(dmat, map, op); - if (map->flags & DMAMAP_COHERENT) - return; CTR3(KTR_BUSDMA, "%s: op %x flags %x", __func__, op, map->flags); + bufaligned = (map->flags & DMAMAP_CACHE_ALIGNED); switch(map->flags & DMAMAP_TYPE_MASK) { case DMAMAP_LINEAR: if (!(_bus_dma_buf_is_in_bp(map, map->buffer, map->len))) - bus_dmamap_sync_buf(map->buffer, map->len, op); + bus_dmamap_sync_buf(map->buffer, map->len, op, + bufaligned); break; case DMAMAP_MBUF: m = map->buffer; while (m) { if (m->m_len > 0 && !(_bus_dma_buf_is_in_bp(map, m->m_data, m->m_len))) - bus_dmamap_sync_buf(m->m_data, m->m_len, op); + bus_dmamap_sync_buf(m->m_data, m->m_len, op, + bufaligned); m = m->m_next; } break; @@ -1237,7 +1336,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (!_bus_dma_buf_is_in_bp(map, iov[i].iov_base, minlen)) bus_dmamap_sync_buf(iov[i].iov_base, - minlen, op); + minlen, op, bufaligned); resid -= minlen; } } @@ -1245,6 +1344,9 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus default: break; } + +drain: + cpu_drain_writebuf(); } Modified: stable/9/sys/arm/arm/pmap.c ============================================================================== --- stable/9/sys/arm/arm/pmap.c Mon Jun 17 21:36:29 2013 (r251870) +++ stable/9/sys/arm/arm/pmap.c Mon Jun 17 21:41:14 2013 (r251871) @@ -1400,7 +1400,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_ (pv->pv_flags & PVF_NC)) { pv->pv_flags &= ~PVF_NC; - pmap_set_cache_entry(pv, pm, va, 1); + if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE)) + pmap_set_cache_entry(pv, pm, va, 1); continue; } /* user is no longer sharable and writable */ @@ -1409,7 +1410,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_ !pmwc && (pv->pv_flags & PVF_NC)) { pv->pv_flags &= ~(PVF_NC | PVF_MWC); - pmap_set_cache_entry(pv, pm, va, 1); + if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE)) + pmap_set_cache_entry(pv, pm, va, 1); } } @@ -1460,15 +1462,16 @@ pmap_clearbit(struct vm_page *pg, u_int if (!(oflags & maskbits)) { if ((maskbits & PVF_WRITE) && (pv->pv_flags & PVF_NC)) { - /* It is safe to re-enable cacheing here. */ - PMAP_LOCK(pm); - l2b = pmap_get_l2_bucket(pm, va); - ptep = &l2b->l2b_kva[l2pte_index(va)]; - *ptep |= pte_l2_s_cache_mode; - PTE_SYNC(ptep); - PMAP_UNLOCK(pm); + if (!(pg->md.pv_memattr & + VM_MEMATTR_UNCACHEABLE)) { + PMAP_LOCK(pm); + l2b = pmap_get_l2_bucket(pm, va); + ptep = &l2b->l2b_kva[l2pte_index(va)]; + *ptep |= pte_l2_s_cache_mode; + PTE_SYNC(ptep); + PMAP_UNLOCK(pm); + } pv->pv_flags &= ~(PVF_NC | PVF_MWC); - } continue; } @@ -1497,7 +1500,9 @@ pmap_clearbit(struct vm_page *pg, u_int * permission. */ if (maskbits & PVF_WRITE) { - npte |= pte_l2_s_cache_mode; + if (!(pg->md.pv_memattr & + VM_MEMATTR_UNCACHEABLE)) + npte |= pte_l2_s_cache_mode; pv->pv_flags &= ~(PVF_NC | PVF_MWC); } } else @@ -1838,6 +1843,7 @@ pmap_page_init(vm_page_t m) { TAILQ_INIT(&m->md.pv_list); + m->md.pv_memattr = VM_MEMATTR_DEFAULT; } /* @@ -3433,7 +3439,8 @@ do_l2b_alloc: (m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_WRITEABLE); } - npte |= pte_l2_s_cache_mode; + if (!(m->md.pv_memattr & VM_MEMATTR_UNCACHEABLE)) + npte |= pte_l2_s_cache_mode; if (m && m == opg) { /* * We're changing the attrs of an existing mapping. @@ -5018,3 +5025,24 @@ pmap_devmap_find_va(vm_offset_t va, vm_s return (NULL); } +void +pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) +{ + /* + * Remember the memattr in a field that gets used to set the appropriate + * bits in the PTEs as mappings are established. + */ + m->md.pv_memattr = ma; + + /* + * It appears that this function can only be called before any mappings + * for the page are established on ARM. If this ever changes, this code + * will need to walk the pv_list and make each of the existing mappings + * uncacheable, being careful to sync caches and PTEs (and maybe + * invalidate TLB?) for any current mapping it modifies. + */ + if (m->md.pv_kva != 0 || TAILQ_FIRST(&m->md.pv_list) != NULL) + panic("Can't change memattr on page with existing mappings"); +} + + Modified: stable/9/sys/arm/include/pmap.h ============================================================================== --- stable/9/sys/arm/include/pmap.h Mon Jun 17 21:36:29 2013 (r251870) +++ stable/9/sys/arm/include/pmap.h Mon Jun 17 21:41:14 2013 (r251871) @@ -76,10 +76,10 @@ #endif -#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT +#define pmap_page_get_memattr(m) ((m)->md.pv_memattr) #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) -#define pmap_page_set_memattr(m, ma) (void)0 +void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); /* * Pmap stuff @@ -99,6 +99,7 @@ struct pv_entry; struct md_page { int pvh_attrs; + vm_memattr_t pv_memattr; vm_offset_t pv_kva; /* first kernel VA mapping */ TAILQ_HEAD(,pv_entry) pv_list; }; Modified: stable/9/sys/arm/include/vm.h ============================================================================== --- stable/9/sys/arm/include/vm.h Mon Jun 17 21:36:29 2013 (r251870) +++ stable/9/sys/arm/include/vm.h Mon Jun 17 21:41:14 2013 (r251871) @@ -29,7 +29,8 @@ #ifndef _MACHINE_VM_H_ #define _MACHINE_VM_H_ -/* Memory attribute configuration is not (yet) implemented. */ +/* Memory attribute configuration. */ #define VM_MEMATTR_DEFAULT 0 +#define VM_MEMATTR_UNCACHEABLE 1 #endif /* !_MACHINE_VM_H_ */ Modified: stable/9/sys/conf/files.arm ============================================================================== --- stable/9/sys/conf/files.arm Mon Jun 17 21:36:29 2013 (r251870) +++ stable/9/sys/conf/files.arm Mon Jun 17 21:41:14 2013 (r251871) @@ -77,4 +77,5 @@ libkern/umoddi3.c standard #libkern/arm/strcmp.S standard #libkern/arm/strncmp.S standard # +kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard Copied: stable/9/sys/kern/subr_busdma_bufalloc.c (from r244466, head/sys/kern/subr_busdma_bufalloc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/kern/subr_busdma_bufalloc.c Mon Jun 17 21:41:14 2013 (r251871, copy of r244466, head/sys/kern/subr_busdma_bufalloc.c) @@ -0,0 +1,174 @@ +/*- + * Copyright (c) 2012 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Buffer allocation support routines for bus_dmamem_alloc implementations. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Jun 17 23:21:18 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC0EC6CA; Mon, 17 Jun 2013 23:21:18 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AEC371766; Mon, 17 Jun 2013 23:21: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 r5HNLIw6086003; Mon, 17 Jun 2013 23:21:18 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5HNLIr7086002; Mon, 17 Jun 2013 23:21:18 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306172321.r5HNLIr7086002@svn.freebsd.org> From: Scott Long Date: Mon, 17 Jun 2013 23:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251873 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 23:21:19 -0000 Author: scottl Date: Mon Jun 17 23:21:18 2013 New Revision: 251873 URL: http://svnweb.freebsd.org/changeset/base/251873 Log: MFC r244575: The manpage states that bus_dmamap_create(9) returns ENOMEM if it can't allocate a map or mapping resources. That seems to imply that any memory allocations it does must use M_NOWAIT and check for NULL. MFC 246158: Use pmap_kextract() instead of inlining the page table walk. Remove the comment referencing non-existing code. Submitted by: kib, cognet Approved by: marius Obtained from: Netflix Modified: stable/9/sys/arm/arm/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 22:59:47 2013 (r251872) +++ stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 23:21:18 2013 (r251873) @@ -567,16 +567,24 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bus_dmamap_t map; int error = 0; - map = uma_zalloc_arg(dmamap_zone, dmat, M_WAITOK); + map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); *mapp = map; + if (map == NULL) + return (ENOMEM); /* * If the tag's segments haven't been allocated yet we need to do it * now, because we can't sleep for resources at map load time. */ - if (dmat->segments == NULL) + if (dmat->segments == NULL) { dmat->segments = malloc(dmat->nsegments * - sizeof(*dmat->segments), M_DEVBUF, M_WAITOK); + sizeof(*dmat->segments), M_DEVBUF, M_NOWAIT); + if (dmat->segments == NULL) { + uma_zfree(dmamap_zone, map); + *mapp = NULL; + return (ENOMEM); + } + } /* * Bouncing might be required if the driver asks for an active @@ -841,9 +849,6 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma vm_offset_t vaddr = (vm_offset_t)buf; int seg; int error = 0; - pd_entry_t *pde; - pt_entry_t pte; - pt_entry_t *ptep; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -860,34 +865,9 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma for (seg = *segp; buflen > 0 ; ) { /* * Get the physical address for this segment. - * - * XXX Don't support checking for coherent mappings - * XXX in user address space. */ if (__predict_true(pmap == pmap_kernel())) { - if (pmap_get_pde_pte(pmap, vaddr, &pde, &ptep) == FALSE) - return (EFAULT); - - if (__predict_false(pmap_pde_section(pde))) { - if (*pde & L1_S_SUPERSEC) - curaddr = (*pde & L1_SUP_FRAME) | - (vaddr & L1_SUP_OFFSET); - else - curaddr = (*pde & L1_S_FRAME) | - (vaddr & L1_S_OFFSET); - } else { - pte = *ptep; - KASSERT((pte & L2_TYPE_MASK) != L2_TYPE_INV, - ("INV type")); - if (__predict_false((pte & L2_TYPE_MASK) - == L2_TYPE_L)) { - curaddr = (pte & L2_L_FRAME) | - (vaddr & L2_L_OFFSET); - } else { - curaddr = (pte & L2_S_FRAME) | - (vaddr & L2_S_OFFSET); - } - } + curaddr = pmap_kextract(vaddr); } else { curaddr = pmap_extract(pmap, vaddr); map->flags &= ~DMAMAP_COHERENT; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 00:36:54 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8589EA50; Tue, 18 Jun 2013 00:36:54 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7490A1A95; Tue, 18 Jun 2013 00:36: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 r5I0asIm009651; Tue, 18 Jun 2013 00:36:54 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I0askx009647; Tue, 18 Jun 2013 00:36:54 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180036.r5I0askx009647@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 00:36: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: r251874 - in stable/9/sys: arm/arm cam cam/ctl cam/scsi conf dev/aac dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/aic7xxx dev/amr dev/arcmsr dev/ata dev/buslogic dev/ciss dev/dpt d... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 00:36:54 -0000 Author: scottl Date: Tue Jun 18 00:36:53 2013 New Revision: 251874 URL: http://svnweb.freebsd.org/changeset/base/251874 Log: Big MFC of the physbio changes necessary for unmapped I/O. These changes have been in production at Netflix for several months with significant success. MFC r246713: Reform the busdma API so that new types may be added without modifying every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. MFC r249538: Some compilers issue a warning when wider integer is casted to narrow pointer. Supposedly shut down the warning by casting through uintptr_t. MFC r251479: Simplify the checking of flags for cam_periph_mapmem(). This gets rid of a lot of code redundancy and grossness at very minor expense. MFC r251837: MFC r251842: Add infrastructure for doing compatibility shims, as has been sorely needed for the last 10 years. Far too much of the internal API is exposed, and every small adjustment causes applications to stop working. To kick this off, bump the API version to 0x17 as should have been done with r246713, but add shims to compensate. Thanks to the shims, there should be no visible change in application behavior. Submitted by: kib, jeffr Approved by: kib Obtained from: Netflix Added: stable/9/sys/cam/cam_compat.c - copied unchanged from r251837, head/sys/cam/cam_compat.c stable/9/sys/cam/cam_compat.h - copied unchanged from r251837, head/sys/cam/cam_compat.h stable/9/sys/kern/subr_bus_dma.c - copied, changed from r246713, head/sys/kern/subr_bus_dma.c stable/9/sys/sys/memdesc.h - copied unchanged from r246713, head/sys/sys/memdesc.h Modified: stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_sg.c stable/9/sys/cam/scsi/scsi_target.c stable/9/sys/conf/files stable/9/sys/dev/aac/aac_cam.c stable/9/sys/dev/advansys/advansys.c stable/9/sys/dev/advansys/adwcam.c stable/9/sys/dev/aha/aha.c stable/9/sys/dev/ahb/ahb.c stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/aic/aic.c stable/9/sys/dev/aic7xxx/aic79xx_osm.c stable/9/sys/dev/aic7xxx/aic7xxx_osm.c stable/9/sys/dev/amr/amr_cam.c stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/ata/ata-dma.c stable/9/sys/dev/ata/atapi-cam.c stable/9/sys/dev/buslogic/bt.c stable/9/sys/dev/ciss/ciss.c stable/9/sys/dev/ciss/cissvar.h stable/9/sys/dev/dpt/dpt_scsi.c stable/9/sys/dev/firewire/sbp.c stable/9/sys/dev/hpt27xx/osm_bsd.c stable/9/sys/dev/hptiop/hptiop.c stable/9/sys/dev/hptmv/entry.c stable/9/sys/dev/hptrr/hptrr_osm_bsd.c stable/9/sys/dev/iir/iir.c stable/9/sys/dev/isci/isci_io_request.c stable/9/sys/dev/isp/isp_pci.c stable/9/sys/dev/isp/isp_sbus.c stable/9/sys/dev/mfi/mfi.c stable/9/sys/dev/mfi/mfi_cam.c stable/9/sys/dev/mly/mly.c stable/9/sys/dev/mly/mlyvar.h stable/9/sys/dev/mps/mps.c stable/9/sys/dev/mps/mps_sas.c stable/9/sys/dev/mps/mpsvar.h stable/9/sys/dev/mpt/mpt_cam.c stable/9/sys/dev/mvs/mvs.c stable/9/sys/dev/siis/siis.c stable/9/sys/dev/sym/sym_hipd.c stable/9/sys/dev/trm/trm.c stable/9/sys/dev/twa/tw_osl.h stable/9/sys/dev/twa/tw_osl_cam.c stable/9/sys/dev/twa/tw_osl_freebsd.c stable/9/sys/dev/tws/tws.h stable/9/sys/dev/tws/tws_cam.c stable/9/sys/dev/virtio/scsi/virtio_scsi.c stable/9/sys/dev/wds/wd7000.c stable/9/sys/ia64/ia64/busdma_machdep.c stable/9/sys/kern/subr_uio.c stable/9/sys/mips/mips/busdma_machdep.c stable/9/sys/modules/cam/Makefile stable/9/sys/powerpc/powerpc/busdma_machdep.c stable/9/sys/powerpc/ps3/ps3cdrom.c stable/9/sys/sparc64/include/bus_dma.h stable/9/sys/sparc64/sparc64/bus_machdep.c stable/9/sys/sparc64/sparc64/iommu.c stable/9/sys/sys/bus_dma.h stable/9/sys/sys/uio.h stable/9/sys/x86/x86/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Mon Jun 17 23:21:18 2013 (r251873) +++ stable/9/sys/arm/arm/busdma_machdep.c Tue Jun 18 00:36:53 2013 (r251874) @@ -61,12 +61,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include -#include #include #include #include +#include #include #include @@ -125,10 +125,17 @@ struct bounce_page { vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */ 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; }; +struct sync_list { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + bus_size_t datacount; /* client data count */ +}; + int busdma_swi_pending; struct bounce_zone { @@ -158,24 +165,21 @@ static SYSCTL_NODE(_hw, OID_AUTO, busdma SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); -#define DMAMAP_LINEAR 0x1 -#define DMAMAP_MBUF 0x2 -#define DMAMAP_UIO 0x4 -#define DMAMAP_CACHE_ALIGNED 0x10 -#define DMAMAP_TYPE_MASK (DMAMAP_LINEAR|DMAMAP_MBUF|DMAMAP_UIO) #define DMAMAP_COHERENT 0x8 +#define DMAMAP_CACHE_ALIGNED 0x10 + struct bus_dmamap { struct bp_list bpages; int pagesneeded; int pagesreserved; bus_dma_tag_t dmat; + struct memdesc mem; int flags; - void *buffer; - int len; STAILQ_ENTRY(bus_dmamap) links; bus_dmamap_callback_t *callback; void *callback_arg; - + int sync_count; + struct sync_list *slist; }; static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; @@ -191,7 +195,8 @@ static int alloc_bounce_pages(bus_dma_ta 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_size_t size); + 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); /* Default tag, as most drivers provide no parent tag. */ @@ -564,13 +569,20 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { + struct sync_list *slist; bus_dmamap_t map; int error = 0; + slist = malloc(sizeof(*slist) * dmat->nsegments, M_DEVBUF, M_NOWAIT); + if (slist == NULL) + return (ENOMEM); + map = uma_zalloc_arg(dmamap_zone, dmat, M_NOWAIT); *mapp = map; - if (map == NULL) + if (map == NULL) { + free(slist, M_DEVBUF); return (ENOMEM); + } /* * If the tag's segments haven't been allocated yet we need to do it @@ -580,6 +592,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in dmat->segments = malloc(dmat->nsegments * sizeof(*dmat->segments), M_DEVBUF, M_NOWAIT); if (dmat->segments == NULL) { + free(slist, M_DEVBUF); uma_zfree(dmamap_zone, map); *mapp = NULL; return (ENOMEM); @@ -599,6 +612,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) { + free(slist, M_DEVBUF); uma_zfree(dmamap_zone, map); *mapp = NULL; return (error); @@ -633,6 +647,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, in } bz->map_count++; } + map->sync_count = 0; + map->slist = slist; CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); @@ -647,11 +663,12 @@ int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (STAILQ_FIRST(&map->bpages) != NULL) { + if (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); return (EBUSY); } + free(map->slist, M_DEVBUF); uma_zfree(dmamap_zone, map); if (dmat->bounce_zone) dmat->bounce_zone->map_count--; @@ -668,6 +685,7 @@ int bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddrp, int flags, bus_dmamap_t *mapp) { + struct sync_list *slist; void * vaddr; struct busdma_bufzone *bufzone; busdma_bufalloc_t ba; @@ -679,7 +697,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; - /* * If the tag's segments haven't been allocated yet we need to do it * now, because we can't sleep for resources at map load time. @@ -688,10 +705,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi dmat->segments = malloc(dmat->nsegments * sizeof(*dmat->segments), M_DEVBUF, mflags); + slist = malloc(sizeof(*slist) * dmat->nsegments, M_DEVBUF, M_NOWAIT); + if (slist == NULL) + return (ENOMEM); map = uma_zalloc_arg(dmamap_zone, dmat, mflags); - if (map == NULL) + if (map == NULL) { + free(slist, M_DEVBUF); return (ENOMEM); - + } if (flags & BUS_DMA_COHERENT) { memattr = VM_MEMATTR_UNCACHEABLE; ba = coherent_allocator; @@ -738,12 +759,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, memattr); } - if (vaddr == NULL) { + free(slist, M_DEVBUF); uma_zfree(dmamap_zone, map); map = NULL; + } else { + map->slist = slist; + map->sync_count = 0; } - *vaddrp = vaddr; *mapp = map; @@ -762,10 +785,11 @@ bus_dmamem_free(bus_dma_tag_t dmat, void if (map->flags & DMAMAP_COHERENT) ba = coherent_allocator; - else + else ba = standard_allocator; - uma_zfree(dmamap_zone, map); + uma_zfree(dmamap_zone, map); + free(map->slist, M_DEVBUF); /* Be careful not to access map from here on. */ bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); @@ -777,7 +801,37 @@ bus_dmamem_free(bus_dma_tag_t dmat, void kmem_free(kernel_map, (vm_offset_t)vaddr, dmat->maxsize); } -static int +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->pagesneeded == 0)) { + CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", + dmat->lowaddr, dmat->boundary, dmat->alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", + map, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->maxsegsz); + if (run_filter(dmat, curaddr) != 0) { + 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) { @@ -798,75 +852,183 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - if (__predict_true(pmap == pmap_kernel())) + if (__predict_true(pmap == kernel_pmap)) paddr = pmap_kextract(vaddr); else paddr = pmap_extract(pmap, vaddr); - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - run_filter(dmat, paddr) != 0) + if (run_filter(dmat, paddr) != 0) map->pagesneeded++; vaddr += PAGE_SIZE; } 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 */ - if (map->pagesneeded != 0) { - 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_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); } + 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->boundary - 1); + if (dmat->boundary > 0) { + baddr = (curaddr + dmat->boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + if (dmat->ranges) { + struct arm32_dma_range *dr; + + dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, + curaddr); + if (dr == NULL) + return (EINVAL); + /* + * In a valid DMA range. Translate the physical + * memory address to an address in the DMA window. + */ + curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase; + + } + + seg = *segp; + /* + * Insert chunk into a segment, coalescing with + * the previous segment if possible. + */ + if (seg >= 0 && + curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && + (dmat->boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) { + segs[seg].ds_len += sgsize; + } else { + if (++seg >= dmat->nsegments) + return (EFBIG); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + *segp = seg; return (0); } /* - * Utility function to load a linear buffer. lastaddrp holds state - * between invocations (for multiple-buffer loads). segp contains + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +int +_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 (segs == NULL) + segs = dmat->segments; + + if ((dmat->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->maxsegsz); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, 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? + */ + if (buflen != 0) { + _bus_dmamap_unload(dmat, map); + return (EFBIG); /* XXX better return value here? */ + } + return (0); +} +/* + * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. - * first indicates if this is the first invocation of this function. */ -static __inline int -bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t *segs, - bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap, - int flags, vm_offset_t *lastaddrp, int *segp) +int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, + int *segp) { bus_size_t sgsize; - bus_addr_t curaddr, lastaddr, baddr, bmask; + bus_addr_t curaddr; + struct sync_list *sl; vm_offset_t vaddr = (vm_offset_t)buf; - int seg; int error = 0; - lastaddr = *lastaddrp; - bmask = ~(dmat->boundary - 1); + if (segs == NULL) + segs = dmat->segments; + if ((flags & BUS_DMA_LOAD_MBUF) != 0) + map->flags |= DMAMAP_CACHE_ALIGNED; if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { - error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, - flags); - if (error) - return (error); + _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); + } } CTR3(KTR_BUSDMA, "lowaddr= %d boundary= %d, " "alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); - for (seg = *segp; buflen > 0 ; ) { + while (buflen > 0) { /* * Get the physical address for this segment. */ - if (__predict_true(pmap == pmap_kernel())) { + if (__predict_true(pmap == kernel_pmap)) { curaddr = pmap_kextract(vaddr); } else { curaddr = pmap_extract(pmap, vaddr); @@ -882,260 +1044,63 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma if (buflen < sgsize) sgsize = buflen; - /* - * Make sure we don't cross any boundaries. - */ - if (dmat->boundary > 0) { - baddr = (curaddr + dmat->boundary) & bmask; - if (sgsize > (baddr - curaddr)) - sgsize = (baddr - curaddr); - } if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && run_filter(dmat, curaddr)) - curaddr = add_bounce_page(dmat, map, vaddr, sgsize); - - if (dmat->ranges) { - struct arm32_dma_range *dr; - - dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, - curaddr); - if (dr == NULL) - return (EINVAL); - /* - * In a valid DMA range. Translate the physical - * memory address to an address in the DMA window. - */ - curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase; - - } - - /* - * Insert chunk into a segment, coalescing with - * the previous segment if possible. - */ - if (seg >= 0 && curaddr == lastaddr && - (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && - (dmat->boundary == 0 || - (segs[seg].ds_addr & bmask) == - (curaddr & bmask))) { - segs[seg].ds_len += sgsize; - goto segdone; + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + curaddr = add_bounce_page(dmat, map, vaddr, curaddr, + sgsize); } else { - if (++seg >= dmat->nsegments) - break; - segs[seg].ds_addr = curaddr; - segs[seg].ds_len = sgsize; - } - if (error) + sl = &map->slist[map->sync_count - 1]; + if (map->sync_count == 0 || + vaddr != sl->vaddr + sl->datacount) { + if (++map->sync_count > dmat->nsegments) + goto cleanup; + sl++; + sl->vaddr = vaddr; + sl->datacount = sgsize; + sl->busaddr = curaddr; + } else + sl->datacount += sgsize; + } + sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, + segp); + if (sgsize == 0) break; -segdone: - lastaddr = curaddr + sgsize; vaddr += sgsize; buflen -= sgsize; } - *segp = seg; - *lastaddrp = lastaddr; - +cleanup: /* * Did we fit? */ - if (buflen != 0) - error = EFBIG; /* XXX better return value here? */ - return (error); + if (buflen != 0) { + _bus_dmamap_unload(dmat, map); + return (EFBIG); /* XXX better return value here? */ + } + return (0); } -/* - * Map the buffer buf into bus space using the dmamap map. - */ -int -bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, bus_dmamap_callback_t *callback, - void *callback_arg, int flags) +void +__bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, + void *callback_arg) { - vm_offset_t lastaddr = 0; - int error, nsegs = -1; KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); + map->mem = *mem; map->callback = callback; map->callback_arg = callback_arg; - map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_LINEAR; - map->buffer = buf; - map->len = buflen; - error = bus_dmamap_load_buffer(dmat, - dmat->segments, map, buf, buflen, kernel_pmap, - flags, &lastaddr, &nsegs); - if (error == EINPROGRESS) - return (error); - if (error) - (*callback)(callback_arg, NULL, 0, error); - else - (*callback)(callback_arg, dmat->segments, nsegs + 1, error); - - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, nsegs + 1, error); - - return (error); } -/* - * Like bus_dmamap_load(), but for mbufs. - * - * Note that the manpage states that BUS_DMA_NOWAIT is implied for mbufs. - * - * We know that the way the system allocates and uses mbufs implies that we can - * treat them as DMAMAP_CACHE_ALIGNED in terms of handling partial cache line - * flushes. Even though the flush may reference the data area within the mbuf - * that isn't aligned to a cache line, we know the overall mbuf itself is - * properly aligned, and we know that the CPU will not touch the header fields - * before the data area while the DMA is in progress. - */ -int -bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) -{ - int nsegs = -1, error = 0; - - M_ASSERTPKTHDR(m0); - - flags |= BUS_DMA_NOWAIT; - map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_CACHE_ALIGNED; - map->buffer = m0; - map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { - vm_offset_t lastaddr = 0; - struct mbuf *m; - - for (m = m0; m != NULL && error == 0; m = m->m_next) { - if (m->m_len > 0) { - error = bus_dmamap_load_buffer(dmat, - dmat->segments, map, m->m_data, m->m_len, - pmap_kernel(), flags, &lastaddr, &nsegs); - map->len += m->m_len; - } - } - } else { - error = EINVAL; - } - - if (error) { - /* - * force "no valid mappings" on error in callback. - */ - (*callback)(callback_arg, NULL, 0, 0, error); - } else { - (*callback)(callback_arg, dmat->segments, nsegs + 1, - m0->m_pkthdr.len, error); - } - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); - - return (error); -} - -int -bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, - int flags) +bus_dma_segment_t * +_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) { - int error = 0; - M_ASSERTPKTHDR(m0); - - flags |= BUS_DMA_NOWAIT; - *nsegs = -1; - map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_CACHE_ALIGNED; - map->buffer = m0; - map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { - vm_offset_t lastaddr = 0; - struct mbuf *m; - - for (m = m0; m != NULL && error == 0; m = m->m_next) { - if (m->m_len > 0) { - error = bus_dmamap_load_buffer(dmat, segs, map, - m->m_data, m->m_len, - pmap_kernel(), flags, &lastaddr, - nsegs); - map->len += m->m_len; - } - } - } else { - error = EINVAL; - } - - /* XXX FIXME: Having to increment nsegs is really annoying */ - ++*nsegs; - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, *nsegs); - return (error); -} - -/* - * Like bus_dmamap_load(), but for uios. - */ -int -bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) -{ - vm_offset_t lastaddr = 0; - int nsegs, i, error; - bus_size_t resid; - struct iovec *iov; - struct pmap *pmap; - - resid = uio->uio_resid; - iov = uio->uio_iov; - map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_UIO; - map->buffer = uio; - map->len = 0; - - if (uio->uio_segflg == UIO_USERSPACE) { - KASSERT(uio->uio_td != NULL, - ("bus_dmamap_load_uio: USERSPACE but no proc")); - pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); - } else - pmap = kernel_pmap; - - error = 0; - nsegs = -1; - for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { - /* - * Now at the first iovec to load. Load each iovec - * until we have exhausted the residual count. - */ - bus_size_t minlen = - resid < iov[i].iov_len ? resid : iov[i].iov_len; - caddr_t addr = (caddr_t) iov[i].iov_base; - - if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dmat->segments, - map, addr, minlen, pmap, flags, &lastaddr, &nsegs); - - map->len += minlen; - resid -= minlen; - } - } - - if (error) { - /* - * force "no valid mappings" on error in callback. - */ - (*callback)(callback_arg, NULL, 0, 0, error); - } else { - (*callback)(callback_arg, dmat->segments, nsegs+1, - uio->uio_resid, error); - } - CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); - return (error); + if (segs == NULL) + segs = dmat->segments; + return (segs); } /* @@ -1146,24 +1111,25 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b { struct bounce_page *bpage; - map->flags &= ~DMAMAP_TYPE_MASK; while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { STAILQ_REMOVE_HEAD(&map->bpages, links); free_bounce_page(dmat, bpage); } + map->sync_count = 0; return; } static void -bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op, int bufaligned) +bus_dmamap_sync_buf(vm_offset_t buf, int len, bus_dmasync_op_t op, + int bufaligned) { char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align]; register_t s; int partial; if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) { - cpu_dcache_wb_range((vm_offset_t)buf, len); - cpu_l2cache_wb_range((vm_offset_t)buf, len); + cpu_dcache_wb_range(buf, len); + cpu_l2cache_wb_range(buf, len); } /* @@ -1186,38 +1152,37 @@ bus_dmamap_sync_buf(void *buf, int len, if (op & BUS_DMASYNC_PREREAD) { if (!(op & BUS_DMASYNC_PREWRITE) && !partial) { - cpu_dcache_inv_range((vm_offset_t)buf, len); - cpu_l2cache_inv_range((vm_offset_t)buf, len); + cpu_dcache_inv_range(buf, len); + cpu_l2cache_inv_range(buf, len); } else { - cpu_dcache_wbinv_range((vm_offset_t)buf, len); - cpu_l2cache_wbinv_range((vm_offset_t)buf, len); + cpu_dcache_wbinv_range(buf, len); + cpu_l2cache_wbinv_range(buf, len); } } if (op & BUS_DMASYNC_POSTREAD) { if (partial && !bufaligned) { s = intr_disable(); - if ((vm_offset_t)buf & arm_dcache_align_mask) - memcpy(_tmp_cl, (void *)((vm_offset_t)buf & + if (buf & arm_dcache_align_mask) + memcpy(_tmp_cl, (void *)(buf & ~arm_dcache_align_mask), - (vm_offset_t)buf & arm_dcache_align_mask); - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + buf & arm_dcache_align_mask); + if ((buf + len) & arm_dcache_align_mask) memcpy(_tmp_clend, - (void *)((vm_offset_t)buf + len), - arm_dcache_align - (((vm_offset_t)(buf) + - len) & arm_dcache_align_mask)); + (void *)(buf + len), + arm_dcache_align - + ((buf + len) & arm_dcache_align_mask)); } - cpu_dcache_inv_range((vm_offset_t)buf, len); - cpu_l2cache_inv_range((vm_offset_t)buf, len); + cpu_dcache_inv_range(buf, len); + cpu_l2cache_inv_range(buf, len); if (partial && !bufaligned) { - if ((vm_offset_t)buf & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf & + if (buf & arm_dcache_align_mask) + memcpy((void *)(buf & ~arm_dcache_align_mask), _tmp_cl, - (vm_offset_t)buf & arm_dcache_align_mask); - if (((vm_offset_t)buf + len) & arm_dcache_align_mask) - memcpy((void *)((vm_offset_t)buf + len), + buf & arm_dcache_align_mask); + if ((buf + len) & arm_dcache_align_mask) + memcpy((void *)(buf + len), _tmp_clend, arm_dcache_align - - (((vm_offset_t)(buf) + len) & - arm_dcache_align_mask)); + ((buf + len) & arm_dcache_align_mask)); intr_restore(s); } } @@ -1230,10 +1195,18 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, STAILQ_FOREACH(bpage, &map->bpages, links) { if (op & BUS_DMASYNC_PREWRITE) { - bcopy((void *)bpage->datavaddr, - (void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), - bpage->datacount); + if (bpage->datavaddr != 0) + bcopy((void *)bpage->datavaddr, + (void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : + bpage->vaddr), + bpage->datacount); + else + physcopyout(bpage->dataaddr, + (void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : + bpage->vaddr), + bpage->datacount); if (bpage->vaddr_nocache == 0) { cpu_dcache_wb_range(bpage->vaddr, bpage->datacount); @@ -1249,36 +1222,23 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, cpu_l2cache_inv_range(bpage->vaddr, bpage->datacount); } - bcopy((void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), - (void *)bpage->datavaddr, bpage->datacount); + if (bpage->datavaddr != 0) + bcopy((void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + (void *)bpage->datavaddr, bpage->datacount); + else + physcopyin((void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + bpage->dataaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; } } } -static __inline int -_bus_dma_buf_is_in_bp(bus_dmamap_t map, void *buf, int len) -{ - struct bounce_page *bpage; - - STAILQ_FOREACH(bpage, &map->bpages, links) { - if ((vm_offset_t)buf >= bpage->datavaddr && - (vm_offset_t)buf + len <= bpage->datavaddr + - bpage->datacount) - return (1); - } - return (0); - -} - void _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) { - struct mbuf *m; - struct uio *uio; - int resid; - struct iovec *iov; + struct sync_list *sl, *end; int bufaligned; if (op == BUS_DMASYNC_POSTWRITE) @@ -1289,40 +1249,11 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus _bus_dmamap_sync_bp(dmat, map, op); CTR3(KTR_BUSDMA, "%s: op %x flags %x", __func__, op, map->flags); bufaligned = (map->flags & DMAMAP_CACHE_ALIGNED); - switch(map->flags & DMAMAP_TYPE_MASK) { - case DMAMAP_LINEAR: - if (!(_bus_dma_buf_is_in_bp(map, map->buffer, map->len))) - bus_dmamap_sync_buf(map->buffer, map->len, op, + if (map->sync_count) { + end = &map->slist[map->sync_count]; + for (sl = &map->slist[0]; sl != end; sl++) + bus_dmamap_sync_buf(sl->vaddr, sl->datacount, op, bufaligned); - break; - case DMAMAP_MBUF: - m = map->buffer; - while (m) { - if (m->m_len > 0 && - !(_bus_dma_buf_is_in_bp(map, m->m_data, m->m_len))) - bus_dmamap_sync_buf(m->m_data, m->m_len, op, - bufaligned); - m = m->m_next; - } - break; - case DMAMAP_UIO: - uio = map->buffer; - iov = uio->uio_iov; - resid = uio->uio_resid; - for (int i = 0; i < uio->uio_iovcnt && resid != 0; i++) { - bus_size_t minlen = resid < iov[i].iov_len ? resid : - iov[i].iov_len; - if (minlen > 0) { - if (!_bus_dma_buf_is_in_bp(map, iov[i].iov_base, - minlen)) - bus_dmamap_sync_buf(iov[i].iov_base, - minlen, op, bufaligned); - resid -= minlen; - } - } - break; - default: - break; } drain: @@ -1489,7 +1420,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_size_t size) + bus_addr_t addr, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; @@ -1522,6 +1453,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bpage->busaddr |= vaddr & PAGE_MASK; } bpage->datavaddr = vaddr; + bpage->dataaddr = addr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); return (bpage->busaddr); @@ -1575,8 +1507,8 @@ busdma_swi(void) mtx_unlock(&bounce_lock); dmat = map->dmat; (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK); - bus_dmamap_load(map->dmat, map, map->buffer, map->len, - map->callback, map->callback_arg, /*flags*/0); + bus_dmamap_load_mem(map->dmat, map, &map->mem, + map->callback, map->callback_arg, BUS_DMA_WAITOK); (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK); mtx_lock(&bounce_lock); } Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Mon Jun 17 23:21:18 2013 (r251873) +++ stable/9/sys/cam/cam_ccb.h Tue Jun 18 00:36:53 2013 (r251874) @@ -64,13 +64,19 @@ typedef enum { * Perform transport negotiation * with this command. */ - CAM_SCATTER_VALID = 0x00000010,/* Scatter/gather list is valid */ + CAM_DATA_ISPHYS = 0x00000010,/* Data type with physical addrs */ CAM_DIS_AUTOSENSE = 0x00000020,/* Disable autosense feature */ CAM_DIR_BOTH = 0x00000000,/* Data direction (00:IN/OUT) */ CAM_DIR_IN = 0x00000040,/* Data direction (01:DATA IN) */ CAM_DIR_OUT = 0x00000080,/* Data direction (10:DATA OUT) */ CAM_DIR_NONE = 0x000000C0,/* Data direction (11:no data) */ CAM_DIR_MASK = 0x000000C0,/* Data direction Mask */ + CAM_DATA_VADDR = 0x00000000,/* Data type (000:Virtual) */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 02:43:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 940D14AF for ; Tue, 18 Jun 2013 02:43:28 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 161DF10BE for ; Tue, 18 Jun 2013 02:43:27 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id gw10so3115740lab.30 for ; Mon, 17 Jun 2013 19:43:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=sv0ADVtgTsC8P0cK/Ad3KU5rU5SgyQ+JVDoCXB/Kf6Y=; b=DajYuXJQ5091S13OHx2sDRpTDrZ3IqNwDQpSKALlMiNv/6T+8bYN0Zz3t2+AzpU9dv Rlss/og7LZfohEz4IWSWgYVLq79KGub6TwKEBpTmKidm70tGbYsZneno5sSb64kHBTTN WC5o+bKfPnYwjZTz1yXuigmpZRoPwD9tTZ/DV+tCqemPeMFHlEz7PBIRYq+6LfpAxirZ JZBQ0XeVzQIj6neqe/zmY0TTDkWLmloFOLjgb9qa9s1NlOyqkh7Le+2a40ab6FSrxGsG VebNUGRxFe3QhORk4O0Gnyi0dSWOJrLZ5j7ePOp/eOnQ81iBH3hLRXHHgn2GsCLyz75O 68Mg== X-Received: by 10.112.141.6 with SMTP id rk6mr92867lbb.50.1371523406885; Mon, 17 Jun 2013 19:43:26 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id zo6sm6316907lbb.9.2013.06.17.19.43.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 19:43:26 -0700 (PDT) Message-ID: <51BFC942.4090103@freebsd.org> Date: Tue, 18 Jun 2013 06:43:14 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Scott Long Subject: Re: svn commit: r251874 - in stable/9/sys: arm/arm cam cam/ctl cam/scsi conf dev/aac dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/aic7xxx dev/amr dev/arcmsr dev/ata dev/buslogic dev/ciss dev/dpt d... References: <201306180036.r5I0askx009647@svn.freebsd.org> In-Reply-To: <201306180036.r5I0askx009647@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQl3/hgNndM/bdS9hyuUQPbntyV6WYwjLcOsjitO5v0ifUmi3vCZKVODvr7diWVg6xzJ5drY 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 02:43:28 -0000 On 18.06.2013 4:36, Scott Long wrote: > Author: scottl > Date: Tue Jun 18 00:36:53 2013 > New Revision: 251874 > URL: http://svnweb.freebsd.org/changeset/base/251874 ===> amd (all) cc -O2 -pipe -march=prescott -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/src/sys/i386/compile/POBRECITA/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -I/usr/src/sys/i386/compile/POBRECITA -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -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 -c /usr/src/sys/modules/amd/../../dev/amd/amd.c /usr/src/sys/modules/amd/../../dev/amd/amd.c: In function 'amd_action': /usr/src/sys/modules/amd/../../dev/amd/amd.c:431: error: 'CAM_SCATTER_VALID' undeclared (first use in this function) /usr/src/sys/modules/amd/../../dev/amd/amd.c:431: error: (Each undeclared identifier is reported only once /usr/src/sys/modules/amd/../../dev/amd/amd.c:431: error: for each function it appears in.) /usr/src/sys/modules/amd/../../dev/amd/amd.c:436: error: 'CAM_DATA_PHYS' undeclared (first use in this function) /usr/src/sys/modules/amd/../../dev/amd/amd.c:473: error: 'CAM_SG_LIST_PHYS' undeclared (first use in this function) *** [amd.o] Error code 1 -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 03:34:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CB252FC; Tue, 18 Jun 2013 03:34:08 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74F7A1382; Tue, 18 Jun 2013 03:34: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 r5I3Y8XF068091; Tue, 18 Jun 2013 03:34:08 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I3Y8tY068090; Tue, 18 Jun 2013 03:34:08 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180334.r5I3Y8tY068090@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 03:34:08 +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: r251888 - stable/9/sys/dev/amd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 03:34:08 -0000 Author: scottl Date: Tue Jun 18 03:34:08 2013 New Revision: 251888 URL: http://svnweb.freebsd.org/changeset/base/251888 Log: Catch up to the changes from r251874. This isn't an MFC because the amd(4) driver no longer exists in FreeBSD 10. Obtained from: Netflix Modified: stable/9/sys/dev/amd/amd.c Modified: stable/9/sys/dev/amd/amd.c ============================================================================== --- stable/9/sys/dev/amd/amd.c Tue Jun 18 02:57:56 2013 (r251887) +++ stable/9/sys/dev/amd/amd.c Tue Jun 18 03:34:08 2013 (r251888) @@ -428,61 +428,22 @@ amd_action(struct cam_sim * psim, union pSRB->ScsiCmdLen = pcsio->cdb_len; bcopy(pcsio->cdb_io.cdb_bytes, pSRB->CmdBlock, pcsio->cdb_len); if ((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - if ((pccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) { + int error; + + error - bus_dmamap_load_ccb(amd->buffer_dmat, + pSRB->dmamap, + pccb, + amdexecutesrb, + pSRB, /*flags*/0); + if (error == EINPROGRESS) { /* - * We've been given a pointer - * to a single buffer. + * So as to maintain ordering, + * freeze the controller queue + * until our mapping is + * returned. */ - if ((pccb->ccb_h.flags & CAM_DATA_PHYS) == 0) { - int s; - int error; - - s = splsoftvm(); - error = - bus_dmamap_load(amd->buffer_dmat, - pSRB->dmamap, - pcsio->data_ptr, - pcsio->dxfer_len, - amdexecutesrb, - pSRB, /*flags*/0); - if (error == EINPROGRESS) { - /* - * So as to maintain - * ordering, freeze the - * controller queue - * until our mapping is - * returned. - */ - xpt_freeze_simq(amd->psim, 1); - pccb->ccb_h.status |= - CAM_RELEASE_SIMQ; - } - splx(s); - } else { - struct bus_dma_segment seg; - - /* Pointer to physical buffer */ - seg.ds_addr = - (bus_addr_t)pcsio->data_ptr; - seg.ds_len = pcsio->dxfer_len; - amdexecutesrb(pSRB, &seg, 1, 0); - } - } else { - struct bus_dma_segment *segs; - - if ((pccb->ccb_h.flags & CAM_SG_LIST_PHYS) == 0 - || (pccb->ccb_h.flags & CAM_DATA_PHYS) != 0) { - TAILQ_INSERT_HEAD(&amd->free_srbs, - pSRB, links); - pccb->ccb_h.status = CAM_PROVIDE_FAIL; - xpt_done(pccb); - return; - } - - /* Just use the segments provided */ - segs = - (struct bus_dma_segment *)pcsio->data_ptr; - amdexecutesrb(pSRB, segs, pcsio->sglist_cnt, 0); + xpt_freeze_simq(sim, 1); + pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } } else amdexecutesrb(pSRB, NULL, 0, 0); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 04:02:33 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93D7DBAE for ; Tue, 18 Jun 2013 04:02:32 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx1.freebsd.org (Postfix) with ESMTP id 05E551682 for ; Tue, 18 Jun 2013 04:02:31 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id w20so3191674lbh.10 for ; Mon, 17 Jun 2013 21:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=l5xFx8sR9jAcAMGG1g6c1C1JmUFS667BcD+IcTZyKn8=; b=E1BmW86ea75V6Giqv1CRXit7XD6xq7kqHEO4d7NxKrYQrR/8bEWoncIv5l4UdnHROa FmuypD9tKY+zxtASvEfHJtmDya5ku/Fscgha4irqwyP7b21jwAhtkne5kfAJ76jnwwZC MdMbMoVbZLGp2u9iyoR09SGLBD8p16A1FMFLE+4LaV4DO7iG9YVmDKWcm/I1ot5O7Isa bHEl9TDujvd507VXbKOlhlUOBNnIAQfLRLjW3ioxoHJSbJLTT30MCVM/OV3ynQn9NNuN WIRtERAZoou2wn8vy1qXRK03phMdv+2KUlhzQtO/NZrlRyRc+mFiAw5+oXYFwzqmUtZZ Z4cQ== X-Received: by 10.112.182.39 with SMTP id eb7mr196158lbc.30.1371528144913; Mon, 17 Jun 2013 21:02:24 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id uo8sm6394648lbb.5.2013.06.17.21.02.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 21:02:24 -0700 (PDT) Message-ID: <51BFDBC4.3080403@freebsd.org> Date: Tue, 18 Jun 2013 08:02:12 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Scott Long Subject: Re: svn commit: r251888 - stable/9/sys/dev/amd References: <201306180334.r5I3Y8tY068090@svn.freebsd.org> In-Reply-To: <201306180334.r5I3Y8tY068090@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnLWimc2c2zlHkkH8fmySxGqvthbRobqzJVA8swCsfIbMI/XJTB19hpPFN96n4cXQVmjG28 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 04:02:33 -0000 On 18.06.2013 7:34, Scott Long wrote: > Author: scottl > Date: Tue Jun 18 03:34:08 2013 > New Revision: 251888 > URL: http://svnweb.freebsd.org/changeset/base/251888 > > Log: > Catch up to the changes from r251874. This isn't an MFC because the > amd(4) driver no longer exists in FreeBSD 10. > > Obtained from: Netflix > > Modified: > stable/9/sys/dev/amd/amd.c ===> amd (all) cc -O2 -pipe -march=prescott -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/src/sys/i386/compile/POBRECITA/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -I/usr/src/sys/i386/compile/POBRECITA -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -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 -c /usr/src/sys/modules/amd/../../dev/amd/amd.c cc1: warnings being treated as errors /usr/src/sys/modules/amd/../../dev/amd/amd.c: In function 'amd_action': /usr/src/sys/modules/amd/../../dev/amd/amd.c:437: warning: value computed is not used /usr/src/sys/modules/amd/../../dev/amd/amd.c:445: error: 'sim' undeclared (first use in this function) /usr/src/sys/modules/amd/../../dev/amd/amd.c:445: error: (Each undeclared identifier is reported only once /usr/src/sys/modules/amd/../../dev/amd/amd.c:445: error: for each function it appears in.) *** [amd.o] Error code 1 -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 04:03:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E299C21; Tue, 18 Jun 2013 04:03:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F4207168C; Tue, 18 Jun 2013 04:03: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 r5I43DFf077331; Tue, 18 Jun 2013 04:03:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I43D2U077329; Tue, 18 Jun 2013 04:03:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201306180403.r5I43D2U077329@svn.freebsd.org> From: Xin LI Date: Tue, 18 Jun 2013 04:03:13 +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: r251889 - stable/9/sys/dev/mpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 04:03:14 -0000 Author: delphij Date: Tue Jun 18 04:03:12 2013 New Revision: 251889 URL: http://svnweb.freebsd.org/changeset/base/251889 Log: MFC r251187: Explicitly use a pair of parentheses to ensure correct evaluation ordering for bitwise operation. Submitted by: swildner (DragonFly) Modified: stable/9/sys/dev/mpt/mpt_raid.c stable/9/sys/dev/mpt/mpt_user.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_raid.c Tue Jun 18 03:34:08 2013 (r251888) +++ stable/9/sys/dev/mpt/mpt_raid.c Tue Jun 18 04:03:12 2013 (r251889) @@ -605,7 +605,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); + (write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST))); se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | raid_handler_id); Modified: stable/9/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/9/sys/dev/mpt/mpt_user.c Tue Jun 18 03:34:08 2013 (r251888) +++ stable/9/sys/dev/mpt/mpt_user.c Tue Jun 18 04:03:12 2013 (r251889) @@ -548,8 +548,8 @@ mpt_user_raid_action(struct mpt_softc *m MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : - MPI_SGE_FLAGS_IOC_TO_HOST)); + (raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : + MPI_SGE_FLAGS_IOC_TO_HOST))); } se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | user_handler_id); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 04:05:37 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB708F39; Tue, 18 Jun 2013 04:05:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADC0D16B7; Tue, 18 Jun 2013 04:05: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 r5I45bWq077860; Tue, 18 Jun 2013 04:05:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I45bdg077859; Tue, 18 Jun 2013 04:05:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201306180405.r5I45bdg077859@svn.freebsd.org> From: Xin LI Date: Tue, 18 Jun 2013 04:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251891 - stable/9/lib/libcam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 04:05:37 -0000 Author: delphij Date: Tue Jun 18 04:05:37 2013 New Revision: 251891 URL: http://svnweb.freebsd.org/changeset/base/251891 Log: MFC r251349: Fix a typo: XPORT_SPI should be tested against transport, nor protocol. Submitted by: Sascha Wildner Reviewed by: mjacob Modified: stable/9/lib/libcam/camlib.c Directory Properties: stable/9/lib/libcam/ (props changed) Modified: stable/9/lib/libcam/camlib.c ============================================================================== --- stable/9/lib/libcam/camlib.c Tue Jun 18 04:04:15 2013 (r251890) +++ stable/9/lib/libcam/camlib.c Tue Jun 18 04:05:37 2013 (r251891) @@ -633,7 +633,7 @@ cam_real_open_device(const char *path, i "%s: %s", func_name, func_name, strerror(errno)); goto crod_bailout; } - if (ccb.cts.protocol == XPORT_SPI) { + if (ccb.cts.transport == XPORT_SPI) { struct ccb_trans_settings_spi *spi = &ccb.cts.xport_specific.spi; device->sync_period = spi->sync_period; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 04:11:17 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2F6B3403; Tue, 18 Jun 2013 04:11:17 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21E0116F2; Tue, 18 Jun 2013 04:11: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 r5I4BG3D080714; Tue, 18 Jun 2013 04:11:16 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I4BGu3080713; Tue, 18 Jun 2013 04:11:16 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180411.r5I4BGu3080713@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 04:11:16 +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: r251893 - stable/9/sys/dev/amd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 04:11:17 -0000 Author: scottl Date: Tue Jun 18 04:11:16 2013 New Revision: 251893 URL: http://svnweb.freebsd.org/changeset/base/251893 Log: Fix typos in the last revision. Thanks to Andrey Chernov for his kind patience. Obtained from: Netflix Modified: stable/9/sys/dev/amd/amd.c Modified: stable/9/sys/dev/amd/amd.c ============================================================================== --- stable/9/sys/dev/amd/amd.c Tue Jun 18 04:06:12 2013 (r251892) +++ stable/9/sys/dev/amd/amd.c Tue Jun 18 04:11:16 2013 (r251893) @@ -430,7 +430,7 @@ amd_action(struct cam_sim * psim, union if ((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { int error; - error - bus_dmamap_load_ccb(amd->buffer_dmat, + error = bus_dmamap_load_ccb(amd->buffer_dmat, pSRB->dmamap, pccb, amdexecutesrb, @@ -442,7 +442,7 @@ amd_action(struct cam_sim * psim, union * until our mapping is * returned. */ - xpt_freeze_simq(sim, 1); + xpt_freeze_simq(psim, 1); pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } } else From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 05:21:45 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B72E2396; Tue, 18 Jun 2013 05:21:45 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A60EC18F0; Tue, 18 Jun 2013 05:21: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 r5I5LjSW002874; Tue, 18 Jun 2013 05:21:45 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I5Leo1002844; Tue, 18 Jun 2013 05:21:40 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180521.r5I5Leo1002844@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 05:21: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: r251897 - in stable/9/sys: amd64/amd64 arm/arm cam cam/ata cam/scsi dev/ahci dev/md dev/siis dev/tws geom geom/part i386/i386 i386/include i386/xen ia64/ia64 kern mips/mips powerpc/aim ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 05:21:45 -0000 Author: scottl Date: Tue Jun 18 05:21:40 2013 New Revision: 251897 URL: http://svnweb.freebsd.org/changeset/base/251897 Log: Merge the second part of the unmapped I/O changes. This enables the infrastructure in the block layer and UFS filesystem as well as a few drivers. The list of MFC revisions is long, so I won't quote changelogs. r248508,248510,248511,248512,248514,248515,248516,248517,248518, 248519,248520,248521,248550,248568,248789,248790,249032,250936 Submitted by: kib Approved by: kib Obtained from: Netflix Modified: stable/9/sys/amd64/amd64/pmap.c stable/9/sys/arm/arm/pmap.c stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/md/md.c stable/9/sys/dev/siis/siis.c stable/9/sys/dev/tws/tws.h stable/9/sys/geom/geom.h stable/9/sys/geom/geom_disk.c stable/9/sys/geom/geom_disk.h stable/9/sys/geom/geom_io.c stable/9/sys/geom/geom_vfs.c stable/9/sys/geom/part/g_part.c stable/9/sys/i386/i386/pmap.c stable/9/sys/i386/include/param.h stable/9/sys/i386/xen/pmap.c stable/9/sys/ia64/ia64/pmap.c stable/9/sys/kern/kern_physio.c stable/9/sys/kern/subr_bus_dma.c stable/9/sys/kern/subr_param.c stable/9/sys/kern/vfs_aio.c stable/9/sys/kern/vfs_bio.c stable/9/sys/kern/vfs_cluster.c stable/9/sys/mips/mips/pmap.c stable/9/sys/powerpc/aim/mmu_oea64.c stable/9/sys/powerpc/powerpc/pmap_dispatch.c stable/9/sys/sparc64/sparc64/pmap.c stable/9/sys/sys/bio.h stable/9/sys/sys/buf.h stable/9/sys/sys/mount.h stable/9/sys/sys/systm.h stable/9/sys/ufs/ffs/ffs_alloc.c stable/9/sys/ufs/ffs/ffs_balloc.c stable/9/sys/ufs/ffs/ffs_rawread.c stable/9/sys/ufs/ffs/ffs_vfsops.c stable/9/sys/ufs/ffs/ffs_vnops.c stable/9/sys/ufs/ufs/ufs_extern.h stable/9/sys/vm/swap_pager.c stable/9/sys/vm/swap_pager.h stable/9/sys/vm/vm.h stable/9/sys/vm/vm_init.c stable/9/sys/vm/vm_kern.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/amd64/amd64/pmap.c Tue Jun 18 05:21:40 2013 (r251897) @@ -4245,6 +4245,8 @@ pmap_copy_page(vm_page_t msrc, vm_page_t pagecopy((void *)src, (void *)dst); } +int unmapped_buf_allowed = 1; + void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) Modified: stable/9/sys/arm/arm/pmap.c ============================================================================== --- stable/9/sys/arm/arm/pmap.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/arm/arm/pmap.c Tue Jun 18 05:21:40 2013 (r251897) @@ -4474,6 +4474,8 @@ pmap_copy_page(vm_page_t src, vm_page_t #endif } +int unmapped_buf_allowed = 1; + void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/ata/ata_da.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1242,6 +1242,8 @@ adaregister(struct cam_periph *periph, v !(softc->flags & ADA_FLAG_CAN_48BIT)) { softc->disk->d_flags |= DISKFLAG_CANDELETE; } + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) + softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); strlcpy(softc->disk->d_ident, cgd->ident_data.serial, @@ -1526,13 +1528,19 @@ adastart(struct cam_periph *periph, unio return; } #endif + KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || + round_page(bp->bio_bcount + bp->bio_ma_offset) / + PAGE_SIZE == bp->bio_ma_n, + ("Short bio %p", bp)); cam_fill_ataio(ataio, ada_retry_count, adadone, - bp->bio_cmd == BIO_READ ? - CAM_DIR_IN : CAM_DIR_OUT, + (bp->bio_cmd == BIO_READ ? CAM_DIR_IN : + CAM_DIR_OUT) | ((bp->bio_flags & BIO_UNMAPPED) + != 0 ? CAM_DATA_BIO : 0), tag_code, - bp->bio_data, + ((bp->bio_flags & BIO_UNMAPPED) != 0) ? (void *)bp : + bp->bio_data, bp->bio_bcount, ada_default_timeout*1000); Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/cam_ccb.h Tue Jun 18 05:21:40 2013 (r251897) @@ -42,7 +42,6 @@ #include #include - /* General allocation length definitions for CCB structures */ #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB bytes/pointer */ #define VUHBALEN 14 /* Vendor Unique HBA length */ @@ -100,7 +99,7 @@ typedef enum { CAM_MSGB_VALID = 0x10000000,/* Message buffer valid */ CAM_STATUS_VALID = 0x20000000,/* Status buffer valid */ CAM_DATAB_VALID = 0x40000000,/* Data buffer valid */ - + /* Host target Mode flags */ CAM_SEND_SENSE = 0x08000000,/* Send sense data with status */ CAM_TERM_IO = 0x10000000,/* Terminate I/O Message sup. */ @@ -572,7 +571,8 @@ typedef enum { PIM_NOINITIATOR = 0x20, /* Initiator role not supported. */ PIM_NOBUSRESET = 0x10, /* User has disabled initial BUS RESET */ PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */ - PIM_SEQSCAN = 0x04 /* Do bus scans sequentially, not in parallel */ + PIM_SEQSCAN = 0x04, /* Do bus scans sequentially, not in parallel */ + PIM_UNMAPPED = 0x02, } pi_miscflag; /* Path Inquiry CCB */ Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/cam_periph.c Tue Jun 18 05:21:40 2013 (r251897) @@ -851,7 +851,7 @@ cam_periph_mapmem(union ccb *ccb, struct * into a larger area of VM, or if userland races against * vmapbuf() after the useracc() check. */ - if (vmapbuf(mapinfo->bp[i]) < 0) { + if (vmapbuf(mapinfo->bp[i], 1) < 0) { for (j = 0; j < i; ++j) { *data_ptrs[j] = mapinfo->bp[j]->b_saveaddr; vunmapbuf(mapinfo->bp[j]); Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/scsi/scsi_all.c Tue Jun 18 05:21:40 2013 (r251897) @@ -5738,7 +5738,11 @@ scsi_read_write(struct ccb_scsiio *csio, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout) { + int read; u_int8_t cdb_len; + + read = (readop & SCSI_RW_DIRMASK) == SCSI_RW_READ; + /* * Use the smallest possible command to perform the operation * as some legacy hardware does not support the 10 byte commands. @@ -5755,7 +5759,7 @@ scsi_read_write(struct ccb_scsiio *csio, struct scsi_rw_6 *scsi_cmd; scsi_cmd = (struct scsi_rw_6 *)&csio->cdb_io.cdb_bytes; - scsi_cmd->opcode = readop ? READ_6 : WRITE_6; + scsi_cmd->opcode = read ? READ_6 : WRITE_6; scsi_ulto3b(lba, scsi_cmd->addr); scsi_cmd->length = block_count & 0xff; scsi_cmd->control = 0; @@ -5774,7 +5778,7 @@ scsi_read_write(struct ccb_scsiio *csio, struct scsi_rw_10 *scsi_cmd; scsi_cmd = (struct scsi_rw_10 *)&csio->cdb_io.cdb_bytes; - scsi_cmd->opcode = readop ? READ_10 : WRITE_10; + scsi_cmd->opcode = read ? READ_10 : WRITE_10; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); scsi_cmd->reserved = 0; @@ -5797,7 +5801,7 @@ scsi_read_write(struct ccb_scsiio *csio, struct scsi_rw_12 *scsi_cmd; scsi_cmd = (struct scsi_rw_12 *)&csio->cdb_io.cdb_bytes; - scsi_cmd->opcode = readop ? READ_12 : WRITE_12; + scsi_cmd->opcode = read ? READ_12 : WRITE_12; scsi_cmd->byte2 = byte2; scsi_ulto4b(lba, scsi_cmd->addr); scsi_cmd->reserved = 0; @@ -5819,7 +5823,7 @@ scsi_read_write(struct ccb_scsiio *csio, struct scsi_rw_16 *scsi_cmd; scsi_cmd = (struct scsi_rw_16 *)&csio->cdb_io.cdb_bytes; - scsi_cmd->opcode = readop ? READ_16 : WRITE_16; + scsi_cmd->opcode = read ? READ_16 : WRITE_16; scsi_cmd->byte2 = byte2; scsi_u64to8b(lba, scsi_cmd->addr); scsi_cmd->reserved = 0; @@ -5830,7 +5834,8 @@ scsi_read_write(struct ccb_scsiio *csio, cam_fill_csio(csio, retries, cbfcnp, - /*flags*/readop ? CAM_DIR_IN : CAM_DIR_OUT, + (read ? CAM_DIR_IN : CAM_DIR_OUT) | + ((readop & SCSI_RW_BIO) != 0 ? CAM_DATA_BIO : 0), tag_action, data_ptr, dxfer_len, Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/scsi/scsi_all.h Tue Jun 18 05:21:40 2013 (r251897) @@ -2469,6 +2469,10 @@ void scsi_write_buffer(struct ccb_scsiio uint8_t *data_ptr, uint32_t param_list_length, uint8_t sense_len, uint32_t timeout); +#define SCSI_RW_READ 0x0001 +#define SCSI_RW_WRITE 0x0002 +#define SCSI_RW_DIRMASK 0x0003 +#define SCSI_RW_BIO 0x1000 void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/scsi/scsi_cd.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1571,7 +1571,8 @@ cdstart(struct cam_periph *periph, union /*retries*/ cd_retry_count, /* cbfcnp */ cddone, MSG_SIMPLE_Q_TAG, - /* read */bp->bio_cmd == BIO_READ, + /* read */bp->bio_cmd == BIO_READ ? + SCSI_RW_READ : SCSI_RW_WRITE, /* byte2 */ 0, /* minimum_cmd_size */ 10, /* lba */ bp->bio_offset / Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1378,7 +1378,7 @@ dadump(void *arg, void *virtual, vm_offs /*retries*/0, dadone, MSG_ORDERED_Q_TAG, - /*read*/FALSE, + /*read*/SCSI_RW_WRITE, /*byte2*/0, /*minimum_cmd_size*/ softc->minimum_cmd_size, offset / secsize, @@ -2030,6 +2030,8 @@ daregister(struct cam_periph *periph, vo softc->disk->d_flags = 0; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) + softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; cam_strvis(softc->disk->d_descr, cgd->inq_data.vendor, sizeof(cgd->inq_data.vendor), sizeof(softc->disk->d_descr)); strlcat(softc->disk->d_descr, " ", sizeof(softc->disk->d_descr)); @@ -2390,14 +2392,18 @@ skipstate: /*retries*/da_retry_count, /*cbfcnp*/dadone, /*tag_action*/tag_code, - /*read_op*/bp->bio_cmd - == BIO_READ, + /*read_op*/(bp->bio_cmd == BIO_READ ? + SCSI_RW_READ : SCSI_RW_WRITE) | + ((bp->bio_flags & BIO_UNMAPPED) != 0 ? + SCSI_RW_BIO : 0), /*byte2*/0, softc->minimum_cmd_size, /*lba*/bp->bio_pblkno, /*block_count*/bp->bio_bcount / softc->params.secsize, - /*data_ptr*/ bp->bio_data, + /*data_ptr*/ (bp->bio_flags & + BIO_UNMAPPED) != 0 ? (void *)bp : + bp->bio_data, /*dxfer_len*/ bp->bio_bcount, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/dev/ahci/ahci.c Tue Jun 18 05:21:40 2013 (r251897) @@ -3010,7 +3010,7 @@ ahciaction(struct cam_sim *sim, union cc if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) cpi->max_target = 15; Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/dev/md/md.c Tue Jun 18 05:21:40 2013 (r251897) @@ -18,11 +18,16 @@ * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * + * Portions of this software were 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: @@ -59,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +168,8 @@ static LIST_HEAD(, md_s) md_softc_list = #define NMASK (NINDIR-1) static int nshift; +static int md_vnode_pbuf_freecnt; + struct indir { uintptr_t *array; u_int total; @@ -408,11 +416,103 @@ g_md_start(struct bio *bp) wakeup(sc); } +#define MD_MALLOC_MOVE_ZERO 1 +#define MD_MALLOC_MOVE_FILL 2 +#define MD_MALLOC_MOVE_READ 3 +#define MD_MALLOC_MOVE_WRITE 4 +#define MD_MALLOC_MOVE_CMP 5 + +static int +md_malloc_move(vm_page_t **mp, int *ma_offs, unsigned sectorsize, + void *ptr, u_char fill, int op) +{ + struct sf_buf *sf; + vm_page_t m, *mp1; + char *p, first; + off_t *uc; + unsigned n; + int error, i, ma_offs1, sz, first_read; + + m = NULL; + error = 0; + sf = NULL; + /* if (op == MD_MALLOC_MOVE_CMP) { gcc */ + first = 0; + first_read = 0; + uc = ptr; + mp1 = *mp; + ma_offs1 = *ma_offs; + /* } */ + sched_pin(); + for (n = sectorsize; n != 0; n -= sz) { + sz = imin(PAGE_SIZE - *ma_offs, n); + if (m != **mp) { + if (sf != NULL) + sf_buf_free(sf); + m = **mp; + sf = sf_buf_alloc(m, SFB_CPUPRIVATE | + (md_malloc_wait ? 0 : SFB_NOWAIT)); + if (sf == NULL) { + error = ENOMEM; + break; + } + } + p = (char *)sf_buf_kva(sf) + *ma_offs; + switch (op) { + case MD_MALLOC_MOVE_ZERO: + bzero(p, sz); + break; + case MD_MALLOC_MOVE_FILL: + memset(p, fill, sz); + break; + case MD_MALLOC_MOVE_READ: + bcopy(ptr, p, sz); + cpu_flush_dcache(p, sz); + break; + case MD_MALLOC_MOVE_WRITE: + bcopy(p, ptr, sz); + break; + case MD_MALLOC_MOVE_CMP: + for (i = 0; i < sz; i++, p++) { + if (!first_read) { + *uc = (u_char)*p; + first = *p; + first_read = 1; + } else if (*p != first) { + error = EDOOFUS; + break; + } + } + break; + default: + KASSERT(0, ("md_malloc_move unknown op %d\n", op)); + break; + } + if (error != 0) + break; + *ma_offs += sz; + *ma_offs %= PAGE_SIZE; + if (*ma_offs == 0) + (*mp)++; + ptr = (char *)ptr + sz; + } + + if (sf != NULL) + sf_buf_free(sf); + sched_unpin(); + if (op == MD_MALLOC_MOVE_CMP && error != 0) { + *mp = mp1; + *ma_offs = ma_offs1; + } + return (error); +} + static int mdstart_malloc(struct md_s *sc, struct bio *bp) { - int i, error; u_char *dst; + vm_page_t *m; + int i, error, error1, ma_offs, notmapped; off_t secno, nsec, uc; uintptr_t sp, osp; @@ -425,9 +525,17 @@ mdstart_malloc(struct md_s *sc, struct b return (EOPNOTSUPP); } + notmapped = (bp->bio_flags & BIO_UNMAPPED) != 0; + if (notmapped) { + m = bp->bio_ma; + ma_offs = bp->bio_ma_offset; + dst = NULL; + } else { + dst = bp->bio_data; + } + nsec = bp->bio_length / sc->sectorsize; secno = bp->bio_offset / sc->sectorsize; - dst = bp->bio_data; error = 0; while (nsec--) { osp = s_read(sc->indir, secno); @@ -435,21 +543,45 @@ mdstart_malloc(struct md_s *sc, struct b if (osp != 0) error = s_write(sc->indir, secno, 0); } else if (bp->bio_cmd == BIO_READ) { - if (osp == 0) - bzero(dst, sc->sectorsize); - else if (osp <= 255) - memset(dst, osp, sc->sectorsize); - else { - bcopy((void *)osp, dst, sc->sectorsize); - cpu_flush_dcache(dst, sc->sectorsize); + if (osp == 0) { + if (notmapped) { + error = md_malloc_move(&m, &ma_offs, + sc->sectorsize, NULL, 0, + MD_MALLOC_MOVE_ZERO); + } else + bzero(dst, sc->sectorsize); + } else if (osp <= 255) { + if (notmapped) { + error = md_malloc_move(&m, &ma_offs, + sc->sectorsize, NULL, osp, + MD_MALLOC_MOVE_FILL); + } else + memset(dst, osp, sc->sectorsize); + } else { + if (notmapped) { + error = md_malloc_move(&m, &ma_offs, + sc->sectorsize, (void *)osp, 0, + MD_MALLOC_MOVE_READ); + } else { + bcopy((void *)osp, dst, sc->sectorsize); + cpu_flush_dcache(dst, sc->sectorsize); + } } osp = 0; } else if (bp->bio_cmd == BIO_WRITE) { if (sc->flags & MD_COMPRESS) { - uc = dst[0]; - for (i = 1; i < sc->sectorsize; i++) - if (dst[i] != uc) - break; + if (notmapped) { + error1 = md_malloc_move(&m, &ma_offs, + sc->sectorsize, &uc, 0, + MD_MALLOC_MOVE_CMP); + i = error1 == 0 ? sc->sectorsize : 0; + } else { + uc = dst[0]; + for (i = 1; i < sc->sectorsize; i++) { + if (dst[i] != uc) + break; + } + } } else { i = 0; uc = 0; @@ -466,10 +598,26 @@ mdstart_malloc(struct md_s *sc, struct b error = ENOSPC; break; } - bcopy(dst, (void *)sp, sc->sectorsize); + if (notmapped) { + error = md_malloc_move(&m, + &ma_offs, sc->sectorsize, + (void *)sp, 0, + MD_MALLOC_MOVE_WRITE); + } else { + bcopy(dst, (void *)sp, + sc->sectorsize); + } error = s_write(sc->indir, secno, sp); } else { - bcopy(dst, (void *)osp, sc->sectorsize); + if (notmapped) { + error = md_malloc_move(&m, + &ma_offs, sc->sectorsize, + (void *)osp, 0, + MD_MALLOC_MOVE_WRITE); + } else { + bcopy(dst, (void *)osp, + sc->sectorsize); + } osp = 0; } } @@ -481,7 +629,8 @@ mdstart_malloc(struct md_s *sc, struct b if (error != 0) break; secno++; - dst += sc->sectorsize; + if (!notmapped) + dst += sc->sectorsize; } bp->bio_resid = 0; return (error); @@ -514,6 +663,7 @@ mdstart_vnode(struct md_s *sc, struct bi struct iovec aiov; struct mount *mp; struct vnode *vp; + struct buf *pb; struct thread *td; off_t end, zerosize; @@ -589,7 +739,17 @@ mdstart_vnode(struct md_s *sc, struct bi return (error); } - aiov.iov_base = bp->bio_data; + KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd", + (uintmax_t)bp->bio_length)); + if ((bp->bio_flags & BIO_UNMAPPED) == 0) { + pb = NULL; + aiov.iov_base = bp->bio_data; + } else { + pb = getpbuf(&md_vnode_pbuf_freecnt); + pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n); + aiov.iov_base = (void *)((vm_offset_t)pb->b_data + + bp->bio_ma_offset); + } aiov.iov_len = bp->bio_length; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; @@ -620,6 +780,10 @@ mdstart_vnode(struct md_s *sc, struct bi VOP_UNLOCK(vp, 0); vn_finished_write(mp); } + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + pmap_qremove((vm_offset_t)pb->b_data, bp->bio_ma_n); + relpbuf(pb, &md_vnode_pbuf_freecnt); + } VFS_UNLOCK_GIANT(vfslocked); bp->bio_resid = auio.uio_resid; return (error); @@ -628,11 +792,10 @@ mdstart_vnode(struct md_s *sc, struct bi static int mdstart_swap(struct md_s *sc, struct bio *bp) { - struct sf_buf *sf; - int rv, offs, len, lastend; - vm_pindex_t i, lastp; vm_page_t m; u_char *p; + vm_pindex_t i, lastp; + int rv, ma_offs, offs, len, lastend; switch (bp->bio_cmd) { case BIO_READ: @@ -644,6 +807,7 @@ mdstart_swap(struct md_s *sc, struct bio } p = bp->bio_data; + ma_offs = (bp->bio_flags & BIO_UNMAPPED) == 0 ? 0 : bp->bio_ma_offset; /* * offs is the offset at which to start operating on the @@ -661,21 +825,14 @@ mdstart_swap(struct md_s *sc, struct bio vm_object_pip_add(sc->object, 1); for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) { len = ((i == lastp) ? lastend : PAGE_SIZE) - offs; - - m = vm_page_grab(sc->object, i, - VM_ALLOC_NORMAL|VM_ALLOC_RETRY); - VM_OBJECT_UNLOCK(sc->object); - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - VM_OBJECT_LOCK(sc->object); + m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL | + VM_ALLOC_RETRY); if (bp->bio_cmd == BIO_READ) { if (m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK; else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { - sf_buf_free(sf); - sched_unpin(); vm_page_wakeup(m); break; } else if (rv == VM_PAGER_FAIL) { @@ -685,23 +842,31 @@ mdstart_swap(struct md_s *sc, struct bio * valid. Do not set dirty, the page * can be recreated if thrown out. */ - bzero((void *)sf_buf_kva(sf), PAGE_SIZE); + pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; } - bcopy((void *)(sf_buf_kva(sf) + offs), p, len); - cpu_flush_dcache(p, len); + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + pmap_copy_pages(&m, offs, bp->bio_ma, + ma_offs, len); + } else { + physcopyout(VM_PAGE_TO_PHYS(m) + offs, p, len); + cpu_flush_dcache(p, len); + } } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); else rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { - sf_buf_free(sf); - sched_unpin(); vm_page_wakeup(m); break; } - bcopy(p, (void *)(sf_buf_kva(sf) + offs), len); + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + pmap_copy_pages(bp->bio_ma, ma_offs, &m, + offs, len); + } else { + physcopyin(p, VM_PAGE_TO_PHYS(m) + offs, len); + } m->valid = VM_PAGE_BITS_ALL; } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) @@ -709,20 +874,16 @@ mdstart_swap(struct md_s *sc, struct bio else rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { - sf_buf_free(sf); - sched_unpin(); vm_page_wakeup(m); break; } if (len != PAGE_SIZE) { - bzero((void *)(sf_buf_kva(sf) + offs), len); + pmap_zero_page_area(m, offs, len); vm_page_clear_dirty(m, offs, len); m->valid = VM_PAGE_BITS_ALL; } else vm_pager_page_unswapped(m); } - sf_buf_free(sf); - sched_unpin(); vm_page_wakeup(m); vm_page_lock(m); if (bp->bio_cmd == BIO_DELETE && len == PAGE_SIZE) @@ -736,6 +897,7 @@ mdstart_swap(struct md_s *sc, struct bio /* Actions on further pages start at offset 0 */ p += PAGE_SIZE - offs; offs = 0; + ma_offs += len; } vm_object_pip_subtract(sc->object, 1); VM_OBJECT_UNLOCK(sc->object); @@ -851,6 +1013,15 @@ mdinit(struct md_s *sc) pp = g_new_providerf(gp, "md%d", sc->unit); pp->mediasize = sc->mediasize; pp->sectorsize = sc->sectorsize; + switch (sc->type) { + case MD_MALLOC: + case MD_VNODE: + case MD_SWAP: + pp->flags |= G_PF_ACCEPT_UNMAPPED; + break; + case MD_PRELOAD: + break; + } sc->gp = gp; sc->pp = pp; g_error_provider(pp, 0); @@ -1311,6 +1482,7 @@ g_md_init(struct g_class *mp __unused) sx_xunlock(&md_sx); } } + md_vnode_pbuf_freecnt = nswbuf / 10; status_dev = make_dev(&mdctl_cdevsw, INT_MAX, UID_ROOT, GID_WHEEL, 0600, MDCTL_NAME); g_topology_lock(); Modified: stable/9/sys/dev/siis/siis.c ============================================================================== --- stable/9/sys/dev/siis/siis.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/dev/siis/siis.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1939,7 +1939,7 @@ siisaction(struct cam_sim *sim, union cc cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE; cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = 15; cpi->max_lun = 0; Modified: stable/9/sys/dev/tws/tws.h ============================================================================== --- stable/9/sys/dev/tws/tws.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/dev/tws/tws.h Tue Jun 18 05:21:40 2013 (r251897) @@ -137,7 +137,7 @@ enum tws_req_flags { TWS_DIR_IN = 0x2, TWS_DIR_OUT = 0x4, TWS_DIR_NONE = 0x8, - TWS_DATA_CCB = 0x16, + TWS_DATA_CCB = 0x10, }; enum tws_intrs { Modified: stable/9/sys/geom/geom.h ============================================================================== --- stable/9/sys/geom/geom.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/geom.h Tue Jun 18 05:21:40 2013 (r251897) @@ -201,6 +201,7 @@ struct g_provider { #define G_PF_CANDELETE 0x1 #define G_PF_WITHER 0x2 #define G_PF_ORPHAN 0x4 +#define G_PF_ACCEPT_UNMAPPED 0x8 /* Two fields for the implementing class to use */ void *private; Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/geom_disk.c Tue Jun 18 05:21:40 2013 (r251897) @@ -299,13 +299,29 @@ g_disk_start(struct bio *bp) do { bp2->bio_offset += off; bp2->bio_length -= off; - bp2->bio_data += off; + if ((bp->bio_flags & BIO_UNMAPPED) == 0) { + bp2->bio_data += off; + } else { + KASSERT((dp->d_flags & DISKFLAG_UNMAPPED_BIO) + != 0, + ("unmapped bio not supported by disk %s", + dp->d_name)); + bp2->bio_ma += off / PAGE_SIZE; + bp2->bio_ma_offset += off; + bp2->bio_ma_offset %= PAGE_SIZE; + bp2->bio_ma_n -= off / PAGE_SIZE; + } if (bp2->bio_length > dp->d_maxsize) { /* * XXX: If we have a stripesize we should really * use it here. */ bp2->bio_length = dp->d_maxsize; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + bp2->bio_ma_n = howmany( + bp2->bio_ma_offset + + bp2->bio_length, PAGE_SIZE); + } off += dp->d_maxsize; /* * To avoid a race, we need to grab the next bio @@ -467,6 +483,8 @@ g_disk_create(void *arg, int flag) pp->flags |= G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; + if ((dp->d_flags & DISKFLAG_UNMAPPED_BIO) != 0) + pp->flags |= G_PF_ACCEPT_UNMAPPED; if (bootverbose) printf("GEOM: new disk %s\n", gp->name); sysctl_ctx_init(&sc->sysctl_ctx); Modified: stable/9/sys/geom/geom_disk.h ============================================================================== --- stable/9/sys/geom/geom_disk.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/geom_disk.h Tue Jun 18 05:21:40 2013 (r251897) @@ -106,6 +106,7 @@ struct disk { #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 #define DISKFLAG_LACKS_GONE 0x10 +#define DISKFLAG_UNMAPPED_BIO 0x20 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); Modified: stable/9/sys/geom/geom_io.c ============================================================================== --- stable/9/sys/geom/geom_io.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/geom_io.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2002 Poul-Henning Kamp * Copyright (c) 2002 Networks Associates Technology, Inc. + * Copyright (c) 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Poul-Henning Kamp @@ -8,6 +9,9 @@ * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the * DARPA CHATS research program. * + * Portions of this software were 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: @@ -44,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,6 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include +#include +#include +#include static struct g_bioq g_bio_run_down; static struct g_bioq g_bio_run_up; @@ -180,12 +192,17 @@ g_clone_bio(struct bio *bp) /* * BIO_ORDERED flag may be used by disk drivers to enforce * ordering restrictions, so this flag needs to be cloned. + * BIO_UNMAPPED should be inherited, to properly indicate + * which way the buffer is passed. * Other bio flags are not suitable for cloning. */ - bp2->bio_flags = bp->bio_flags & BIO_ORDERED; + bp2->bio_flags = bp->bio_flags & (BIO_ORDERED | BIO_UNMAPPED); bp2->bio_length = bp->bio_length; bp2->bio_offset = bp->bio_offset; bp2->bio_data = bp->bio_data; + bp2->bio_ma = bp->bio_ma; + bp2->bio_ma_n = bp->bio_ma_n; + bp2->bio_ma_offset = bp->bio_ma_offset; bp2->bio_attribute = bp->bio_attribute; /* Inherit classification info from the parent */ bp2->bio_classifier1 = bp->bio_classifier1; @@ -210,11 +227,15 @@ g_duplicate_bio(struct bio *bp) struct bio *bp2; bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO); + bp2->bio_flags = bp->bio_flags & BIO_UNMAPPED; bp2->bio_parent = bp; bp2->bio_cmd = bp->bio_cmd; bp2->bio_length = bp->bio_length; bp2->bio_offset = bp->bio_offset; bp2->bio_data = bp->bio_data; + bp2->bio_ma = bp->bio_ma; + bp2->bio_ma_n = bp->bio_ma_n; + bp2->bio_ma_offset = bp->bio_ma_offset; bp2->bio_attribute = bp->bio_attribute; bp->bio_children++; #ifdef KTR @@ -575,6 +596,85 @@ g_io_deliver(struct bio *bp, int error) return; } +SYSCTL_DECL(_kern_geom); + +static long transient_maps; +SYSCTL_LONG(_kern_geom, OID_AUTO, transient_maps, CTLFLAG_RD, + &transient_maps, 0, + "Total count of the transient mapping requests"); +u_int transient_map_retries = 10; +SYSCTL_UINT(_kern_geom, OID_AUTO, transient_map_retries, CTLFLAG_RW, + &transient_map_retries, 0, + "Max count of retries used before giving up on creating transient map"); +int transient_map_hard_failures; +SYSCTL_INT(_kern_geom, OID_AUTO, transient_map_hard_failures, CTLFLAG_RD, + &transient_map_hard_failures, 0, + "Failures to establish the transient mapping due to retry attempts " + "exhausted"); +int transient_map_soft_failures; +SYSCTL_INT(_kern_geom, OID_AUTO, transient_map_soft_failures, CTLFLAG_RD, + &transient_map_soft_failures, 0, + "Count of retried failures to establish the transient mapping"); +int inflight_transient_maps; +SYSCTL_INT(_kern_geom, OID_AUTO, inflight_transient_maps, CTLFLAG_RD, + &inflight_transient_maps, 0, + "Current count of the active transient maps"); + +static int +g_io_transient_map_bio(struct bio *bp) +{ + vm_offset_t addr; + long size; + u_int retried; + int rv; + + KASSERT(unmapped_buf_allowed, ("unmapped disabled")); + + size = round_page(bp->bio_ma_offset + bp->bio_length); + KASSERT(size / PAGE_SIZE == bp->bio_ma_n, ("Bio too short %p", bp)); + addr = 0; + retried = 0; + atomic_add_long(&transient_maps, 1); +retry: + vm_map_lock(bio_transient_map); + if (vm_map_findspace(bio_transient_map, vm_map_min(bio_transient_map), + size, &addr)) { + vm_map_unlock(bio_transient_map); + if (transient_map_retries != 0 && + retried >= transient_map_retries) { + g_io_deliver(bp, EDEADLK/* XXXKIB */); + CTR2(KTR_GEOM, "g_down cannot map bp %p provider %s", + bp, bp->bio_to->name); + atomic_add_int(&transient_map_hard_failures, 1); + return (1); + } else { + /* + * Naive attempt to quisce the I/O to get more + * in-flight requests completed and defragment + * the bio_transient_map. + */ + CTR3(KTR_GEOM, "g_down retrymap bp %p provider %s r %d", + bp, bp->bio_to->name, retried); + pause("g_d_tra", hz / 10); + retried++; + atomic_add_int(&transient_map_soft_failures, 1); + goto retry; + } + } + rv = vm_map_insert(bio_transient_map, NULL, 0, addr, addr + size, + VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); + KASSERT(rv == KERN_SUCCESS, + ("vm_map_insert(bio_transient_map) rv %d %jx %lx", + rv, (uintmax_t)addr, size)); + vm_map_unlock(bio_transient_map); + atomic_add_int(&inflight_transient_maps, 1); + pmap_qenter((vm_offset_t)addr, bp->bio_ma, OFF_TO_IDX(size)); + bp->bio_data = (caddr_t)addr + bp->bio_ma_offset; + bp->bio_flags |= BIO_TRANSIENT_MAPPING; + bp->bio_flags &= ~BIO_UNMAPPED; + return (0); +} + void g_io_schedule_down(struct thread *tp __unused) { @@ -636,6 +736,12 @@ g_io_schedule_down(struct thread *tp __u default: break; } + if ((bp->bio_flags & BIO_UNMAPPED) != 0 && + (bp->bio_to->flags & G_PF_ACCEPT_UNMAPPED) == 0 && + (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { + if (g_io_transient_map_bio(bp)) + continue; + } THREAD_NO_SLEEPING(); CTR4(KTR_GEOM, "g_down starting bp %p provider %s off %ld " "len %ld", bp, bp->bio_to->name, bp->bio_offset, Modified: stable/9/sys/geom/geom_vfs.c ============================================================================== --- stable/9/sys/geom/geom_vfs.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/geom_vfs.c Tue Jun 18 05:21:40 2013 (r251897) @@ -193,14 +193,14 @@ g_vfs_strategy(struct bufobj *bo, struct bip = g_alloc_bio(); bip->bio_cmd = bp->b_iocmd; bip->bio_offset = bp->b_iooffset; - bip->bio_data = bp->b_data; - bip->bio_done = g_vfs_done; - bip->bio_caller2 = bp; bip->bio_length = bp->b_bcount; - if (bp->b_flags & B_BARRIER) { + bdata2bio(bp, bip); + if ((bp->b_flags & B_BARRIER) != 0) { bip->bio_flags |= BIO_ORDERED; bp->b_flags &= ~B_BARRIER; } + bip->bio_done = g_vfs_done; + bip->bio_caller2 = bp; g_io_request(bip, cp); } Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/geom/part/g_part.c Tue Jun 18 05:21:40 2013 (r251897) @@ -429,6 +429,7 @@ g_part_new_provider(struct g_geom *gp, s entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; if (pp->stripesize > 0) entry->gpe_pp->stripeoffset %= pp->stripesize; + entry->gpe_pp->flags |= pp->flags & G_PF_ACCEPT_UNMAPPED; g_error_provider(entry->gpe_pp, 0); } Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/i386/i386/pmap.c Tue Jun 18 05:21:40 2013 (r251897) @@ -4256,6 +4256,8 @@ pmap_copy_page(vm_page_t src, vm_page_t mtx_unlock(&sysmaps->lock); } +int unmapped_buf_allowed = 1; + void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) Modified: stable/9/sys/i386/include/param.h ============================================================================== --- stable/9/sys/i386/include/param.h Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/i386/include/param.h Tue Jun 18 05:21:40 2013 (r251897) @@ -140,9 +140,12 @@ * Ceiling on size of buffer cache (really only effects write queueing, * the VM page cache is not effected), can be changed via * the kern.maxbcache /boot/loader.conf variable. + * + * The value is equal to the size of the auto-tuned buffer map for + * the machine with 4GB of RAM, see vfs_bio.c:kern_vfs_bio_buffer_alloc(). */ #ifndef VM_BCACHE_SIZE_MAX -#define VM_BCACHE_SIZE_MAX (200 * 1024 * 1024) +#define VM_BCACHE_SIZE_MAX (7224 * 16 * 1024) #endif /* Modified: stable/9/sys/i386/xen/pmap.c ============================================================================== --- stable/9/sys/i386/xen/pmap.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/i386/xen/pmap.c Tue Jun 18 05:21:40 2013 (r251897) @@ -3444,6 +3444,8 @@ pmap_copy_page(vm_page_t src, vm_page_t mtx_unlock(&sysmaps->lock); } +int unmapped_buf_allowed = 1; + void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) Modified: stable/9/sys/ia64/ia64/pmap.c ============================================================================== --- stable/9/sys/ia64/ia64/pmap.c Tue Jun 18 04:57:36 2013 (r251896) +++ stable/9/sys/ia64/ia64/pmap.c Tue Jun 18 05:21:40 2013 (r251897) @@ -1884,6 +1884,8 @@ pmap_copy_page(vm_page_t msrc, vm_page_t bcopy(src, dst, PAGE_SIZE); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 05:37:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5220EAC7; Tue, 18 Jun 2013 05:37:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 427B51961; Tue, 18 Jun 2013 05:37: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 r5I5b7ji006892; Tue, 18 Jun 2013 05:37:07 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I5b6Rp006889; Tue, 18 Jun 2013 05:37:06 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306180537.r5I5b6Rp006889@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 05:37: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: r251899 - in stable/9/sys/dev: isci mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 05:37:07 -0000 Author: scottl Date: Tue Jun 18 05:37:06 2013 New Revision: 251899 URL: http://svnweb.freebsd.org/changeset/base/251899 Log: MFC r248825, 248775 Add unmapped i/o support for the mps and isci drivers. Submitted by: mav, jimharris Obtained from: Netflix Modified: stable/9/sys/dev/isci/isci_controller.c stable/9/sys/dev/isci/isci_io_request.c stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/isci_controller.c ============================================================================== --- stable/9/sys/dev/isci/isci_controller.c Tue Jun 18 05:22:17 2013 (r251898) +++ stable/9/sys/dev/isci/isci_controller.c Tue Jun 18 05:37:06 2013 (r251899) @@ -632,7 +632,8 @@ void isci_action(struct cam_sim *sim, un cpi->version_num = 1; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN | + PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = SCI_MAX_REMOTE_DEVICES - 1; cpi->max_lun = ISCI_MAX_LUN; Modified: stable/9/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/9/sys/dev/isci/isci_io_request.c Tue Jun 18 05:22:17 2013 (r251898) +++ stable/9/sys/dev/isci/isci_io_request.c Tue Jun 18 05:37:06 2013 (r251899) @@ -506,10 +506,31 @@ uint8_t * scif_cb_io_request_get_virtual_address_from_sgl(void * scif_user_io_request, uint32_t byte_offset) { - struct ISCI_IO_REQUEST *isci_request = - (struct ISCI_IO_REQUEST *)scif_user_io_request; + struct ISCI_IO_REQUEST *isci_request; + union ccb *ccb; + - return (isci_request->ccb->csio.data_ptr + byte_offset); + isci_request = scif_user_io_request; + ccb = isci_request->ccb; + + /* + * This callback is only invoked for SCSI/ATA translation of + * PIO commands such as INQUIRY and READ_CAPACITY, to allow + * the driver to write the translated data directly into the + * data buffer. It is never invoked for READ/WRITE commands. + * The driver currently assumes only READ/WRITE commands will + * be unmapped. + * + * As a safeguard against future changes to unmapped commands, + * add an explicit panic here should the DATA_MASK != VADDR. + * Otherwise, we would return some garbage pointer back to the + * caller which would result in a panic or more subtle data + * corruption later on. + */ + if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR) + panic("%s: requesting pointer into unmapped ccb", __func__); + + return (ccb->csio.data_ptr + byte_offset); } /** @@ -747,10 +768,6 @@ isci_io_request_execute_scsi_io(union cc io_request->current_sge_index = 0; io_request->parent.remote_device_handle = device->sci_object; - if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR) - panic("Unexpected cam data format! flags = 0x%x\n", - ccb->ccb_h.flags); - error = bus_dmamap_load_ccb(io_request->parent.dma_tag, io_request->parent.dma_map, ccb, isci_io_request_construct, io_request, 0x0); Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Tue Jun 18 05:22:17 2013 (r251898) +++ stable/9/sys/dev/mps/mps_sas.c Tue Jun 18 05:37:06 2013 (r251899) @@ -914,7 +914,7 @@ mpssas_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET; + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; @@ -2238,6 +2238,7 @@ mpssas_scsiio_complete(struct mps_softc if ((csio->cdb_io.cdb_bytes[0] == INQUIRY) && (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && + ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == T_SEQUENTIAL) && (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 07:04:20 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20352FAC; Tue, 18 Jun 2013 07:04:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 126501C84; Tue, 18 Jun 2013 07:04:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5I74J5F034589; Tue, 18 Jun 2013 07:04:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I74J3M034587; Tue, 18 Jun 2013 07:04:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201306180704.r5I74J3M034587@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 18 Jun 2013 07:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251902 - in stable/9: . sys/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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 07:04:20 -0000 Author: des Date: Tue Jun 18 07:04:19 2013 New Revision: 251902 URL: http://svnweb.freebsd.org/changeset/base/251902 Log: Fix a bug that allowed a tracing process (e.g. gdb) to write to a memory-mapped file in the traced process's address space even if neither the traced process nor the tracing process had write access to that file. Security: CVE-2013-2171 Security: FreeBSD-SA-13:06.mmap Approved by: so Modified: stable/9/UPDATING stable/9/sys/vm/vm_map.c Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Tue Jun 18 07:02:35 2013 (r251901) +++ stable/9/UPDATING Tue Jun 18 07:04:19 2013 (r251902) @@ -11,6 +11,12 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130618: + Fix a bug that allowed a tracing process (e.g. gdb) to write + to a memory-mapped file in the traced process's address space + even if neither the traced process nor the tracing process had + write access to that file. + 20130605: Added ZFS TRIM support which is enabled by default. To disable ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf. Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Tue Jun 18 07:02:35 2013 (r251901) +++ stable/9/sys/vm/vm_map.c Tue Jun 18 07:04:19 2013 (r251902) @@ -3799,6 +3799,12 @@ RetryLookup:; vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); } + if ((fault_typea & VM_PROT_COPY) != 0 && + (entry->max_protection & VM_PROT_WRITE) == 0 && + (entry->eflags & MAP_ENTRY_COW) == 0) { + vm_map_unlock_read(map); + return (KERN_PROTECTION_FAILURE); + } /* * If this page is not pageable, we have to get it for all possible From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:21:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7904E333; Tue, 18 Jun 2013 09:21:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5122D19DA; Tue, 18 Jun 2013 09:21: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 r5I9LMlY083015; Tue, 18 Jun 2013 09:21:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9LM1X083014; Tue, 18 Jun 2013 09:21:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180921.r5I9LM1X083014@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:21: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: r251916 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:21:22 -0000 Author: mav Date: Tue Jun 18 09:21:21 2013 New Revision: 251916 URL: http://svnweb.freebsd.org/changeset/base/251916 Log: MFC r248068 (by sbruno): Add legacy support to geom raid to create a /dev/arX device for support of upgrading older machines using ataraid(4) to newer releases. This optional parameter is controlled via kern.geom.raid.legacy_aliases and will create a /dev/ar0 device that will point at /dev/raid/r0 for example. Tested on Dell SC 1425 DDF-1 format software raid controllers installing from stable/7 and upgrading to stable/9 without having to adjust /etc/fstab Modified: stable/9/sys/geom/raid/g_raid.c Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Tue Jun 18 09:19:59 2013 (r251915) +++ stable/9/sys/geom/raid/g_raid.c Tue Jun 18 09:21:21 2013 (r251916) @@ -92,6 +92,11 @@ TUNABLE_INT("kern.geom.raid.idle_thresho SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RW, &g_raid_idle_threshold, 1000000, "Time in microseconds to consider a volume idle."); +static u_int ar_legacy_aliases = 1; +SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RW, + &ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style."); +TUNABLE_INT("kern.geom_raid.legacy_aliases", &ar_legacy_aliases); + #define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \ G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ @@ -1637,6 +1642,7 @@ g_raid_launch_provider(struct g_raid_vol struct g_raid_softc *sc; struct g_provider *pp; char name[G_RAID_MAX_VOLUMENAME]; + char announce_buf[80], buf1[32]; off_t off; sc = vol->v_softc; @@ -1650,6 +1656,22 @@ g_raid_launch_provider(struct g_raid_vol /* Otherwise use sequential volume number. */ snprintf(name, sizeof(name), "raid/r%d", vol->v_global_id); } + + /* + * Create a /dev/ar%d that the old ataraid(4) stack once + * created as an alias for /dev/raid/r%d if requested. + * This helps going from stable/7 ataraid devices to newer + * FreeBSD releases. sbruno 07 MAY 2013 + */ + + if (ar_legacy_aliases) { + snprintf(announce_buf, sizeof(announce_buf), + "kern.devalias.%s", name); + snprintf(buf1, sizeof(buf1), + "ar%d", vol->v_global_id); + setenv(announce_buf, buf1); + } + pp = g_new_providerf(sc->sc_geom, "%s", name); pp->private = vol; pp->mediasize = vol->v_mediasize; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:23:04 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F0B534D2; Tue, 18 Jun 2013 09:23:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9D1A19FC; Tue, 18 Jun 2013 09:23: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 r5I9N3Xm083362; Tue, 18 Jun 2013 09:23:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9N3ko083361; Tue, 18 Jun 2013 09:23:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180923.r5I9N3ko083361@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:23:03 +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: r251917 - stable/9/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:23:04 -0000 Author: mav Date: Tue Jun 18 09:23:03 2013 New Revision: 251917 URL: http://svnweb.freebsd.org/changeset/base/251917 Log: Missed mergeinfo for r251916. Modified: Directory Properties: stable/9/sys/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:26:01 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9E9356D6; Tue, 18 Jun 2013 09:26:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90FD61A50; Tue, 18 Jun 2013 09: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 r5I9Q19O083842; Tue, 18 Jun 2013 09:26:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9Q158083840; Tue, 18 Jun 2013 09:26:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180926.r5I9Q158083840@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:26: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: r251918 - stable/9/sys/geom/gate X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:26:01 -0000 Author: mav Date: Tue Jun 18 09:26:01 2013 New Revision: 251918 URL: http://svnweb.freebsd.org/changeset/base/251918 Log: MFC r248295 (by pjd): We don't need buffer to handle BIO_DELETE, so don't check buffer size for it. This fixes handling BIO_DELETE larger than MAXPHYS. Modified: stable/9/sys/geom/gate/g_gate.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/gate/g_gate.c ============================================================================== --- stable/9/sys/geom/gate/g_gate.c Tue Jun 18 09:23:03 2013 (r251917) +++ stable/9/sys/geom/gate/g_gate.c Tue Jun 18 09:26:01 2013 (r251918) @@ -813,7 +813,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm } } ggio->gctl_cmd = bp->bio_cmd; - if ((bp->bio_cmd == BIO_DELETE || bp->bio_cmd == BIO_WRITE) && + if (bp->bio_cmd == BIO_WRITE && bp->bio_length > ggio->gctl_length) { mtx_unlock(&sc->sc_queue_mtx); ggio->gctl_length = bp->bio_length; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:29:30 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9AD3DA58; Tue, 18 Jun 2013 09:29:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7AB1AAD; Tue, 18 Jun 2013 09:29: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 r5I9TUXs084416; Tue, 18 Jun 2013 09:29:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9TUkJ084415; Tue, 18 Jun 2013 09:29:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180929.r5I9TUkJ084415@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:29:30 +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: r251920 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:29:30 -0000 Author: mav Date: Tue Jun 18 09:29:30 2013 New Revision: 251920 URL: http://svnweb.freebsd.org/changeset/base/251920 Log: MFC r248596 (by kib): Correct the page count when excess length is trimmed from the bio. Modified: stable/9/sys/geom/geom_io.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_io.c ============================================================================== --- stable/9/sys/geom/geom_io.c Tue Jun 18 09:28:49 2013 (r251919) +++ stable/9/sys/geom/geom_io.c Tue Jun 18 09:29:30 2013 (r251920) @@ -718,8 +718,17 @@ g_io_schedule_down(struct thread *tp __u */ excess = bp->bio_offset + bp->bio_length; if (excess > bp->bio_to->mediasize) { + KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || + round_page(bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE == bp->bio_ma_n, + ("excess bio %p too short", bp)); excess -= bp->bio_to->mediasize; bp->bio_length -= excess; + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + bp->bio_ma_n = round_page( + bp->bio_ma_offset + + bp->bio_length) / PAGE_SIZE; + } if (excess > 0) CTR3(KTR_GEOM, "g_down truncated bio " "%p provider %s by %d", bp, From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:31:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B7FEC1B; Tue, 18 Jun 2013 09:31:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0A61ADB; Tue, 18 Jun 2013 09:31: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 r5I9V7bv086349; Tue, 18 Jun 2013 09:31:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9V7iM086348; Tue, 18 Jun 2013 09:31:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180931.r5I9V7iM086348@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:31: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: r251921 - stable/9/sys/geom/multipath X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:31:07 -0000 Author: mav Date: Tue Jun 18 09:31:06 2013 New Revision: 251921 URL: http://svnweb.freebsd.org/changeset/base/251921 Log: MFC r248696: Make GEOM MULTIPATH to report unmapped bio support if underling path report it. GEOM MULTIPATH itself never touches the data and so transparent. Modified: stable/9/sys/geom/multipath/g_multipath.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/multipath/g_multipath.c ============================================================================== --- stable/9/sys/geom/multipath/g_multipath.c Tue Jun 18 09:29:30 2013 (r251920) +++ stable/9/sys/geom/multipath/g_multipath.c Tue Jun 18 09:31:06 2013 (r251921) @@ -522,6 +522,8 @@ g_multipath_add_disk(struct g_geom *gp, sc->sc_pp->stripesize = pp->stripesize; sc->sc_pp->stripeoffset = pp->stripeoffset; } + if (sc->sc_pp != NULL) + sc->sc_pp->flags |= pp->flags & G_PF_ACCEPT_UNMAPPED; mtx_lock(&sc->sc_mtx); cp->index = 0; sc->sc_ndisks++; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:34:37 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A4569E45; Tue, 18 Jun 2013 09:34:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2711B26; Tue, 18 Jun 2013 09:34: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 r5I9Ybk0087036; Tue, 18 Jun 2013 09:34:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9Ya8K087031; Tue, 18 Jun 2013 09:34:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180934.r5I9Ya8K087031@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:34:36 +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: r251922 - in stable/9/sys/geom: gate nop raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:34:37 -0000 Author: mav Date: Tue Jun 18 09:34:36 2013 New Revision: 251922 URL: http://svnweb.freebsd.org/changeset/base/251922 Log: MFC r248720: Remove extra bio_data and bio_length copying to child request after calling g_clone_bio(), that already copied them. Modified: stable/9/sys/geom/gate/g_gate.c stable/9/sys/geom/nop/g_nop.c stable/9/sys/geom/raid/tr_raid1e.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/gate/g_gate.c ============================================================================== --- stable/9/sys/geom/gate/g_gate.c Tue Jun 18 09:31:06 2013 (r251921) +++ stable/9/sys/geom/gate/g_gate.c Tue Jun 18 09:34:36 2013 (r251922) @@ -245,8 +245,6 @@ g_gate_start(struct bio *pbp) } cbp->bio_done = g_gate_done; cbp->bio_offset = pbp->bio_offset + sc->sc_readoffset; - cbp->bio_data = pbp->bio_data; - cbp->bio_length = pbp->bio_length; cbp->bio_to = sc->sc_readcons->provider; g_io_request(cbp, sc->sc_readcons); return; Modified: stable/9/sys/geom/nop/g_nop.c ============================================================================== --- stable/9/sys/geom/nop/g_nop.c Tue Jun 18 09:31:06 2013 (r251921) +++ stable/9/sys/geom/nop/g_nop.c Tue Jun 18 09:34:36 2013 (r251922) @@ -112,8 +112,6 @@ g_nop_start(struct bio *bp) } cbp->bio_done = g_std_done; cbp->bio_offset = bp->bio_offset + sc->sc_offset; - cbp->bio_data = bp->bio_data; - cbp->bio_length = bp->bio_length; pp = LIST_FIRST(&gp->provider); KASSERT(pp != NULL, ("NULL pp")); cbp->bio_to = pp; Modified: stable/9/sys/geom/raid/tr_raid1e.c ============================================================================== --- stable/9/sys/geom/raid/tr_raid1e.c Tue Jun 18 09:31:06 2013 (r251921) +++ stable/9/sys/geom/raid/tr_raid1e.c Tue Jun 18 09:34:36 2013 (r251922) @@ -1076,8 +1076,6 @@ rebuild_round_done: offset += vol->v_strip_size; } cbp->bio_offset = offset + start; - cbp->bio_length = bp->bio_length; - cbp->bio_data = bp->bio_data; cbp->bio_cmd = BIO_WRITE; cbp->bio_cflags = G_RAID_BIO_FLAG_REMAP; cbp->bio_caller2 = (void *)mask; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:37:45 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 523B4311; Tue, 18 Jun 2013 09:37:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 451811B6D; Tue, 18 Jun 2013 09:37: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 r5I9bj9X087901; Tue, 18 Jun 2013 09:37:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9bjW5087900; Tue, 18 Jun 2013 09:37:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180937.r5I9bjW5087900@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:37:45 +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: r251924 - stable/9/sys/geom/nop X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:37:45 -0000 Author: mav Date: Tue Jun 18 09:37:44 2013 New Revision: 251924 URL: http://svnweb.freebsd.org/changeset/base/251924 Log: MFC r248721: GEOM NOP does not touch the data, so pass G_PF_ACCEPT_UNMAPPED flag through. Modified: stable/9/sys/geom/nop/g_nop.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/nop/g_nop.c ============================================================================== --- stable/9/sys/geom/nop/g_nop.c Tue Jun 18 09:36:01 2013 (r251923) +++ stable/9/sys/geom/nop/g_nop.c Tue Jun 18 09:37:44 2013 (r251924) @@ -214,6 +214,7 @@ g_nop_create(struct gctl_req *req, struc goto fail; } + newpp->flags |= pp->flags & G_PF_ACCEPT_UNMAPPED; g_error_provider(newpp, 0); G_NOP_DEBUG(0, "Device %s created.", gp->name); return (0); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:39:53 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 679234DB; Tue, 18 Jun 2013 09:39:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A18A1B9F; Tue, 18 Jun 2013 09:39: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 r5I9drww088399; Tue, 18 Jun 2013 09:39:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9drRN088398; Tue, 18 Jun 2013 09:39:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180939.r5I9drRN088398@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:39:53 +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: r251925 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:39:53 -0000 Author: mav Date: Tue Jun 18 09:39:52 2013 New Revision: 251925 URL: http://svnweb.freebsd.org/changeset/base/251925 Log: MFC r248722: geom_slice.c and its consumers like GEOM_LABEL are not touching the data unless hotspots are used. Pass G_PF_ACCEPT_UNMAPPED flag through except such rare cases (obsolete GEOM_SUNLABEL and GEOM_BSD). Modified: stable/9/sys/geom/geom_slice.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_slice.c ============================================================================== --- stable/9/sys/geom/geom_slice.c Tue Jun 18 09:37:44 2013 (r251924) +++ stable/9/sys/geom/geom_slice.c Tue Jun 18 09:39:52 2013 (r251925) @@ -397,6 +397,8 @@ g_slice_config(struct g_geom *gp, u_int pp->stripeoffset = pp2->stripeoffset + offset; if (pp->stripesize > 0) pp->stripeoffset %= pp->stripesize; + if (gsp->nhotspot == 0) + pp->flags |= pp2->flags & G_PF_ACCEPT_UNMAPPED; if (0 && bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, @@ -429,11 +431,17 @@ g_slice_conf_hot(struct g_geom *gp, u_in { struct g_slicer *gsp; struct g_slice_hot *gsl, *gsl2; + struct g_provider *pp; g_trace(G_T_TOPOLOGY, "g_slice_conf_hot(%s, idx: %d, off: %jd, len: %jd)", gp->name, idx, (intmax_t)offset, (intmax_t)length); g_topology_assert(); gsp = gp->softc; + /* Deny unmapped I/O if hotspots are used. */ + if (gsp->nhotspot == 0) { + LIST_FOREACH(pp, &gp->provider, provider) + pp->flags &= ~G_PF_ACCEPT_UNMAPPED; + } gsl = gsp->hotspot; if(idx >= gsp->nhotspot) { gsl2 = g_malloc((idx + 1) * sizeof *gsl2, M_WAITOK | M_ZERO); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:42:43 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9087C80D; Tue, 18 Jun 2013 09:42:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 830091BC6; Tue, 18 Jun 2013 09:42: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 r5I9ghK1090699; Tue, 18 Jun 2013 09:42:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9ghZM090698; Tue, 18 Jun 2013 09:42:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180942.r5I9ghZM090698@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:42:43 +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: r251927 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:42:43 -0000 Author: mav Date: Tue Jun 18 09:42:43 2013 New Revision: 251927 URL: http://svnweb.freebsd.org/changeset/base/251927 Log: MFC r249193 (by trasz): Make it possible to submit FLUSH bios through geom_dev strategy. This is required for CTL to work with device-backed LUNs. Modified: stable/9/sys/geom/geom_dev.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Tue Jun 18 09:41:34 2013 (r251926) +++ stable/9/sys/geom/geom_dev.c Tue Jun 18 09:42:43 2013 (r251927) @@ -522,7 +522,8 @@ g_dev_strategy(struct bio *bp) KASSERT(bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE || - bp->bio_cmd == BIO_DELETE, + bp->bio_cmd == BIO_DELETE || + bp->bio_cmd == BIO_FLUSH, ("Wrong bio_cmd bio=%p cmd=%d", bp, bp->bio_cmd)); dev = bp->bio_dev; cp = dev->si_drv2; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:44:56 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 681B1B3F; Tue, 18 Jun 2013 09:44:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0E91BE3; Tue, 18 Jun 2013 09:44: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 r5I9iuFe091280; Tue, 18 Jun 2013 09:44:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9iugC091279; Tue, 18 Jun 2013 09:44:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180944.r5I9iugC091279@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:44:56 +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: r251929 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:44:56 -0000 Author: mav Date: Tue Jun 18 09:44:55 2013 New Revision: 251929 URL: http://svnweb.freebsd.org/changeset/base/251929 Log: MFC r249974: Return "descr" field alike to "Intel RAID1 volume" for GEOM RAID to make it look better in bsdinstall. Modified: stable/9/sys/geom/raid/g_raid.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Tue Jun 18 09:43:10 2013 (r251928) +++ stable/9/sys/geom/raid/g_raid.c Tue Jun 18 09:44:55 2013 (r251929) @@ -2357,6 +2357,10 @@ g_raid_dumpconf(struct sbuf *sb, const c vol = pp->private; g_topology_unlock(); sx_xlock(&sc->sc_lock); + sbuf_printf(sb, "%s%s %s volume\n", indent, + sc->sc_md->mdo_class->name, + g_raid_volume_level2str(vol->v_raid_level, + vol->v_raid_level_qualifier)); sbuf_printf(sb, "%s\n", indent, vol->v_name); sbuf_printf(sb, "%s%s\n", indent, From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 09:47:57 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FAA3137; Tue, 18 Jun 2013 09:47:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 027251C56; Tue, 18 Jun 2013 09:47: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 r5I9lut3092041; Tue, 18 Jun 2013 09:47:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9luds092040; Tue, 18 Jun 2013 09:47:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306180947.r5I9luds092040@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 09:47:56 +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: r251931 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 09:47:57 -0000 Author: mav Date: Tue Jun 18 09:47:56 2013 New Revision: 251931 URL: http://svnweb.freebsd.org/changeset/base/251931 Log: MFC r251616: Don't update provider properties and don't set DISKFLAG_OPEN if d_open() disk method call returned error. GEOM considers devices in such case as still closed, and won't call symmetric d_close() for them. Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Tue Jun 18 09:45:10 2013 (r251930) +++ stable/9/sys/geom/geom_disk.c Tue Jun 18 09:47:56 2013 (r251931) @@ -138,6 +138,8 @@ g_disk_access(struct g_provider *pp, int printf("Opened disk %s -> %d\n", pp->name, error); g_disk_unlock_giant(dp); + if (error != 0) + return (error); } pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 13:34:38 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B0824B0; Tue, 18 Jun 2013 13:34:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3233B1A02; Tue, 18 Jun 2013 13:34: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 r5IDYcbK065800; Tue, 18 Jun 2013 13:34:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IDYbqK065796; Tue, 18 Jun 2013 13:34:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306181334.r5IDYbqK065796@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 13:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251936 - in stable/9/sys: dev/bxe dev/esp dev/twa xen/xenstore X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 13:34:38 -0000 Author: mav Date: Tue Jun 18 13:34:37 2013 New Revision: 251936 URL: http://svnweb.freebsd.org/changeset/base/251936 Log: MFC r228526 (by kevlo): s/timout/timeout Modified: stable/9/sys/dev/bxe/bxe_reg.h stable/9/sys/dev/esp/ncr53c9x.c stable/9/sys/dev/twa/tw_osl.h stable/9/sys/xen/xenstore/xenstore.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe_reg.h ============================================================================== --- stable/9/sys/dev/bxe/bxe_reg.h Tue Jun 18 12:18:55 2013 (r251935) +++ stable/9/sys/dev/bxe/bxe_reg.h Tue Jun 18 13:34:37 2013 (r251936) @@ -1594,7 +1594,7 @@ /* * [RW 1] Setting this bit enables a timer in the GRC block to timeout an * access that does not finish within - * ~misc_registers_grc_timout_val.grc_timeout_val cycles. When this bit is + * ~misc_registers_grc_timeout_val.grc_timeout_val cycles. When this bit is * cleared; this timeout is disabled. If this timeout occurs; the GRC shall * assert it attention output. */ Modified: stable/9/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/9/sys/dev/esp/ncr53c9x.c Tue Jun 18 12:18:55 2013 (r251935) +++ stable/9/sys/dev/esp/ncr53c9x.c Tue Jun 18 13:34:37 2013 (r251936) @@ -316,7 +316,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s * The recommended timeout is 250ms. This register is loaded * with a value calculated as follows, from the docs: * - * (timout period) x (CLK frequency) + * (timeout period) x (CLK frequency) * reg = ------------------------------------- * 8192 x (Clock Conversion Factor) * Modified: stable/9/sys/dev/twa/tw_osl.h ============================================================================== --- stable/9/sys/dev/twa/tw_osl.h Tue Jun 18 12:18:55 2013 (r251935) +++ stable/9/sys/dev/twa/tw_osl.h Tue Jun 18 13:34:37 2013 (r251936) @@ -148,7 +148,7 @@ struct twa_softc { struct mtx sim_lock_handle;/* sim lock shared with cam */ struct mtx *sim_lock;/* ptr to sim lock */ - struct callout watchdog_callout[2]; /* For command timout */ + struct callout watchdog_callout[2]; /* For command timeout */ TW_UINT32 watchdog_index; #ifdef TW_OSL_DEBUG Modified: stable/9/sys/xen/xenstore/xenstore.c ============================================================================== --- stable/9/sys/xen/xenstore/xenstore.c Tue Jun 18 12:18:55 2013 (r251935) +++ stable/9/sys/xen/xenstore/xenstore.c Tue Jun 18 13:34:37 2013 (r251936) @@ -559,7 +559,7 @@ xs_read_store(void *tdata, unsigned len) * when msleep returns. */ error = msleep(xen_store, &xs.ring_lock, PCATCH|PDROP, - "xbread", /*timout*/0); + "xbread", /*timeout*/0); if (error && error != EWOULDBLOCK) return (error); continue; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 13:36:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8625636; Tue, 18 Jun 2013 13:36:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9ACE1A13; Tue, 18 Jun 2013 13:36: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 r5IDaFON066113; Tue, 18 Jun 2013 13:36:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IDaF3L066112; Tue, 18 Jun 2013 13:36:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306181336.r5IDaF3L066112@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 13:36: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: r251937 - stable/9/sys/dev/twa X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 13:36:15 -0000 Author: mav Date: Tue Jun 18 13:36:15 2013 New Revision: 251937 URL: http://svnweb.freebsd.org/changeset/base/251937 Log: MFC r242827 (by rdivacky): Give tw_osl_dbg_printf format string to pacify clang warning. Modified: stable/9/sys/dev/twa/tw_cl_misc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/twa/tw_cl_misc.c ============================================================================== --- stable/9/sys/dev/twa/tw_cl_misc.c Tue Jun 18 13:34:37 2013 (r251936) +++ stable/9/sys/dev/twa/tw_cl_misc.c Tue Jun 18 13:36:15 2013 (r251937) @@ -641,7 +641,7 @@ tw_cli_dbg_printf(TW_UINT8 dbg_level, va_end(ap); tw_osl_strcpy(print_str + tw_osl_strlen(print_str), "\n"); - tw_osl_dbg_printf(ctlr_handle, print_str); + tw_osl_dbg_printf(ctlr_handle, "%s", print_str); } #endif /* TW_OSL_DEBUG */ } From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 13:38:11 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C366867; Tue, 18 Jun 2013 13:38:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E7FA71A34; Tue, 18 Jun 2013 13:38: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 r5IDcA17066426; Tue, 18 Jun 2013 13:38:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IDcAfc066424; Tue, 18 Jun 2013 13:38:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306181338.r5IDcAfc066424@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 13:38: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: r251938 - stable/9/sys/dev/twa X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 13:38:11 -0000 Author: mav Date: Tue Jun 18 13:38:10 2013 New Revision: 251938 URL: http://svnweb.freebsd.org/changeset/base/251938 Log: MFC r248583 (by kib): Fix twa(4) after the r246713. The driver copies data around to satisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCB flag for mapped data, pass the csio->data_ptr in the req->data. Do not put the ccb pointer into req->data ever, ccb is stored in req->orig_req already. Submitted by: Shuichi KITAGUCHI PR: kern/177020 Modified: stable/9/sys/dev/twa/tw_osl_cam.c stable/9/sys/dev/twa/tw_osl_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_cam.c Tue Jun 18 13:36:15 2013 (r251937) +++ stable/9/sys/dev/twa/tw_osl_cam.c Tue Jun 18 13:38:10 2013 (r251938) @@ -273,9 +273,13 @@ tw_osli_execute_scsi(struct tw_osli_req_ xpt_done(ccb); return(1); } - req->data = ccb; - req->length = csio->dxfer_len; - req->flags |= TW_OSLI_REQ_FLAGS_CCB; + if ((ccb_h->flags & CAM_DATA_MASK) == CAM_DATA_VADDR) { + if ((req->length = csio->dxfer_len) != 0) { + req->data = csio->data_ptr; + scsi_req->sgl_entries = 1; + } + } else + req->flags |= TW_OSLI_REQ_FLAGS_CCB; req->deadline = tw_osl_get_local_time() + (ccb_h->timeout / 1000); /* Modified: stable/9/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_freebsd.c Tue Jun 18 13:36:15 2013 (r251937) +++ stable/9/sys/dev/twa/tw_osl_freebsd.c Tue Jun 18 13:38:10 2013 (r251938) @@ -1475,7 +1475,7 @@ tw_osli_map_request(struct tw_osli_req_c mtx_unlock_spin(sc->io_lock); } else if (req->flags & TW_OSLI_REQ_FLAGS_CCB) { error = bus_dmamap_load_ccb(sc->dma_tag, req->dma_map, - req->data, twa_map_load_data_callback, req, + req->orig_req, twa_map_load_data_callback, req, BUS_DMA_WAITOK); } else { /* From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 14:20:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF0C79F7; Tue, 18 Jun 2013 14:20:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF4141C6A; Tue, 18 Jun 2013 14:20: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 r5IEKESR080984; Tue, 18 Jun 2013 14:20:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IEKEfE080982; Tue, 18 Jun 2013 14:20:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181420.r5IEKEfE080982@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 14:20:14 +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: r251939 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:20:14 -0000 Author: marius Date: Tue Jun 18 14:20:14 2013 New Revision: 251939 URL: http://svnweb.freebsd.org/changeset/base/251939 Log: MFC: r248804 deferal -> deferral MFC: r248891 Pass correct parameter to CTR5() in bus_dmamap_load_uio. MFC: r248892 Do not add 1 to nsegs before passing to CTR5(), since nsegs has already been incremented before these calls. MFC: r248893 Add CTR5() to bus_dmamap_load_ccb, similar to other bus_dmamap_load_* functions. MFC: r248896 Add bus_dmamap_load_bio for non-CAM disk drivers that wish to enable unmapped I/O. MFC: r249025 Add support for XPT_CONT_TARGET_IO CCBs in _bus_dmamap_load_ccb(). Declare CCB types in their respective switch blocks. MFC: r249538 Some compilers issue a warning when wider integer is casted to narrow pointer. Supposedly shut down the warning by casting through uintptr_t. MFC: r251221 Move an assertion to the right spot; only bus_dmamap_load_mbuf(9) requires a pkthdr being present but that's not the case for either _bus_dmamap_load_mbuf_sg() or bus_dmamap_load_mbuf_sg(9). Modified: stable/9/sys/kern/subr_bus_dma.c stable/9/sys/sys/bus_dma.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/subr_bus_dma.c ============================================================================== --- stable/9/sys/kern/subr_bus_dma.c Tue Jun 18 13:38:10 2013 (r251938) +++ stable/9/sys/kern/subr_bus_dma.c Tue Jun 18 14:20:14 2013 (r251939) @@ -104,8 +104,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d struct mbuf *m; int error; - M_ASSERTPKTHDR(m0); - error = 0; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { @@ -158,8 +156,6 @@ static int _bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, int *nsegs, int flags) { - struct ccb_ataio *ataio; - struct ccb_scsiio *csio; struct ccb_hdr *ccb_h; void *data_ptr; int error; @@ -169,18 +165,33 @@ _bus_dmamap_load_ccb(bus_dma_tag_t dmat, error = 0; ccb_h = &ccb->ccb_h; switch (ccb_h->func_code) { - case XPT_SCSI_IO: + case XPT_SCSI_IO: { + struct ccb_scsiio *csio; + csio = &ccb->csio; data_ptr = csio->data_ptr; dxfer_len = csio->dxfer_len; sglist_cnt = csio->sglist_cnt; break; - case XPT_ATA_IO: + } + case XPT_CONT_TARGET_IO: { + struct ccb_scsiio *ctio; + + ctio = &ccb->ctio; + data_ptr = ctio->data_ptr; + dxfer_len = ctio->dxfer_len; + sglist_cnt = ctio->sglist_cnt; + break; + } + case XPT_ATA_IO: { + struct ccb_ataio *ataio; + ataio = &ccb->ataio; data_ptr = ataio->data_ptr; dxfer_len = ataio->dxfer_len; sglist_cnt = 0; break; + } default: panic("_bus_dmamap_load_ccb: Unsupported func code %d", ccb_h->func_code); @@ -282,7 +293,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ nsegs++; CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, flags, error, nsegs + 1); + __func__, dmat, flags, error, nsegs); if (error == EINPROGRESS) return (error); @@ -295,7 +306,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ /* * Return ENOMEM to the caller so that it can pass it up the stack. - * This error only happens when NOWAIT is set, so deferal is disabled. + * This error only happens when NOWAIT is set, so deferral is disabled. */ if (error == ENOMEM) return (error); @@ -310,6 +321,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dma_segment_t *segs; int nsegs, error; + M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; nsegs = -1; error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, NULL, &nsegs, flags); @@ -359,7 +372,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, (*callback)(callback_arg, segs, nsegs, uio->uio_resid, error); CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat, error, nsegs + 1); + __func__, dmat, flags, error, nsegs); return (error); } @@ -386,6 +399,10 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, nsegs = -1; error = _bus_dmamap_load_ccb(dmat, map, ccb, &nsegs, flags); nsegs++; + + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, flags, error, nsegs); + if (error == EINPROGRESS) return (error); @@ -396,7 +413,46 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, (*callback)(callback_arg, segs, nsegs, error); /* * Return ENOMEM to the caller so that it can pass it up the stack. - * This error only happens when NOWAIT is set, so deferal is disabled. + * This error only happens when NOWAIT is set, so deferral is disabled. + */ + if (error == ENOMEM) + return (error); + + return (0); +} + +int +bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, + bus_dmamap_callback_t *callback, void *callback_arg, + int flags) +{ + bus_dma_segment_t *segs; + struct memdesc mem; + int error; + int nsegs; + + if ((flags & BUS_DMA_NOWAIT) == 0) { + mem = memdesc_bio(bio); + _bus_dmamap_waitok(dmat, map, &mem, callback, callback_arg); + } + nsegs = -1; + error = _bus_dmamap_load_bio(dmat, map, bio, &nsegs, flags); + nsegs++; + + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, flags, error, nsegs); + + if (error == EINPROGRESS) + return (error); + + segs = _bus_dmamap_complete(dmat, map, NULL, nsegs, error); + if (error) + (*callback)(callback_arg, segs, 0, error); + else + (*callback)(callback_arg, segs, nsegs, error); + /* + * Return ENOMEM to the caller so that it can pass it up the stack. + * This error only happens when NOWAIT is set, so deferral is disabled. */ if (error == ENOMEM) return (error); @@ -455,7 +511,7 @@ bus_dmamap_load_mem(bus_dma_tag_t dmat, nsegs++; CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, flags, error, nsegs + 1); + __func__, dmat, flags, error, nsegs); if (error == EINPROGRESS) return (error); @@ -468,7 +524,7 @@ bus_dmamap_load_mem(bus_dma_tag_t dmat, /* * Return ENOMEM to the caller so that it can pass it up the stack. - * This error only happens when NOWAIT is set, so deferal is disabled. + * This error only happens when NOWAIT is set, so deferral is disabled. */ if (error == ENOMEM) return (error); Modified: stable/9/sys/sys/bus_dma.h ============================================================================== --- stable/9/sys/sys/bus_dma.h Tue Jun 18 13:38:10 2013 (r251938) +++ stable/9/sys/sys/bus_dma.h Tue Jun 18 14:20:14 2013 (r251939) @@ -233,6 +233,13 @@ int bus_dmamap_load_ccb(bus_dma_tag_t dm int flags); /* + * Like bus_dmamap_load but for bios. + */ +int bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, + bus_dmamap_callback_t *callback, void *callback_arg, + int flags); + +/* * Loads any memory descriptor. */ int bus_dmamap_load_mem(bus_dma_tag_t dmat, bus_dmamap_t map, From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 14:35:10 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 32211382; Tue, 18 Jun 2013 14:35:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 082901D9F; Tue, 18 Jun 2013 14:35: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 r5IEZ97A086487; Tue, 18 Jun 2013 14:35:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IEZ9Ic086481; Tue, 18 Jun 2013 14:35:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181435.r5IEZ9Ic086481@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 14:35: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: r251940 - stable/9/sys/dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:35:10 -0000 Author: marius Date: Tue Jun 18 14:35:09 2013 New Revision: 251940 URL: http://svnweb.freebsd.org/changeset/base/251940 Log: MFC: r247165 Fix command timeout caused by data underrun during fetching ATAPI sense data, introduced by r246713 (MFC'ed to stable/9 in r251874). There are two places where ata_request is filled in ATA_CAM: ata_cam_begin_transaction() and ata_cam_request_sense(). In the first case DMA should be done for addresses from the CCB. In second case, DMA should be done to the different address, the address of the sense buffer inside the CCB structure itself. Modified: stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ata/ata-all.h stable/9/sys/dev/ata/ata-dma.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Tue Jun 18 14:20:14 2013 (r251939) +++ stable/9/sys/dev/ata/ata-all.c Tue Jun 18 14:35:09 2013 (r251940) @@ -1695,6 +1695,7 @@ ata_cam_begin_transaction(device_t dev, request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); request->ccb = ccb; + request->flags |= ATA_R_DATA_IN_CCB; ch->running = request; ch->state = ATA_ACTIVE; Modified: stable/9/sys/dev/ata/ata-all.h ============================================================================== --- stable/9/sys/dev/ata/ata-all.h Tue Jun 18 14:20:14 2013 (r251939) +++ stable/9/sys/dev/ata/ata-all.h Tue Jun 18 14:35:09 2013 (r251940) @@ -398,6 +398,7 @@ struct ata_request { #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 #define ATA_R_NEEDRESULT 0x00002000 +#define ATA_R_DATA_IN_CCB 0x00004000 #define ATA_R_ATAPI16 0x00010000 #define ATA_R_ATAPI_INTR 0x00020000 Modified: stable/9/sys/dev/ata/ata-dma.c ============================================================================== --- stable/9/sys/dev/ata/ata-dma.c Tue Jun 18 14:20:14 2013 (r251939) +++ stable/9/sys/dev/ata/ata-dma.c Tue Jun 18 14:35:09 2013 (r251940) @@ -305,7 +305,7 @@ ata_dmaload(struct ata_request *request, dspa.dmatab = request->dma->sg; #ifdef ATA_CAM - if (request->ccb) + if (request->flags & ATA_R_DATA_IN_CCB) error = bus_dmamap_load_ccb(request->dma->data_tag, request->dma->data_map, request->ccb, ch->dma.setprd, &dspa, BUS_DMA_NOWAIT); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 14:40:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE545572; Tue, 18 Jun 2013 14:40:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFF5D1DDF; Tue, 18 Jun 2013 14:40: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 r5IEeMDH088701; Tue, 18 Jun 2013 14:40:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IEeME8088696; Tue, 18 Jun 2013 14:40:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181440.r5IEeME8088696@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 14:40: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: r251941 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:40:23 -0000 Author: marius Date: Tue Jun 18 14:40:21 2013 New Revision: 251941 URL: http://svnweb.freebsd.org/changeset/base/251941 Log: MFC: r251116 Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the same support for aacp(4), I'm lacking the necessary hardware for testing, though. Modified: stable/9/sys/dev/aac/aac.c stable/9/sys/dev/aac/aac_disk.c stable/9/sys/dev/aac/aacvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aac.c Tue Jun 18 14:40:21 2013 (r251941) @@ -987,14 +987,18 @@ aac_startio(struct aac_softc *sc) * busdma. */ if (cm->cm_datalen != 0) { - error = bus_dmamap_load(sc->aac_buffer_dmat, - cm->cm_datamap, cm->cm_data, - cm->cm_datalen, - aac_map_command_sg, cm, 0); + if (cm->cm_flags & AAC_REQ_BIO) + error = bus_dmamap_load_bio( + sc->aac_buffer_dmat, cm->cm_datamap, + (struct bio *)cm->cm_private, + aac_map_command_sg, cm, 0); + else + error = bus_dmamap_load(sc->aac_buffer_dmat, + cm->cm_datamap, cm->cm_data, + cm->cm_datalen, aac_map_command_sg, cm, 0); if (error == EINPROGRESS) { fwprintf(sc, HBA_FLAGS_DBG_COMM_B, "freezing queue\n"); sc->flags |= AAC_QUEUE_FRZN; - error = 0; } else if (error != 0) panic("aac_startio: unexpected error %d from " "busdma", error); @@ -1199,9 +1203,9 @@ aac_bio_command(struct aac_softc *sc, st goto fail; /* fill out the command */ - cm->cm_data = (void *)bp->bio_data; cm->cm_datalen = bp->bio_bcount; cm->cm_complete = aac_bio_complete; + cm->cm_flags = AAC_REQ_BIO; cm->cm_private = bp; cm->cm_timestamp = time_uptime; Modified: stable/9/sys/dev/aac/aac_disk.c ============================================================================== --- stable/9/sys/dev/aac/aac_disk.c Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aac_disk.c Tue Jun 18 14:40:21 2013 (r251941) @@ -397,6 +397,7 @@ aac_disk_attach(device_t dev) sc->unit = device_get_unit(dev); sc->ad_disk = disk_alloc(); sc->ad_disk->d_drv1 = sc; + sc->ad_disk->d_flags = DISKFLAG_UNMAPPED_BIO; sc->ad_disk->d_name = "aacd"; sc->ad_disk->d_maxsize = sc->ad_controller->aac_max_sectors << 9; sc->ad_disk->d_open = aac_disk_open; Modified: stable/9/sys/dev/aac/aacvar.h ============================================================================== --- stable/9/sys/dev/aac/aacvar.h Tue Jun 18 14:35:09 2013 (r251940) +++ stable/9/sys/dev/aac/aacvar.h Tue Jun 18 14:40:21 2013 (r251941) @@ -181,6 +181,8 @@ struct aac_command #define AAC_ON_AACQ_MASK ((1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<10)) #define AAC_QUEUE_FRZN (1<<9) /* Freeze the processing of * commands on the queue. */ +#define AAC_REQ_BIO (1 << 11) +#define AAC_REQ_CCB (1 << 12) void (*cm_complete)(struct aac_command *cm); void *cm_private; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 14:46:43 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24DB289D; Tue, 18 Jun 2013 14:46:43 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F09941E3C; Tue, 18 Jun 2013 14:46: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 r5IEkgD3089961; Tue, 18 Jun 2013 14:46:42 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IEkg9Q089958; Tue, 18 Jun 2013 14:46:42 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306181446.r5IEkg9Q089958@svn.freebsd.org> From: Scott Long Date: Tue, 18 Jun 2013 14:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251942 - in stable/9/sys: geom kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:46:43 -0000 Author: scottl Date: Tue Jun 18 14:46:42 2013 New Revision: 251942 URL: http://svnweb.freebsd.org/changeset/base/251942 Log: MFC r248712: Do not pass unmapped buffers to drivers that cannot handle them Submitted by: kan, mav Obtained from: Netflix Modified: stable/9/sys/geom/geom_dev.c stable/9/sys/kern/kern_physio.c stable/9/sys/sys/conf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Tue Jun 18 14:40:21 2013 (r251941) +++ stable/9/sys/geom/geom_dev.c Tue Jun 18 14:46:42 2013 (r251942) @@ -79,7 +79,7 @@ static struct cdevsw g_dev_cdevsw = { .d_ioctl = g_dev_ioctl, .d_strategy = g_dev_strategy, .d_name = "g_dev", - .d_flags = D_DISK | D_TRACKCLOSE, + .d_flags = D_DISK | D_TRACKCLOSE | D_UNMAPPED_IO, }; static g_taste_t g_dev_taste; Modified: stable/9/sys/kern/kern_physio.c ============================================================================== --- stable/9/sys/kern/kern_physio.c Tue Jun 18 14:40:21 2013 (r251941) +++ stable/9/sys/kern/kern_physio.c Tue Jun 18 14:46:42 2013 (r251942) @@ -92,11 +92,19 @@ physio(struct cdev *dev, struct uio *uio bp->b_blkno = btodb(bp->b_offset); csw = dev->si_devsw; if (uio->uio_segflg == UIO_USERSPACE) { - if (vmapbuf(bp, 0) < 0) { + int mapped; + + if (csw != NULL && + (csw->d_flags & D_UNMAPPED_IO) != 0) + mapped = 0; + else + mapped = 1; + if (vmapbuf(bp, mapped) < 0) { error = EFAULT; goto doerror; } } + dev_strategy_csw(dev, csw, bp); if (uio->uio_rw == UIO_READ) bwait(bp, PRIBIO, "physrd"); Modified: stable/9/sys/sys/conf.h ============================================================================== --- stable/9/sys/sys/conf.h Tue Jun 18 14:40:21 2013 (r251941) +++ stable/9/sys/sys/conf.h Tue Jun 18 14:46:42 2013 (r251942) @@ -171,6 +171,7 @@ typedef int dumper_t( #define D_PSEUDO 0x00200000 /* make_dev() can return NULL */ #define D_NEEDGIANT 0x00400000 /* driver want Giant */ #define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */ +#define D_UNMAPPED_IO 0x01000000 /* d_strategy can accept unmapped IO */ /* * Version numbers. From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 14:57:35 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7490CEBD; Tue, 18 Jun 2013 14:57:35 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 6946A1EF1; Tue, 18 Jun 2013 14:57:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id r5IEvCOP048723; Tue, 18 Jun 2013 18:57:12 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Tue, 18 Jun 2013 18:57:12 +0400 (MSK) From: Maxim Konovalov To: Brooks Davis Subject: Re: svn: stable/9: . usr.bin/xinstall In-Reply-To: <20130603164807.GA77693@lor.one-eyed-alien.net> Message-ID: References: <201303151519.r2FFJYjS060493@svn.freebsd.org> <51AA52FD.9090303@FreeBSD.org> <20130603164807.GA77693@lor.one-eyed-alien.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Maxim Sobolev , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, svn-src-stable-9@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 14:57:35 -0000 Hi Brooks, On Mon, 3 Jun 2013, 11:48-0500, Brooks Davis wrote: > On Sat, Jun 01, 2013 at 01:01:01PM -0700, Maxim Sobolev wrote: > > Hmm, I believe this breaks build for me. Any ideas why? > > Presumably you are building in some less common way since this change > has been working for months. What command line resulted in this error? > Is this tree fully up to date? Do you have anything in src.conf or > make.conf? From the error, it looks like you haven't bootstrapped a new > libc properly. > I see the same failure trying to make buildworld with fresh stable/9 checkout on 1yo 9.0-STABLE. No src.conf and pretty much contentless make.conf. > -- Brooks > > > ===> usr.bin/xinstall (all) > > cc -O2 -pipe -I/usr/src/usr.bin/xinstall/../../contrib/mtree > > -I/usr/src/usr.bin/xinstall/../../lib/libnetbsd > > -I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector > > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter > > -Wcast-align -Wchar-subscripts -Winline -Wnested-externs > > -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c > > /usr/src/usr.bin/xinstall/xinstall.c > > cc1: warnings being treated as errors > > /usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log': > > /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration > > of function 'strsvis' > > /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern > > declaration of 'strsvis' > > *** [xinstall.o] Error code 1 > > > > Stop in /usr/src/usr.bin/xinstall. > > *** [all] Error code 1 > > [...] -- Maxim Konovalov From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:00:20 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE80DDE; Tue, 18 Jun 2013 15:00:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C03E61F15; Tue, 18 Jun 2013 15:00:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IF0Kqd093660; Tue, 18 Jun 2013 15:00:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IF0Ke9093658; Tue, 18 Jun 2013 15:00:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181500.r5IF0Ke9093658@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 15:00:20 +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: r251943 - stable/9/sys/dev/isp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:00:20 -0000 Author: marius Date: Tue Jun 18 15:00:20 2013 New Revision: 251943 URL: http://svnweb.freebsd.org/changeset/base/251943 Log: MFC: r251373 Flag isp(4) as supporting unmapped I/O; all necessary conversion actually already has been done as part of r246713 (MFC'ed to stable/9 in r251874). Modified: stable/9/sys/dev/isp/isp_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Tue Jun 18 14:46:42 2013 (r251942) +++ stable/9/sys/dev/isp/isp_freebsd.c Tue Jun 18 15:00:20 2013 (r251943) @@ -5450,7 +5450,7 @@ isp_action(struct cam_sim *sim, union cc if (IS_FC(isp)) { fcparam *fcp = FCPARAM(isp, bus); - cpi->hba_misc = PIM_NOBUSRESET; + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; /* * Because our loop ID can shift from time to time, @@ -5480,7 +5480,7 @@ isp_action(struct cam_sim *sim, union cc } else { sdparam *sdp = SDPARAM(isp, bus); cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; - cpi->hba_misc = 0; + cpi->hba_misc = PIM_UNMAPPED; cpi->initiator_id = sdp->isp_initiator_id; cpi->base_transfer_speed = 3300; cpi->transport = XPORT_SPI; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:02:53 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B434E27A; Tue, 18 Jun 2013 15:02:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4E4F1F30; Tue, 18 Jun 2013 15:02: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 r5IF2rYD095757; Tue, 18 Jun 2013 15:02:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IF2rb5095756; Tue, 18 Jun 2013 15:02:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181502.r5IF2rb5095756@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 15:02:53 +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: r251944 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:02:53 -0000 Author: marius Date: Tue Jun 18 15:02:53 2013 New Revision: 251944 URL: http://svnweb.freebsd.org/changeset/base/251944 Log: MFC: r242823 Give panic format string to pacify clang warning. Modified: stable/9/sys/dev/aac/aac_debug.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac_debug.c ============================================================================== --- stable/9/sys/dev/aac/aac_debug.c Tue Jun 18 15:00:20 2013 (r251943) +++ stable/9/sys/dev/aac/aac_debug.c Tue Jun 18 15:02:53 2013 (r251944) @@ -160,7 +160,7 @@ void aac_panic(struct aac_softc *sc, char *reason) { aac_print_queues(sc); - panic(reason); + panic("%s", reason); } /* From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:06:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EC7059A; Tue, 18 Jun 2013 15:06:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0521F5B; Tue, 18 Jun 2013 15:06: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 r5IF63rP096660; Tue, 18 Jun 2013 15:06:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IF6349096659; Tue, 18 Jun 2013 15:06:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181506.r5IF6349096659@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 15:06:03 +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: r251946 - stable/9/sys/dev/isp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:06:03 -0000 Author: marius Date: Tue Jun 18 15:06:02 2013 New Revision: 251946 URL: http://svnweb.freebsd.org/changeset/base/251946 Log: MFC: r247264 Turn off fast posting for the ISP2100- I'd forgotten that it actually might have been enabled for them- now that we use all 32 bits of handle. Fast Posting doesn't pass the full 32 bits. Modified: stable/9/sys/dev/isp/isp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp.c ============================================================================== --- stable/9/sys/dev/isp/isp.c Tue Jun 18 15:04:17 2013 (r251945) +++ stable/9/sys/dev/isp/isp.c Tue Jun 18 15:06:02 2013 (r251946) @@ -1709,7 +1709,13 @@ isp_fibre_init(ispsoftc_t *isp) * * NB: for the 2300, ICBOPT_EXTENDED is required. */ - if (IS_2200(isp) || IS_23XX(isp)) { + if (IS_2100(isp)) { + /* + * We can't have Fast Posting any more- we now + * have 32 bit handles. + */ + icbp->icb_fwoptions &= ~ICBOPT_FAST_POST; + } else if (IS_2200(isp) || IS_23XX(isp)) { icbp->icb_fwoptions |= ICBOPT_EXTENDED; icbp->icb_xfwoptions = fcp->isp_xfwoptions; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:14:20 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4740A0E; Tue, 18 Jun 2013 15:14:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D661D2000; Tue, 18 Jun 2013 15:14:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5IFEKiU000153; Tue, 18 Jun 2013 15:14:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IFEKnS000152; Tue, 18 Jun 2013 15:14:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181514.r5IFEKnS000152@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 15:14:20 +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: r251947 - stable/9/sys/dev/sym X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:14:21 -0000 Author: marius Date: Tue Jun 18 15:14:20 2013 New Revision: 251947 URL: http://svnweb.freebsd.org/changeset/base/251947 Log: MFC: r251403 (partial) Flag sym(4) as supporting unmapped I/O; all necessary conversion actually already has been done as part of r246713 (MFC'ed to stable/9 in r251874). Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Tue Jun 18 15:06:02 2013 (r251946) +++ stable/9/sys/dev/sym/sym_hipd.c Tue Jun 18 15:14:20 2013 (r251947) @@ -7869,7 +7869,6 @@ sym_setup_data_and_start(hcb_p np, struc xpt_freeze_simq(np->sim, 1); csio->ccb_h.status |= CAM_RELEASE_SIMQ; } - return; } /* @@ -8055,7 +8054,7 @@ static void sym_action2(struct cam_sim * if ((np->features & FE_WIDE) != 0) cpi->hba_inquiry |= PI_WIDE_16; cpi->target_sprt = 0; - cpi->hba_misc = 0; + cpi->hba_misc = PIM_UNMAPPED; if (np->usrflags & SYM_SCAN_TARGETS_HILO) cpi->hba_misc |= PIM_SCANHILO; if (np->usrflags & SYM_AVOID_BUS_RESET) From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:17:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8F14A75; Tue, 18 Jun 2013 15:17:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80D441088; Tue, 18 Jun 2013 15:17: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 r5IFHTQx000915; Tue, 18 Jun 2013 15:17:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IFHTcJ000914; Tue, 18 Jun 2013 15:17:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306181517.r5IFHTcJ000914@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 15:17: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: r251949 - stable/9/sys/dev/sym X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:17:29 -0000 Author: marius Date: Tue Jun 18 15:17:29 2013 New Revision: 251949 URL: http://svnweb.freebsd.org/changeset/base/251949 Log: MFC: r245263 Clang complains about the comparision of fak < 0 always being false. It is right. Delete it because on the next line we catch all 'negative' cases with the test > 2, since 'negative' numbers are just really big unsigned numbers and we do an identical action. Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Tue Jun 18 15:15:53 2013 (r251948) +++ stable/9/sys/dev/sym/sym_hipd.c Tue Jun 18 15:17:29 2013 (r251949) @@ -3430,7 +3430,6 @@ sym_getsync(hcb_p np, u_char dt, u_char /* * Check against our hardware limits, or bugs :). */ - if (fak < 0) {fak = 0; ret = -1;} if (fak > 2) {fak = 2; ret = -1;} /* From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 15:31:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 652F768D; Tue, 18 Jun 2013 15:31:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 571631123; Tue, 18 Jun 2013 15:31: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 r5IFViiq006334; Tue, 18 Jun 2013 15:31:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IFVikH006333; Tue, 18 Jun 2013 15:31:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201306181531.r5IFVikH006333@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Jun 2013 15:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251951 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 15:31:44 -0000 Author: mav Date: Tue Jun 18 15:31:43 2013 New Revision: 251951 URL: http://svnweb.freebsd.org/changeset/base/251951 Log: Remove diff from head after manual r251942 merge. Reviewed by: scottl Modified: stable/9/sys/kern/kern_physio.c Modified: stable/9/sys/kern/kern_physio.c ============================================================================== --- stable/9/sys/kern/kern_physio.c Tue Jun 18 15:22:16 2013 (r251950) +++ stable/9/sys/kern/kern_physio.c Tue Jun 18 15:31:43 2013 (r251951) @@ -38,7 +38,7 @@ physio(struct cdev *dev, struct uio *uio struct cdevsw *csw; caddr_t sa; u_int iolen; - int error, i; + int error, i, mapped; /* Keep the process UPAGES from being swapped. XXX: why ? */ PHOLD(curproc); @@ -90,10 +90,9 @@ physio(struct cdev *dev, struct uio *uio bp->b_bufsize = bp->b_bcount; bp->b_blkno = btodb(bp->b_offset); + csw = dev->si_devsw; if (uio->uio_segflg == UIO_USERSPACE) { - int mapped; - if (csw != NULL && (csw->d_flags & D_UNMAPPED_IO) != 0) mapped = 0; From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 19:03:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17B9B9AF; Tue, 18 Jun 2013 19:03:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09B421DE5; Tue, 18 Jun 2013 19:03: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 r5IJ3R1q074267; Tue, 18 Jun 2013 19:03:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IJ3RwL074266; Tue, 18 Jun 2013 19:03:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306181903.r5IJ3RwL074266@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Jun 2013 19:03:27 +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: r251957 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 19:03:28 -0000 Author: kib Date: Tue Jun 18 19:03:27 2013 New Revision: 251957 URL: http://svnweb.freebsd.org/changeset/base/251957 Log: MFC r251285: Do not map the shared page COW. Modified: stable/9/sys/kern/kern_exec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Tue Jun 18 16:36:21 2013 (r251956) +++ stable/9/sys/kern/kern_exec.c Tue Jun 18 19:03:27 2013 (r251957) @@ -1069,8 +1069,9 @@ exec_new_vmspace(imgp, sv) vm_object_reference(obj); error = vm_map_fixed(map, obj, 0, sv->sv_shared_page_base, sv->sv_shared_page_len, - VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL, - MAP_COPY_ON_WRITE | MAP_ACC_NO_CHARGE); + VM_PROT_READ | VM_PROT_EXECUTE, + VM_PROT_READ | VM_PROT_EXECUTE, + MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE); if (error) { vm_object_deallocate(obj); return (error); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 21:14:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81E0C552; Tue, 18 Jun 2013 21:14:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64ACB136A; Tue, 18 Jun 2013 21:14: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 r5ILE79q016098; Tue, 18 Jun 2013 21:14:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5ILE6lF016088; Tue, 18 Jun 2013 21:14:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306182114.r5ILE6lF016088@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 21:14: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: r251962 - in stable/9/sys: conf ia64/ia64 ia64/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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 21:14:07 -0000 Author: marius Date: Tue Jun 18 21:14:05 2013 New Revision: 251962 URL: http://svnweb.freebsd.org/changeset/base/251962 Log: MFC: r238184 Hide the creation of phys_avail behind an API to make it easier to do it correctly. We now iterate the EFI memory descriptors once and collect all the information in a single pass. Added: stable/9/sys/ia64/ia64/physmem.c - copied unchanged from r238184, head/sys/ia64/ia64/physmem.c Modified: stable/9/sys/conf/files.ia64 stable/9/sys/ia64/ia64/busdma_machdep.c stable/9/sys/ia64/ia64/machdep.c stable/9/sys/ia64/include/md_var.h stable/9/sys/ia64/include/param.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files.ia64 ============================================================================== --- stable/9/sys/conf/files.ia64 Tue Jun 18 20:19:09 2013 (r251961) +++ stable/9/sys/conf/files.ia64 Tue Jun 18 21:14:05 2013 (r251962) @@ -97,6 +97,7 @@ ia64/ia64/mp_machdep.c optional smp ia64/ia64/nexus.c standard ia64/ia64/pal.S standard ia64/ia64/physical.S standard +ia64/ia64/physmem.c standard ia64/ia64/pmap.c standard ia64/ia64/ptrace_machdep.c standard ia64/ia64/sal.c standard Modified: stable/9/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/busdma_machdep.c Tue Jun 18 20:19:09 2013 (r251961) +++ stable/9/sys/ia64/ia64/busdma_machdep.c Tue Jun 18 21:14:05 2013 (r251962) @@ -262,7 +262,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, atomic_add_int(&parent->ref_count, 1); } - if (newtag->lowaddr < ptoa(Maxmem) && (flags & BUS_DMA_ALLOCNOW) != 0) { + if (newtag->lowaddr < paddr_max && (flags & BUS_DMA_ALLOCNOW) != 0) { /* Must bounce */ if (ptoa(total_bpages) < maxsize) { @@ -340,7 +340,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->lowaddr < ptoa(Maxmem)) { + if (dmat->lowaddr < paddr_max) { /* Must bounce */ int maxpages; @@ -356,7 +356,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. */ - maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->lowaddr)); + maxpages = MIN(MAX_BPAGES, atop(paddr_max - dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (dmat->map_count > 0 && total_bpages < maxpages)) { int pages; @@ -438,7 +438,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi */ if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa(Maxmem)) { + dmat->lowaddr >= paddr_max) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); } else { /* @@ -473,7 +473,7 @@ bus_dmamem_free(bus_dma_tag_t dmat, void panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa(Maxmem)) + dmat->lowaddr >= paddr_max) free(vaddr, M_DEVBUF); else { contigfree(vaddr, dmat->maxsize, M_DEVBUF); @@ -515,7 +515,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vm_offset_t vendaddr; bus_addr_t paddr; - if ((dmat->lowaddr < ptoa(Maxmem) || dmat->boundary > 0 || + if ((dmat->lowaddr < paddr_max || dmat->boundary > 0 || dmat->alignment > 1) && map != &nobounce_dmamap && map->pagesneeded == 0) { /* Modified: stable/9/sys/ia64/ia64/machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/machdep.c Tue Jun 18 20:19:09 2013 (r251961) +++ stable/9/sys/ia64/ia64/machdep.c Tue Jun 18 21:14:05 2013 (r251962) @@ -168,22 +168,11 @@ SYSCTL_STRING(_hw, OID_AUTO, family, CTL extern vm_offset_t ksym_start, ksym_end; #endif - struct msgbuf *msgbufp = NULL; /* Other subsystems (e.g., ACPI) can hook this later. */ void (*cpu_idle_hook)(void) = NULL; -long Maxmem = 0; -long realmem = 0; - -#define PHYSMAP_SIZE (2 * VM_PHYSSEG_MAX) - -vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; - -/* must be 2 less so 0 0 can signal end of chunks */ -#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) - struct kva_md_info kmi; #define Mhz 1000000L @@ -286,25 +275,8 @@ cpu_startup(void *dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ld (%ld MB)\n", ia64_ptob(Maxmem), - ia64_ptob(Maxmem) / 1048576); - realmem = Maxmem; - - /* - * Display any holes after the first chunk of extended memory. - */ - if (bootverbose) { - int indx; - - printf("Physical memory chunk(s):\n"); - for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - long size1 = phys_avail[indx + 1] - phys_avail[indx]; - - printf("0x%08lx - 0x%08lx, %ld bytes (%ld pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 >> PAGE_SHIFT); - } - } + printf("real memory = %ld (%ld MB)\n", ptoa(realmem), + ptoa(realmem) / 1048576); vm_ksubmap_init(&kmi); @@ -716,43 +688,87 @@ struct ia64_init_return ia64_init(void) { struct ia64_init_return ret; - int phys_avail_cnt; - vm_offset_t kernstart, kernend; - vm_offset_t kernstartpfn, kernendpfn, pfn0, pfn1; - char *p; struct efi_md *md; + pt_entry_t *pbvm_pgtbl_ent, *pbvm_pgtbl_lim; + char *p; + vm_offset_t kernend; + vm_size_t mdlen; int metadata_missing; - /* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */ - /* - * TODO: Disable interrupts, floating point etc. - * Maybe flush cache and tlb + * NO OUTPUT ALLOWED UNTIL FURTHER NOTICE. */ + ia64_set_fpsr(IA64_FPSR_DEFAULT); /* - * TODO: Get critical system information (if possible, from the - * information provided by the boot program). + * Region 6 is direct mapped UC and region 7 is direct mapped + * WC. The details of this is controlled by the Alt {I,D}TLB + * handlers. Here we just make sure that they have the largest + * possible page size to minimise TLB usage. */ + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_srlz_d(); + + /* Initialize/setup physical memory datastructures */ + ia64_physmem_init(); /* - * Look for the I/O ports first - we need them for console - * probing. + * Process the memory map. This gives us the PAL locations, + * the I/O port base address, the available memory regions + * for initializing the physical memory map. */ for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { + mdlen = md->md_pages * EFI_PAGE_SIZE; switch (md->md_type) { case EFI_MD_TYPE_IOPORT: ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, - md->md_pages * EFI_PAGE_SIZE); + mdlen); break; case EFI_MD_TYPE_PALCODE: - ia64_pal_size = md->md_pages * EFI_PAGE_SIZE; ia64_pal_base = md->md_phys; + ia64_pal_size = mdlen; + /*FALLTHROUGH*/ + case EFI_MD_TYPE_BAD: + case EFI_MD_TYPE_FIRMWARE: + case EFI_MD_TYPE_RECLAIM: + case EFI_MD_TYPE_RT_CODE: + case EFI_MD_TYPE_RT_DATA: + /* Don't use these memory regions. */ + ia64_physmem_track(md->md_phys, mdlen); + break; + case EFI_MD_TYPE_BS_CODE: + case EFI_MD_TYPE_BS_DATA: + case EFI_MD_TYPE_CODE: + case EFI_MD_TYPE_DATA: + case EFI_MD_TYPE_FREE: + /* These are ok to use. */ + ia64_physmem_add(md->md_phys, mdlen); break; } } + /* + * Remove the PBVM and its page table from phys_avail. The loader + * passes the physical address of the page table to us. The virtual + * address of the page table is fixed. + * Track and the PBVM limit for later use. + */ + ia64_physmem_delete(bootinfo->bi_pbvm_pgtbl, bootinfo->bi_pbvm_pgtblsz); + pbvm_pgtbl_ent = (void *)IA64_PBVM_PGTBL; + pbvm_pgtbl_lim = (void *)(IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz); + while (pbvm_pgtbl_ent < pbvm_pgtbl_lim) { + if ((*pbvm_pgtbl_ent & PTE_PRESENT) == 0) + break; + ia64_physmem_delete(*pbvm_pgtbl_ent & PTE_PPN_MASK, + IA64_PBVM_PAGE_SIZE); + pbvm_pgtbl_ent++; + } + + /* Finalize physical memory datastructures */ + ia64_physmem_fini(); + metadata_missing = 0; if (bootinfo->bi_modulep) preload_metadata = (caddr_t)bootinfo->bi_modulep; @@ -773,9 +789,8 @@ ia64_init(void) bootverbose = 1; /* - * Find the beginning and end of the kernel. + * Find the end of the kernel. */ - kernstart = trunc_page(kernel_text); #ifdef DDB ksym_start = bootinfo->bi_symtab; ksym_end = bootinfo->bi_esymtab; @@ -788,16 +803,6 @@ ia64_init(void) kernend = round_page(bootinfo->bi_kernend); /* - * Region 6 is direct mapped UC and region 7 is direct mapped - * WC. The details of this is controlled by the Alt {I,D}TLB - * handlers. Here we just make sure that they have the largest - * possible page size to minimise TLB usage. - */ - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); - ia64_srlz_d(); - - /* * Wire things up so we can call the firmware. */ map_pal_code(); @@ -844,92 +849,6 @@ ia64_init(void) freeenv(p); } - kernstartpfn = atop(IA64_RR_MASK(kernstart)); - kernendpfn = atop(IA64_RR_MASK(kernend)); - - /* - * Size the memory regions and load phys_avail[] with the results. - */ - - /* - * Find out how much memory is available, by looking at - * the memory descriptors. - */ - -#ifdef DEBUG_MD - printf("Memory descriptor count: %d\n", mdcount); -#endif - - phys_avail_cnt = 0; - for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { -#ifdef DEBUG_MD - printf("MD %p: type %d pa 0x%lx cnt 0x%lx\n", md, - md->md_type, md->md_phys, md->md_pages); -#endif - - pfn0 = ia64_btop(round_page(md->md_phys)); - pfn1 = ia64_btop(trunc_page(md->md_phys + md->md_pages * 4096)); - if (pfn1 <= pfn0) - continue; - - if (md->md_type != EFI_MD_TYPE_FREE) - continue; - - /* - * We have a memory descriptor that describes conventional - * memory that is for general use. We must determine if the - * loader has put the kernel in this region. - */ - physmem += (pfn1 - pfn0); - if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) { - /* - * Must compute the location of the kernel - * within the segment. - */ -#ifdef DEBUG_MD - printf("Descriptor %p contains kernel\n", mp); -#endif - if (pfn0 < kernstartpfn) { - /* - * There is a chunk before the kernel. - */ -#ifdef DEBUG_MD - printf("Loading chunk before kernel: " - "0x%lx / 0x%lx\n", pfn0, kernstartpfn); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(pfn0); - phys_avail[phys_avail_cnt+1] = ia64_ptob(kernstartpfn); - phys_avail_cnt += 2; - } - if (kernendpfn < pfn1) { - /* - * There is a chunk after the kernel. - */ -#ifdef DEBUG_MD - printf("Loading chunk after kernel: " - "0x%lx / 0x%lx\n", kernendpfn, pfn1); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(kernendpfn); - phys_avail[phys_avail_cnt+1] = ia64_ptob(pfn1); - phys_avail_cnt += 2; - } - } else { - /* - * Just load this cluster as one chunk. - */ -#ifdef DEBUG_MD - printf("Loading descriptor %d: 0x%lx / 0x%lx\n", i, - pfn0, pfn1); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(pfn0); - phys_avail[phys_avail_cnt+1] = ia64_ptob(pfn1); - phys_avail_cnt += 2; - - } - } - phys_avail[phys_avail_cnt] = 0; - - Maxmem = physmem; init_param2(physmem); /* Copied: stable/9/sys/ia64/ia64/physmem.c (from r238184, head/sys/ia64/ia64/physmem.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/ia64/ia64/physmem.c Tue Jun 18 21:14:05 2013 (r251962, copy of r238184, head/sys/ia64/ia64/physmem.c) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +static u_int phys_avail_segs; + +vm_paddr_t phys_avail[2 * VM_PHYSSEG_MAX + 2]; + +vm_paddr_t paddr_max; + +long realmem; + +static u_int +ia64_physmem_find(vm_paddr_t base, vm_paddr_t lim) +{ + u_int idx; + + for (idx = 0; phys_avail[idx + 1] != 0; idx += 2) { + if (phys_avail[idx] >= lim || + phys_avail[idx + 1] > base) + break; + } + return (idx); +} + +static int +ia64_physmem_insert(u_int idx, vm_paddr_t base, vm_paddr_t lim) +{ + u_int ridx; + + if (phys_avail_segs == VM_PHYSSEG_MAX) + return (ENOMEM); + + ridx = phys_avail_segs * 2; + while (idx < ridx) { + phys_avail[ridx + 1] = phys_avail[ridx - 1]; + phys_avail[ridx] = phys_avail[ridx - 2]; + ridx -= 2; + } + phys_avail[idx] = base; + phys_avail[idx + 1] = lim; + phys_avail_segs++; + return (0); +} + +static int +ia64_physmem_remove(u_int idx) +{ + + if (phys_avail_segs == 0) + return (ENOENT); + do { + phys_avail[idx] = phys_avail[idx + 2]; + phys_avail[idx + 1] = phys_avail[idx + 3]; + idx += 2; + } while (phys_avail[idx + 1] != 0); + phys_avail_segs--; + return (0); +} + +int +ia64_physmem_add(vm_paddr_t base, vm_size_t len) +{ + vm_paddr_t lim; + u_int idx; + + realmem += len; + + lim = base + len; + idx = ia64_physmem_find(base, lim); + if (phys_avail[idx] == lim) { + phys_avail[idx] = base; + return (0); + } + if (idx > 0 && phys_avail[idx - 1] == base) { + phys_avail[idx - 1] = lim; + return (0); + } + return (ia64_physmem_insert(idx, base, lim)); +} + +int +ia64_physmem_delete(vm_paddr_t base, vm_size_t len) +{ + vm_paddr_t lim; + u_int idx; + + lim = base + len; + idx = ia64_physmem_find(base, lim); + if (phys_avail[idx] >= lim || phys_avail[idx + 1] == 0) + return (ENOENT); + if (phys_avail[idx] < base && phys_avail[idx + 1] > lim) { + len = phys_avail[idx + 1] - lim; + phys_avail[idx + 1] = base; + base = lim; + lim = base + len; + return (ia64_physmem_insert(idx + 2, base, lim)); + } else { + if (phys_avail[idx] == base) + phys_avail[idx] = lim; + if (phys_avail[idx + 1] == lim) + phys_avail[idx + 1] = base; + if (phys_avail[idx] >= phys_avail[idx + 1]) + return (ia64_physmem_remove(idx)); + } + return (0); +} + +int +ia64_physmem_fini(void) +{ + vm_paddr_t base, lim, size; + u_int idx; + + idx = 0; + while (phys_avail[idx + 1] != 0) { + base = round_page(phys_avail[idx]); + lim = trunc_page(phys_avail[idx + 1]); + if (base < lim) { + phys_avail[idx] = base; + phys_avail[idx + 1] = lim; + size = lim - base; + physmem += atop(size); + paddr_max = lim; + idx += 2; + } else + ia64_physmem_remove(idx); + } + + /* + * Round realmem to a multple of 128MB. Hopefully that compensates + * for any loss of DRAM that isn't accounted for in the memory map. + * I'm thinking legacy BIOS or VGA here. In any case, it's ok if + * we got it wrong, because we don't actually use realmem. It's + * just for show... + */ + size = 1U << 27; + realmem = (realmem + size - 1) & ~(size - 1); + realmem = atop(realmem); + return (0); +} + +int +ia64_physmem_init(void) +{ + + /* Nothing to do just yet. */ + return (0); +} + +int +ia64_physmem_track(vm_paddr_t base, vm_size_t len) +{ + + realmem += len; + return (0); +} + +vm_paddr_t +ia64_physmem_alloc(vm_size_t len, vm_size_t align) +{ + + return (0); +} Modified: stable/9/sys/ia64/include/md_var.h ============================================================================== --- stable/9/sys/ia64/include/md_var.h Tue Jun 18 20:19:09 2013 (r251961) +++ stable/9/sys/ia64/include/md_var.h Tue Jun 18 21:14:05 2013 (r251962) @@ -73,8 +73,7 @@ struct ia64_init_return { }; extern uint64_t ia64_lapic_addr; - -extern long Maxmem; +extern vm_paddr_t paddr_max; extern u_int busdma_swi_pending; void *acpi_find_table(const char *sig); @@ -93,6 +92,12 @@ int ia64_highfp_save(struct thread *); int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); u_int ia64_itc_freq(void); +int ia64_physmem_add(vm_paddr_t, vm_size_t); +vm_paddr_t ia64_physmem_alloc(vm_size_t, vm_size_t); +int ia64_physmem_delete(vm_paddr_t, vm_size_t); +int ia64_physmem_fini(void); +int ia64_physmem_init(void); +int ia64_physmem_track(vm_paddr_t, vm_size_t); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); void interrupt(struct trapframe *); Modified: stable/9/sys/ia64/include/param.h ============================================================================== --- stable/9/sys/ia64/include/param.h Tue Jun 18 20:19:09 2013 (r251961) +++ stable/9/sys/ia64/include/param.h Tue Jun 18 21:14:05 2013 (r251962) @@ -110,9 +110,6 @@ #define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) -#define ia64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ia64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) - #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) #endif /* !_IA64_INCLUDE_PARAM_H_ */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 21:24:09 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 32593AEF; Tue, 18 Jun 2013 21:24:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 102581478; Tue, 18 Jun 2013 21:24: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 r5ILO86t019234; Tue, 18 Jun 2013 21:24:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5ILO8rd019226; Tue, 18 Jun 2013 21:24:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306182124.r5ILO8rd019226@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 21:24:08 +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: r251963 - in stable/9/sys/ia64: ia64 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 21:24:09 -0000 Author: marius Date: Tue Jun 18 21:24:07 2013 New Revision: 251963 URL: http://svnweb.freebsd.org/changeset/base/251963 Log: MFC: r238190 Implement ia64_physmem_alloc() and use it consistently to get memory before VM has been initialized. Modified: stable/9/sys/ia64/ia64/machdep.c stable/9/sys/ia64/ia64/physmem.c stable/9/sys/ia64/ia64/pmap.c stable/9/sys/ia64/include/md_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ia64/ia64/machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/machdep.c Tue Jun 18 21:14:05 2013 (r251962) +++ stable/9/sys/ia64/ia64/machdep.c Tue Jun 18 21:24:07 2013 (r251963) @@ -691,7 +691,6 @@ ia64_init(void) struct efi_md *md; pt_entry_t *pbvm_pgtbl_ent, *pbvm_pgtbl_lim; char *p; - vm_offset_t kernend; vm_size_t mdlen; int metadata_missing; @@ -789,20 +788,6 @@ ia64_init(void) bootverbose = 1; /* - * Find the end of the kernel. - */ -#ifdef DDB - ksym_start = bootinfo->bi_symtab; - ksym_end = bootinfo->bi_esymtab; - kernend = (vm_offset_t)round_page(ksym_end); -#else - kernend = (vm_offset_t)round_page(_end); -#endif - /* But if the bootstrap tells us otherwise, believe it! */ - if (bootinfo->bi_kernend) - kernend = round_page(bootinfo->bi_kernend); - - /* * Wire things up so we can call the firmware. */ map_pal_code(); @@ -821,9 +806,8 @@ ia64_init(void) pcpup = &pcpu0; ia64_set_k4((u_int64_t)pcpup); pcpu_init(pcpup, 0, sizeof(pcpu0)); - dpcpu_init((void *)kernend, 0); + dpcpu_init(ia64_physmem_alloc(DPCPU_SIZE, PAGE_SIZE), 0); PCPU_SET(md.lid, ia64_get_lid()); - kernend += DPCPU_SIZE; PCPU_SET(curthread, &thread0); /* @@ -854,14 +838,15 @@ ia64_init(void) /* * Initialize error message buffer (at end of core). */ - msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufp = ia64_physmem_alloc(msgbufsize, PAGE_SIZE); msgbufinit(msgbufp, msgbufsize); proc_linkup0(&proc0, &thread0); /* * Init mapping for kernel stack for proc 0 */ - thread0.td_kstack = pmap_steal_memory(KSTACK_PAGES * PAGE_SIZE); + p = ia64_physmem_alloc(KSTACK_PAGES * PAGE_SIZE, PAGE_SIZE); + thread0.td_kstack = (uintptr_t)p; thread0.td_kstack_pages = KSTACK_PAGES; mutex_init(); @@ -887,6 +872,11 @@ ia64_init(void) /* * Initialize debuggers, and break into them if appropriate. */ +#ifdef DDB + ksym_start = bootinfo->bi_symtab; + ksym_end = bootinfo->bi_esymtab; +#endif + kdb_init(); #ifdef KDB Modified: stable/9/sys/ia64/ia64/physmem.c ============================================================================== --- stable/9/sys/ia64/ia64/physmem.c Tue Jun 18 21:14:05 2013 (r251962) +++ stable/9/sys/ia64/ia64/physmem.c Tue Jun 18 21:24:07 2013 (r251963) @@ -187,9 +187,72 @@ ia64_physmem_track(vm_paddr_t base, vm_s return (0); } -vm_paddr_t +void * ia64_physmem_alloc(vm_size_t len, vm_size_t align) { + vm_paddr_t base, lim, pa; + void *ptr; + u_int idx; - return (0); + if (phys_avail_segs == 0) + return (NULL); + + len = round_page(len); + + /* + * Try and allocate with least effort. + */ + idx = phys_avail_segs * 2; + while (idx > 0) { + idx -= 2; + base = phys_avail[idx]; + lim = phys_avail[idx + 1]; + + if (lim - base < len) + continue; + + /* First try from the end. */ + pa = lim - len; + if ((pa & (align - 1)) == 0) { + if (pa == base) + ia64_physmem_remove(idx); + else + phys_avail[idx + 1] = pa; + goto gotit; + } + + /* Try from the start next. */ + pa = base; + if ((pa & (align - 1)) == 0) { + if (pa + len == lim) + ia64_physmem_remove(idx); + else + phys_avail[idx] += len; + goto gotit; + } + } + + /* + * Find a good segment and split it up. + */ + idx = phys_avail_segs * 2; + while (idx > 0) { + idx -= 2; + base = phys_avail[idx]; + lim = phys_avail[idx + 1]; + + pa = (base + align - 1) & ~(align - 1); + if (pa + len <= lim) { + ia64_physmem_delete(pa, len); + goto gotit; + } + } + + /* Out of luck. */ + return (NULL); + + gotit: + ptr = (void *)IA64_PHYS_TO_RR7(pa); + bzero(ptr, len); + return (ptr); } Modified: stable/9/sys/ia64/ia64/pmap.c ============================================================================== --- stable/9/sys/ia64/ia64/pmap.c Tue Jun 18 21:14:05 2013 (r251962) +++ stable/9/sys/ia64/ia64/pmap.c Tue Jun 18 21:24:07 2013 (r251963) @@ -244,36 +244,6 @@ static int pmap_remove_vhpt(vm_offset_t static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); -vm_offset_t -pmap_steal_memory(vm_size_t size) -{ - vm_size_t bank_size; - vm_offset_t pa, va; - - size = round_page(size); - - bank_size = phys_avail[1] - phys_avail[0]; - while (size > bank_size) { - int i; - for (i = 0; phys_avail[i+2]; i+= 2) { - phys_avail[i] = phys_avail[i+2]; - phys_avail[i+1] = phys_avail[i+3]; - } - phys_avail[i] = 0; - phys_avail[i+1] = 0; - if (!phys_avail[0]) - panic("pmap_steal_memory: out of memory"); - bank_size = phys_avail[1] - phys_avail[0]; - } - - pa = phys_avail[0]; - phys_avail[0] += size; - - va = IA64_PHYS_TO_RR7(pa); - bzero((caddr_t) va, size); - return va; -} - static void pmap_initialize_vhpt(vm_offset_t vhpt) { @@ -317,7 +287,7 @@ pmap_bootstrap() struct ia64_pal_result res; vm_offset_t base; size_t size; - int i, j, count, ridbits; + int i, ridbits; /* * Query the PAL Code to find the loop parameters for the @@ -379,7 +349,7 @@ pmap_bootstrap() pmap_ridmax = (1 << ridbits); pmap_ridmapsz = pmap_ridmax / 64; - pmap_ridmap = (uint64_t *)pmap_steal_memory(pmap_ridmax / 8); + pmap_ridmap = ia64_physmem_alloc(pmap_ridmax / 8, PAGE_SIZE); pmap_ridmap[0] |= 0xff; pmap_rididx = 0; pmap_ridcount = 8; @@ -388,14 +358,10 @@ pmap_bootstrap() /* * Allocate some memory for initial kernel 'page tables'. */ - ia64_kptdir = (void *)pmap_steal_memory(PAGE_SIZE); + ia64_kptdir = ia64_physmem_alloc(PAGE_SIZE, PAGE_SIZE); nkpt = 0; kernel_vm_end = VM_MIN_KERNEL_ADDRESS; - for (i = 0; phys_avail[i+2]; i+= 2) - ; - count = i+2; - /* * Determine a valid (mappable) VHPT size. */ @@ -409,35 +375,18 @@ pmap_bootstrap() if (pmap_vhpt_log2size & 1) pmap_vhpt_log2size--; - base = 0; size = 1UL << pmap_vhpt_log2size; - for (i = 0; i < count; i += 2) { - base = (phys_avail[i] + size - 1) & ~(size - 1); - if (base + size <= phys_avail[i+1]) - break; - } - if (!phys_avail[i]) + base = (uintptr_t)ia64_physmem_alloc(size, size); + if (base == 0) panic("Unable to allocate VHPT"); - if (base != phys_avail[i]) { - /* Split this region. */ - for (j = count; j > i; j -= 2) { - phys_avail[j] = phys_avail[j-2]; - phys_avail[j+1] = phys_avail[j-2+1]; - } - phys_avail[i+1] = base; - phys_avail[i+2] = base + size; - } else - phys_avail[i] = base + size; - - base = IA64_PHYS_TO_RR7(base); PCPU_SET(md.vhpt, base); if (bootverbose) printf("VHPT: address=%#lx, size=%#lx\n", base, size); pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); - pmap_vhpt_bucket = (void *)pmap_steal_memory(pmap_vhpt_nbuckets * - sizeof(struct ia64_bucket)); + pmap_vhpt_bucket = ia64_physmem_alloc(pmap_vhpt_nbuckets * + sizeof(struct ia64_bucket), PAGE_SIZE); for (i = 0; i < pmap_vhpt_nbuckets; i++) { /* Stolen memory is zeroed. */ mtx_init(&pmap_vhpt_bucket[i].mutex, "VHPT bucket lock", NULL, Modified: stable/9/sys/ia64/include/md_var.h ============================================================================== --- stable/9/sys/ia64/include/md_var.h Tue Jun 18 21:14:05 2013 (r251962) +++ stable/9/sys/ia64/include/md_var.h Tue Jun 18 21:24:07 2013 (r251963) @@ -93,7 +93,7 @@ int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); u_int ia64_itc_freq(void); int ia64_physmem_add(vm_paddr_t, vm_size_t); -vm_paddr_t ia64_physmem_alloc(vm_size_t, vm_size_t); +void *ia64_physmem_alloc(vm_size_t, vm_size_t); int ia64_physmem_delete(vm_paddr_t, vm_size_t); int ia64_physmem_fini(void); int ia64_physmem_init(void); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 22:22:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6D45DC04; Tue, 18 Jun 2013 22:22:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45BCE1821; Tue, 18 Jun 2013 22: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 r5IMM0SJ038752; Tue, 18 Jun 2013 22:22:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5IMM0Zl038751; Tue, 18 Jun 2013 22:22:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306182222.r5IMM0Zl038751@svn.freebsd.org> From: Marius Strobl Date: Tue, 18 Jun 2013 22:22: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: r251971 - stable/9/sys/dev/bce X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 22:22:00 -0000 Author: marius Date: Tue Jun 18 22:21:59 2013 New Revision: 251971 URL: http://svnweb.freebsd.org/changeset/base/251971 Log: Now that r251221 has been MFC'ed to stable/9 in r251939, merge the remainder of r251146 previously partially MFC'ed in r251573: In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9). Modified: stable/9/sys/dev/bce/if_bce.c Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Tue Jun 18 22:21:59 2013 (r251970) +++ stable/9/sys/dev/bce/if_bce.c Tue Jun 18 22:21:59 2013 (r251971) @@ -5466,10 +5466,10 @@ bce_get_rx_buf_exit: static int bce_get_pg_buf(struct bce_softc *sc, u16 prod, u16 prod_idx) { - bus_addr_t busaddr; + bus_dma_segment_t segs[1]; struct mbuf *m_new = NULL; struct rx_bd *pgbd; - int error, rc = 0; + int error, nsegs, rc = 0; #ifdef BCE_DEBUG u16 debug_prod_idx = prod_idx; #endif @@ -5512,12 +5512,11 @@ bce_get_pg_buf(struct bce_softc *sc, u16 /* ToDo: Consider calling m_fragment() to test error handling. */ /* Map the mbuf cluster into device memory. */ - error = bus_dmamap_load(sc->pg_mbuf_tag, sc->pg_mbuf_map[prod_idx], - mtod(m_new, void *), MCLBYTES, bce_dma_map_addr, &busaddr, - BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->pg_mbuf_tag, + sc->pg_mbuf_map[prod_idx], m_new, segs, &nsegs, BUS_DMA_NOWAIT); /* Handle any mapping errors. */ - if (error || busaddr == 0) { + if (error) { BCE_PRINTF("%s(%d): Error mapping mbuf into page chain!\n", __FILE__, __LINE__); @@ -5528,6 +5527,10 @@ bce_get_pg_buf(struct bce_softc *sc, u16 goto bce_get_pg_buf_exit; } + /* All mbufs must map to a single segment. */ + KASSERT(nsegs == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nsegs)); + /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREREAD) here? */ /* @@ -5536,8 +5539,8 @@ bce_get_pg_buf(struct bce_softc *sc, u16 */ pgbd = &sc->pg_bd_chain[PG_PAGE(prod_idx)][PG_IDX(prod_idx)]; - pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(busaddr)); - pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(busaddr)); + pgbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[0].ds_addr)); + pgbd->rx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[0].ds_addr)); pgbd->rx_bd_len = htole32(MCLBYTES); pgbd->rx_bd_flags = htole32(RX_BD_FLAGS_START | RX_BD_FLAGS_END); From owner-svn-src-stable-9@FreeBSD.ORG Tue Jun 18 23:14:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C46B5C88; Tue, 18 Jun 2013 23:14:22 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5FA119E5; Tue, 18 Jun 2013 23:14: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 r5INEMMR056037; Tue, 18 Jun 2013 23:14:22 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5INELKj056032; Tue, 18 Jun 2013 23:14:21 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201306182314.r5INELKj056032@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 18 Jun 2013 23:14: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: r251973 - in stable/9/sys: dev/xen/blkfront dev/xen/netfront xen/xenbus xen/xenstore X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2013 23:14:22 -0000 Author: gibbs Date: Tue Jun 18 23:14:21 2013 New Revision: 251973 URL: http://svnweb.freebsd.org/changeset/base/251973 Log: MFC Xen fixes: svn rev 250081 Author:gibbs Date:2013-04-29T23:08:13.552620Z ============== xenstore/xenstore.c: Prevent access to invalid memory region when listing an empty directory in the XenStore. Reported by: Bei Guan svn rev 250913 Author:gibbs Date:2013-05-22T17:13:03.545339Z ============== Correct panic on detach of Xen PV network interfaces. dev/xen/netfront: In netif_free(), properly stop the interface and drain any pending timers prior to disconnecting from the backend device. Remove all media and detach our interface object from the system prior to deleting it. PR: kern/176471 Submitted by: Roger Pau Monne Reviewed by: gibbs svn rev 250917 Author:gibbs Date:2013-05-22T19:22:44.923351Z ============== Fix loss of the emulated keyboard on Xen PV HVM domains. xen/xenbus/xenbusb.c: In xenbusb_probe_children(), do not modify the XenBus state of devices for which we have no PV driver support. An emulated device we do support may share this backend. Hide the node from XenBus instead. This prevents closing the vkbd device, which Qemu's emulated keyboard device is using as the source for keyboard events. Tested with qemu-xen-traditional, qemu-xen and qemu stubdomains, all working as expected. Submitted by: Roger Pau Monne Reviewed by: gibbs MFC after: 1 week svn rev 251175 Author:gibbs Date:2013-05-31T04:43:19.944993Z ============== Apply the ad* => ada* IDE device name transition to the Xen block front driver. Submitted by: Bei Guan Reviewed by: gibbs MFC after: 1 week svn rev 251176 Author:gibbs Date:2013-05-31T04:45:59.563195Z ============== Make netif_free() safe to call on a partially initialized softc. Sponsored by: Spectra Logic Corporation MFC after: 1 week svn rev 251729 Author:gibbs Date:2013-06-14T03:31:11.033200Z ============== sys/dev/xen/netfront/netfront.c: In netif_free(), call ifmedia_removeall() after ether_ifdetach() so that bpf listeners are detached, any link state processing is completed, and there is no chance for external reference to media information. Suggested by: yongari Modified: stable/9/sys/dev/xen/blkfront/blkfront.c stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/xen/xenbus/xenbusb.c stable/9/sys/xen/xenstore/xenstore.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Tue Jun 18 23:11:36 2013 (r251972) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Tue Jun 18 23:14:21 2013 (r251973) @@ -148,16 +148,16 @@ blkfront_vdevice_to_unit(uint32_t vdevic int base; const char *name; } info[] = { - {3, 6, 0, "ad"}, /* ide0 */ - {22, 6, 2, "ad"}, /* ide1 */ - {33, 6, 4, "ad"}, /* ide2 */ - {34, 6, 6, "ad"}, /* ide3 */ - {56, 6, 8, "ad"}, /* ide4 */ - {57, 6, 10, "ad"}, /* ide5 */ - {88, 6, 12, "ad"}, /* ide6 */ - {89, 6, 14, "ad"}, /* ide7 */ - {90, 6, 16, "ad"}, /* ide8 */ - {91, 6, 18, "ad"}, /* ide9 */ + {3, 6, 0, "ada"}, /* ide0 */ + {22, 6, 2, "ada"}, /* ide1 */ + {33, 6, 4, "ada"}, /* ide2 */ + {34, 6, 6, "ada"}, /* ide3 */ + {56, 6, 8, "ada"}, /* ide4 */ + {57, 6, 10, "ada"}, /* ide5 */ + {88, 6, 12, "ada"}, /* ide6 */ + {89, 6, 14, "ada"}, /* ide7 */ + {90, 6, 16, "ada"}, /* ide8 */ + {91, 6, 18, "ada"}, /* ide9 */ {8, 4, 0, "da"}, /* scsi disk0 */ {65, 4, 16, "da"}, /* scsi disk1 */ Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Tue Jun 18 23:11:36 2013 (r251972) +++ stable/9/sys/dev/xen/netfront/netfront.c Tue Jun 18 23:14:21 2013 (r251973) @@ -2172,10 +2172,17 @@ netfront_detach(device_t dev) static void netif_free(struct netfront_info *info) { + XN_LOCK(info); + xn_stop(info); + XN_UNLOCK(info); + callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); -#if 0 - close_netdev(info); -#endif + if (info->xn_ifp != NULL) { + ether_ifdetach(info->xn_ifp); + if_free(info->xn_ifp); + info->xn_ifp = NULL; + } + ifmedia_removeall(&info->sc_media); } static void Modified: stable/9/sys/xen/xenbus/xenbusb.c ============================================================================== --- stable/9/sys/xen/xenbus/xenbusb.c Tue Jun 18 23:11:36 2013 (r251972) +++ stable/9/sys/xen/xenbus/xenbusb.c Tue Jun 18 23:14:21 2013 (r251973) @@ -404,6 +404,31 @@ xenbusb_device_sysctl_init(device_t dev) } /** + * \brief Decrement the number of XenBus child devices in the + * connecting state by one and release the xbs_attch_ch + * interrupt configuration hook if the connecting count + * drops to zero. + * + * \param xbs XenBus Bus device softc of the owner of the bus to enumerate. + */ +static void +xenbusb_release_confighook(struct xenbusb_softc *xbs) +{ + mtx_lock(&xbs->xbs_lock); + KASSERT(xbs->xbs_connecting_children > 0, + ("Connecting device count error\n")); + xbs->xbs_connecting_children--; + if (xbs->xbs_connecting_children == 0 + && (xbs->xbs_flags & XBS_ATTACH_CH_ACTIVE) != 0) { + xbs->xbs_flags &= ~XBS_ATTACH_CH_ACTIVE; + mtx_unlock(&xbs->xbs_lock); + config_intrhook_disestablish(&xbs->xbs_attach_ch); + } else { + mtx_unlock(&xbs->xbs_lock); + } +} + +/** * \brief Verify the existance of attached device instances and perform * probe/attach processing for newly arrived devices. * @@ -417,7 +442,7 @@ xenbusb_probe_children(device_t dev) { device_t *kids; struct xenbus_device_ivars *ivars; - int i, count; + int i, count, error; if (device_get_children(dev, &kids, &count) == 0) { for (i = 0; i < count; i++) { @@ -430,7 +455,30 @@ xenbusb_probe_children(device_t dev) continue; } - if (device_probe_and_attach(kids[i])) { + error = device_probe_and_attach(kids[i]); + if (error == ENXIO) { + struct xenbusb_softc *xbs; + + /* + * We don't have a PV driver for this device. + * However, an emulated device we do support + * may share this backend. Hide the node from + * XenBus until the next rescan, but leave it's + * state unchanged so we don't inadvertently + * prevent attachment of any emulated device. + */ + xenbusb_delete_child(dev, kids[i]); + + /* + * Since the XenStore state of this device + * still indicates a pending attach, manually + * release it's hold on the boot process. + */ + xbs = device_get_softc(dev); + xenbusb_release_confighook(xbs); + + continue; + } else if (error) { /* * Transition device to the closed state * so the world knows that attachment will @@ -579,31 +627,6 @@ xenbusb_nop_confighook_cb(void *arg __un { } -/** - * \brief Decrement the number of XenBus child devices in the - * connecting state by one and release the xbs_attch_ch - * interrupt configuration hook if the connecting count - * drops to zero. - * - * \param xbs XenBus Bus device softc of the owner of the bus to enumerate. - */ -static void -xenbusb_release_confighook(struct xenbusb_softc *xbs) -{ - mtx_lock(&xbs->xbs_lock); - KASSERT(xbs->xbs_connecting_children > 0, - ("Connecting device count error\n")); - xbs->xbs_connecting_children--; - if (xbs->xbs_connecting_children == 0 - && (xbs->xbs_flags & XBS_ATTACH_CH_ACTIVE) != 0) { - xbs->xbs_flags &= ~XBS_ATTACH_CH_ACTIVE; - mtx_unlock(&xbs->xbs_lock); - config_intrhook_disestablish(&xbs->xbs_attach_ch); - } else { - mtx_unlock(&xbs->xbs_lock); - } -} - /*--------------------------- Public Functions -------------------------------*/ /*--------- API comments for these methods can be found in xenbusb.h ---------*/ void Modified: stable/9/sys/xen/xenstore/xenstore.c ============================================================================== --- stable/9/sys/xen/xenstore/xenstore.c Tue Jun 18 23:11:36 2013 (r251972) +++ stable/9/sys/xen/xenstore/xenstore.c Tue Jun 18 23:14:21 2013 (r251973) @@ -307,7 +307,8 @@ split(char *strings, u_int len, u_int *n const char **ret; /* Protect against unterminated buffers. */ - strings[len - 1] = '\0'; + if (len > 0) + strings[len - 1] = '\0'; /* Count the strings. */ *num = extract_strings(strings, /*dest*/NULL, len); From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 01:14:54 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 88C055F1; Wed, 19 Jun 2013 01:14:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id 5D58C1F9F; Wed, 19 Jun 2013 01:14:54 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id D34A323F840; Tue, 18 Jun 2013 21:14:52 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us D34A323F840 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 18 Jun 2013 21:14:50 -0400 From: Glen Barber To: Scott Long Subject: Re: svn commit: r251874 - in stable/9/sys: arm/arm cam cam/ctl cam/scsi conf dev/aac dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/aic7xxx dev/amr dev/arcmsr dev/ata dev/buslogic dev/ciss dev/dpt d... Message-ID: <20130619011450.GA1876@glenbarber.us> References: <201306180036.r5I0askx009647@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <201306180036.r5I0askx009647@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 01:14:54 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2013 at 12:36:54AM +0000, Scott Long wrote: > Author: scottl > Date: Tue Jun 18 00:36:53 2013 > New Revision: 251874 > URL: http://svnweb.freebsd.org/changeset/base/251874 >=20 > Log: > Big MFC of the physbio changes necessary for unmapped I/O. These chang= es > have been in production at Netflix for several months with significant > success. > =20 I think this breaks stable/9. cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D15000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding -Werror /src/sys/ia64/ia32/ia32_trap.c cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D15000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding -Werror /src/sys/ia64/ia64/autoconf.c cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D15000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding -Werror /src/sys/ia64/ia64/bus_machdep.c cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D15000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding -Werror /src/sys/ia64/ia64/busdma_machdep.c /src/sys/ia64/ia64/busdma_machdep.c: In function '_bus_dmamap_count_phys': /src/sys/ia64/ia64/busdma_machdep.c:490: error: 'paddr_max' undeclared (first use in this function) /src/sys/ia64/ia64/busdma_machdep.c:490: error: (Each undeclared identifier is reported only once /src/sys/ia64/ia64/busdma_machdep.c:490: error: for each function it appears in.) *** Error code 1 Stop in /obj/ia64.ia64/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Glen --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRwQYKAAoJEFJPDDeguUajj8IH+gLGOY/dRfP5m/EmVTXXEs68 un/ankkw2MBYoe6VjO6bkvEK2suO6xssK6mkGXW+TfprjMFxl5KRFMWE0+IgQGie BFU2+uCHx6tonOS1ZxRrVevVa1WVsJ6gjb9KVZ+QEQEdyodWGQSP9S7/3pqqUX/t wr2sh1k9n8KcM+wESmXqWd7BF+e2Zfv38woyHodMa9X+LBkNz6rJecaCp1lZYzPA dW2T8Qxg5ZBiFADRrnHIjpfOYV3JPi1wYn/oNoFNL559qN4GZpmq2bxnw3KYlOz+ UbIxV78xbM5JEAGYo4dPW2ZhDyY9CYlNmk3sReQUuVa5tl6+dMrBR8YMRuZIy50= =GCr9 -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 01:55:43 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E9603CC0; Wed, 19 Jun 2013 01:55:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id BECBE10D7; Wed, 19 Jun 2013 01:55:43 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 987CF23F840; Tue, 18 Jun 2013 21:55:41 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 987CF23F840 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 18 Jun 2013 21:55:39 -0400 From: Glen Barber To: Scott Long Subject: Re: svn commit: r251874 - in stable/9/sys: arm/arm cam cam/ctl cam/scsi conf dev/aac dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/aic7xxx dev/amr dev/arcmsr dev/ata dev/buslogic dev/ciss dev/dpt d... Message-ID: <20130619015539.GB1876@glenbarber.us> References: <201306180036.r5I0askx009647@svn.freebsd.org> <20130619011450.GA1876@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dTy3Mrz/UPE2dbVg" Content-Disposition: inline In-Reply-To: <20130619011450.GA1876@glenbarber.us> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) 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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 01:55:44 -0000 --dTy3Mrz/UPE2dbVg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 18, 2013 at 09:14:50PM -0400, Glen Barber wrote: > On Tue, Jun 18, 2013 at 12:36:54AM +0000, Scott Long wrote: > > Author: scottl > > Date: Tue Jun 18 00:36:53 2013 > > New Revision: 251874 > > URL: http://svnweb.freebsd.org/changeset/base/251874 > >=20 > > Log: > > Big MFC of the physbio changes necessary for unmapped I/O. These cha= nges > > have been in production at Netflix for several months with significant > > success. > > =20 >=20 > I think this breaks stable/9. >=20 > cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 > -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq > -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D15000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin > -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding > -Werror /src/sys/ia64/ia32/ia32_trap.c > cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 > -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq > -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D15000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin > -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding > -Werror /src/sys/ia64/ia64/autoconf.c > cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 > -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq > -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D15000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin > -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding > -Werror /src/sys/ia64/ia64/bus_machdep.c > cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -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 > -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq > -I/src/sys/contrib/ia64/libuwx/src -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D15000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -fno-builtin > -mconstant-gp -ffixed-r13 -mfixed-range=3Df32-f127 -fpic -ffreestanding > -Werror /src/sys/ia64/ia64/busdma_machdep.c > /src/sys/ia64/ia64/busdma_machdep.c: In function > '_bus_dmamap_count_phys': > /src/sys/ia64/ia64/busdma_machdep.c:490: error: 'paddr_max' undeclared > (first use in this function) > /src/sys/ia64/ia64/busdma_machdep.c:490: error: (Each undeclared > identifier is reported only once > /src/sys/ia64/ia64/busdma_machdep.c:490: error: for each function it > appears in.) > *** Error code 1 >=20 > Stop in /obj/ia64.ia64/src/sys/LINT. > *** Error code 1 >=20 > Stop in /src. > *** Error code 1 >=20 Looks like this is fixed, and tinderbox is lagging behind reality. Sorry for the noise. Glen --dTy3Mrz/UPE2dbVg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRwQ+bAAoJEFJPDDeguUaj8DUH/3yrDl9xq39yKS0snJYsx3LF MXYUZS1QY9VGV/KxdKet+AGVfp9i9ZMmC+yuwX8fVTI+hhLb5f97SmstY96uaMsM /RfUXBUditGUFIfKIo9H9d8anDppdbb5LiqBuOCpo5JeliAFsMH0Ls3e+FzWiFk7 OWlhoSL20Mn6CdHqIAwT1d/dLObbwuJ2QsxSC4Ekc3Do+buKIB/P9gpiP7G+ao+v 3GyJmluBK22tNRkYgXu+31QvlCFvpfM9iM5FHp80D4MzQeyYUYMxD1QcTK8gbZnG nFur96HN1MRnZU0DsLyp+vU/sGbm5sWnVvIsMFZZ3aXawNjnCxBnQ4OlnjwPGoI= =n1O7 -----END PGP SIGNATURE----- --dTy3Mrz/UPE2dbVg-- From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 04:57:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6684EB50; Wed, 19 Jun 2013 04:57:48 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA9419A3; Wed, 19 Jun 2013 04:57: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 r5J4vmJ7064111; Wed, 19 Jun 2013 04:57:48 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5J4vm9a064110; Wed, 19 Jun 2013 04:57:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306190457.r5J4vm9a064110@svn.freebsd.org> From: Scott Long Date: Wed, 19 Jun 2013 04:57:48 +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: r251986 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 04:57:48 -0000 Author: scottl Date: Wed Jun 19 04:57:47 2013 New Revision: 251986 URL: http://svnweb.freebsd.org/changeset/base/251986 Log: Tweak the CAM_DATA flags that were added with r251874 to allow source compatibility and almost 100% binary compatibility. The old CAM_SG_LIST_PHYS flag is essentially lost in binary compatibility for legacy SIM drivers. The use of this flag is excedingly rare. Obtained from: Netflix Modified: stable/9/sys/cam/cam_ccb.h Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Wed Jun 19 04:47:41 2013 (r251985) +++ stable/9/sys/cam/cam_ccb.h Wed Jun 19 04:57:47 2013 (r251986) @@ -63,7 +63,7 @@ typedef enum { * Perform transport negotiation * with this command. */ - CAM_DATA_ISPHYS = 0x00000010,/* Data type with physical addrs */ + CAM_DATA_ISPHYS = 0x00200000,/* Data type with physical addrs */ CAM_DIS_AUTOSENSE = 0x00000020,/* Disable autosense feature */ CAM_DIR_BOTH = 0x00000000,/* Data direction (00:IN/OUT) */ CAM_DIR_IN = 0x00000040,/* Data direction (01:DATA IN) */ @@ -71,10 +71,10 @@ typedef enum { CAM_DIR_NONE = 0x000000C0,/* Data direction (11:no data) */ CAM_DIR_MASK = 0x000000C0,/* Data direction Mask */ CAM_DATA_VADDR = 0x00000000,/* Data type (000:Virtual) */ - CAM_DATA_PADDR = 0x00000010,/* Data type (001:Physical) */ - CAM_DATA_SG = 0x00040000,/* Data type (010:sglist) */ - CAM_DATA_SG_PADDR = 0x00040010,/* Data type (011:sglist phys) */ - CAM_DATA_BIO = 0x00200000,/* Data type (100:bio) */ + CAM_DATA_PADDR = 0x00200000,/* Data type (001:Physical) */ + CAM_DATA_SG = 0x00000010,/* Data type (010:sglist) */ + CAM_DATA_SG_PADDR = 0x00200010,/* Data type (011:sglist phys) */ + CAM_DATA_BIO = 0x00040000,/* Data type (100:bio) */ CAM_DATA_MASK = 0x00240010,/* Data type mask */ CAM_SOFT_RST_OP = 0x00000100,/* Use Soft reset alternative */ CAM_ENG_SYNC = 0x00000200,/* Flush resid bytes on complete */ @@ -91,6 +91,11 @@ typedef enum { CAM_CDB_PHYS = 0x00400000,/* CDB poiner is physical */ CAM_ENG_SGLIST = 0x00800000,/* SG list is for the HBA engine */ +/* Compatibility for FreeBSD 9.x*/ + CAM_SCATTER_VALID = 0x00000010,/* These exist for src compat for*/ + CAM_SG_LIST_PHYS = 0x00200010,/* old drivers. Hardly anything */ + CAM_DATA_PHYS = 0x00200000,/* uses them. */ + /* Phase cognizant mode flags */ CAM_DIS_AUTOSRP = 0x01000000,/* Disable autosave/restore ptrs */ CAM_DIS_AUTODISC = 0x02000000,/* Disable auto disconnect */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 05:02:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7D48ED07; Wed, 19 Jun 2013 05:02:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCEE19CB; Wed, 19 Jun 2013 05:02: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 r5J52Q4j066568; Wed, 19 Jun 2013 05:02:26 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5J52QmE066567; Wed, 19 Jun 2013 05:02:26 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306190502.r5J52QmE066567@svn.freebsd.org> From: Scott Long Date: Wed, 19 Jun 2013 05:02: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: r251987 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 05:02:26 -0000 Author: scottl Date: Wed Jun 19 05:02:25 2013 New Revision: 251987 URL: http://svnweb.freebsd.org/changeset/base/251987 Log: Poor man's binary compatibility of the struct bio: move the added structure members to the end of the structure. Obtained from: Netflix Modified: stable/9/sys/sys/bio.h Modified: stable/9/sys/sys/bio.h ============================================================================== --- stable/9/sys/sys/bio.h Wed Jun 19 04:57:47 2013 (r251986) +++ stable/9/sys/sys/bio.h Wed Jun 19 05:02:25 2013 (r251987) @@ -81,9 +81,6 @@ struct bio { off_t bio_offset; /* Offset into file. */ long bio_bcount; /* Valid bytes in buffer. */ caddr_t bio_data; /* Memory, superblocks, indirect etc. */ - struct vm_page **bio_ma; /* Or unmapped. */ - int bio_ma_offset; /* Offset in the first page of bio_ma. */ - int bio_ma_n; /* Number of pages in bio_ma. */ int bio_error; /* Errno for BIO_ERROR. */ long bio_resid; /* Remaining I/O in bytes. */ void (*bio_done)(struct bio *); @@ -116,6 +113,11 @@ struct bio { /* XXX: these go away when bio chaining is introduced */ daddr_t bio_pblkno; /* physical block number */ + + /* Unmapped i/o. Placed at the end in 9.x for binary compatibility. */ + struct vm_page **bio_ma; /* Physical page array. */ + int bio_ma_offset; /* Offset in first page of bio_ma. */ + int bio_ma_n; /* Number of pages in bio_ma. */ }; struct uio; From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 05:12:32 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF9FF30A; Wed, 19 Jun 2013 05:12:31 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E22711A04; Wed, 19 Jun 2013 05:12: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 r5J5CVgS069717; Wed, 19 Jun 2013 05:12:31 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5J5CVcS069716; Wed, 19 Jun 2013 05:12:31 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306190512.r5J5CVcS069716@svn.freebsd.org> From: Scott Long Date: Wed, 19 Jun 2013 05:12: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: r251990 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 05:12:32 -0000 Author: scottl Date: Wed Jun 19 05:12:31 2013 New Revision: 251990 URL: http://svnweb.freebsd.org/changeset/base/251990 Log: MFC r251989: Fix an unfortunate typo with the compat shims Obtained from: Netflix Modified: stable/9/sys/cam/cam_compat.h Modified: stable/9/sys/cam/cam_compat.h ============================================================================== --- stable/9/sys/cam/cam_compat.h Wed Jun 19 05:11:30 2013 (r251989) +++ stable/9/sys/cam/cam_compat.h Wed Jun 19 05:12:31 2013 (r251990) @@ -40,9 +40,9 @@ int cam_compat_ioctl(struct cdev *dev, u #define CAMIOCOMMAND_0x16 _IOWR(CAM_VERSION_0x16, 2, union ccb) #define CAMGETPASSTHRU_0x16 _IOWR(CAM_VERSION_0x16, 3, union ccb) -#define CAM_SCATTER_VALID_0x16 0x10 -#define CAM_SG_LIST_PHYS_0x16 0x40000 -#define CAM_DATA_PHYS_0x16 0x20000 +#define CAM_SCATTER_VALID_0x16 0x00000010 +#define CAM_SG_LIST_PHYS_0x16 0x00040000 +#define CAM_DATA_PHYS_0x16 0x00200000 #endif From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 15:12:11 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0EABCFE0; Wed, 19 Jun 2013 15:12:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00A2F1950; Wed, 19 Jun 2013 15:12: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 r5JFCA8d060869; Wed, 19 Jun 2013 15:12:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5JFCAo9060868; Wed, 19 Jun 2013 15:12:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306191512.r5JFCAo9060868@svn.freebsd.org> From: Marius Strobl Date: Wed, 19 Jun 2013 15:12: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: r251994 - stable/9/sys/dev/agp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 15:12:11 -0000 Author: marius Date: Wed Jun 19 15:12:10 2013 New Revision: 251994 URL: http://svnweb.freebsd.org/changeset/base/251994 Log: MFC: r238172 (partial) Don't use Maxmem when the amount of memory is meant. Use realmem instead. Maxmem is not only a MD variable, it represents the highest physical memory address in use. On systems where memory is sparsely layed-out the highest memory address and the amount of memory are not interchangeable. Scaling the AGP aperture based on the actual amount of memory (= realmem) rather than the available memory (= physmem) makes sure there's consistent behaviour across architectures. Modified: stable/9/sys/dev/agp/agp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/agp/agp.c ============================================================================== --- stable/9/sys/dev/agp/agp.c Wed Jun 19 13:37:29 2013 (r251993) +++ stable/9/sys/dev/agp/agp.c Wed Jun 19 15:12:10 2013 (r251994) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -235,7 +234,7 @@ agp_generic_attach(device_t dev) * Work out an upper bound for agp memory allocation. This * uses a heurisitc table from the Linux driver. */ - memsize = ptoa(Maxmem) >> 20; + memsize = ptoa(realmem) >> 20; for (i = 0; i < agp_max_size; i++) { if (memsize <= agp_max[i][0]) break; From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 18:00:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 955C5C59; Wed, 19 Jun 2013 18:00:00 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87A0E1482; Wed, 19 Jun 2013 18:00: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 r5JI00QB013423; Wed, 19 Jun 2013 18:00:00 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5JI002h013421; Wed, 19 Jun 2013 18:00:00 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201306191800.r5JI002h013421@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 19 Jun 2013 18:00: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: r251998 - stable/9/sbin/mount X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 18:00:00 -0000 Author: jh Date: Wed Jun 19 18:00:00 2013 New Revision: 251998 URL: http://svnweb.freebsd.org/changeset/base/251998 Log: MFC r251485: Revert r238399. The "failok" option doesn't have any effect at all unless specified in fstab(5) and combined with the -a flag. The "failok" option is already documented in fstab(5). PR: 177630 Modified: stable/9/sbin/mount/mount.8 Directory Properties: stable/9/sbin/mount/ (props changed) Modified: stable/9/sbin/mount/mount.8 ============================================================================== --- stable/9/sbin/mount/mount.8 Wed Jun 19 17:14:59 2013 (r251997) +++ stable/9/sbin/mount/mount.8 Wed Jun 19 18:00:00 2013 (r251998) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd July 12, 2012 +.Dd June 6, 2011 .Dt MOUNT 8 .Os .Sh NAME @@ -145,11 +145,6 @@ When used with the .Fl u flag, this is the same as specifying the options currently in effect for the mounted file system. -.It Cm failok -If this option is specified, -.Nm -will return 0 even if an error occurs -during the mount of the filesystem. .It Cm force The same as .Fl f ; From owner-svn-src-stable-9@FreeBSD.ORG Wed Jun 19 20:56:46 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 01F3ABDA; Wed, 19 Jun 2013 20:56:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E784C1E4B; Wed, 19 Jun 2013 20:56: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 r5JKujKD073972; Wed, 19 Jun 2013 20:56:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5JKuid4073966; Wed, 19 Jun 2013 20:56:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306192056.r5JKuid4073966@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 19 Jun 2013 20:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252008 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2013 20:56:46 -0000 Author: pfg Date: Wed Jun 19 20:56:44 2013 New Revision: 252008 URL: http://svnweb.freebsd.org/changeset/base/252008 Log: MFC r251658, 251823: Turn DIAGNOSTICs to INVARIANTS in ext2fs. following other filesystems. Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c stable/9/sys/fs/ext2fs/ext2_bmap.c stable/9/sys/fs/ext2fs/ext2_inode.c stable/9/sys/fs/ext2fs/ext2_lookup.c stable/9/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Wed Jun 19 20:56:44 2013 (r252008) @@ -91,7 +91,7 @@ ext2_alloc(struct inode *ip, int32_t lbn fs = ip->i_e2fs; ump = ip->i_ump; mtx_assert(EXT2_MTX(ump), MA_OWNED); -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((u_int)size > fs->e2fs_bsize || blkoff(fs, size) != 0) { vn_printf(ip->i_devvp, "bsize = %lu, size = %d, fs = %s\n", (long unsigned int)fs->e2fs_bsize, size, fs->e2fs_fsmnt); @@ -99,7 +99,7 @@ ext2_alloc(struct inode *ip, int32_t lbn } if (cred == NOCRED) panic("ext2_alloc: missing credential"); -#endif /* DIAGNOSTIC */ +#endif /* INVARIANTS */ if (size == fs->e2fs_bsize && fs->e2fs->e2fs_fbcount == 0) goto nospace; if (cred->cr_uid != 0 && @@ -183,7 +183,7 @@ ext2_reallocblks(struct vop_reallocblks_ len = buflist->bs_nchildren; start_lbn = buflist->bs_children[0]->b_lblkno; end_lbn = start_lbn + len - 1; -#ifdef DIAGNOSTIC +#ifdef INVARIANTS for (i = 1; i < len; i++) if (buflist->bs_children[i]->b_lblkno != start_lbn + i) panic("ext2_reallocblks: non-cluster"); @@ -232,7 +232,7 @@ ext2_reallocblks(struct vop_reallocblks_ if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) { ssize = len; } else { -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (start_ap[start_lvl-1].in_lbn == idp->in_lbn) panic("ext2_reallocblks: start == end"); #endif @@ -271,7 +271,7 @@ ext2_reallocblks(struct vop_reallocblks_ bap = ebap; soff = -i; } -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap)) panic("ext2_reallocblks: alloc mismatch"); #endif @@ -748,7 +748,7 @@ retry: return (0); } gotit: -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (isset(bbp, bno)) { printf("ext2fs_alloccgblk: cg=%d bno=%jd fs=%s\n", cg, (intmax_t)bno, fs->e2fs_fsmnt); Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Wed Jun 19 20:56:44 2013 (r252008) @@ -152,7 +152,7 @@ ext2_balloc(struct inode *ip, int32_t lb pref = 0; if ((error = ext2_getlbns(vp, lbn, indirs, &num)) != 0) return (error); -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (num < 1) panic ("ext2_balloc: ext2_getlbns returned indirect block"); #endif Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_bmap.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_bmap.c Wed Jun 19 20:56:44 2013 (r252008) @@ -172,7 +172,7 @@ ext2_bmaparray(struct vnode *vp, int32_t bp = getblk(vp, metalbn, bsize, 0, 0, 0); if ((bp->b_flags & B_CACHE) == 0) { -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (!daddr) panic("ext2_bmaparray: indirect block not in cache"); #endif Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Wed Jun 19 20:56:44 2013 (r252008) @@ -132,7 +132,7 @@ ext2_truncate(struct vnode *vp, off_t le if (ovp->v_type == VLNK && oip->i_size < ovp->v_mount->mnt_maxsymlinklen) { -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if (length != 0) panic("ext2_truncate: partial truncate of symlink"); #endif @@ -318,7 +318,7 @@ ext2_truncate(struct vnode *vp, off_t le } } done: -#ifdef DIAGNOSTIC +#ifdef INVARIANTS for (level = SINGLE; level <= TRIPLE; level++) if (newblks[NDADDR + level] != oip->i_ib[level]) panic("itrunc1"); @@ -330,7 +330,7 @@ done: bo->bo_clean.bv_cnt != 0)) panic("itrunc3"); BO_UNLOCK(bo); -#endif /* DIAGNOSTIC */ +#endif /* INVARIANTS */ /* * Put back the real size. */ Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Wed Jun 19 20:56:44 2013 (r252008) @@ -62,7 +62,7 @@ #include #include -#ifdef DIAGNOSTIC +#ifdef INVARIANTS static int dirchk = 1; #else static int dirchk = 0; @@ -790,7 +790,7 @@ ext2_direnter(struct inode *ip, struct v int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((cnp->cn_flags & SAVENAME) == 0) panic("ext2_direnter: missing name"); #endif Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Jun 19 20:48:34 2013 (r252007) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Jun 19 20:56:44 2013 (r252008) @@ -663,7 +663,7 @@ ext2_link(struct vop_link_args *ap) struct inode *ip; int error; -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((cnp->cn_flags & HASBUF) == 0) panic("ext2_link: no name"); #endif @@ -732,7 +732,7 @@ ext2_rename(struct vop_rename_args *ap) int error = 0; u_char namlen; -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((tcnp->cn_flags & HASBUF) == 0 || (fcnp->cn_flags & HASBUF) == 0) panic("ext2_rename: no name"); @@ -1083,7 +1083,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) struct dirtemplate dirtemplate, *dtp; int error, dmode; -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((cnp->cn_flags & HASBUF) == 0) panic("ext2_mkdir: no name"); #endif @@ -1492,7 +1492,7 @@ ext2_makeinode(int mode, struct vnode *d int error; pdir = VTOI(dvp); -#ifdef DIAGNOSTIC +#ifdef INVARIANTS if ((cnp->cn_flags & HASBUF) == 0) panic("ext2_makeinode: no name"); #endif From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 07:23:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2740F3B3; Thu, 20 Jun 2013 07:23:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 093181EE1; Thu, 20 Jun 2013 07: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 r5K7N5J6062693; Thu, 20 Jun 2013 07:23:05 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K7N4rd062682; Thu, 20 Jun 2013 07:23:04 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306200723.r5K7N4rd062682@svn.freebsd.org> From: Hiroki Sato Date: Thu, 20 Jun 2013 07:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252021 - in stable/9: sbin/ping6 sys/netinet sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 07:23:06 -0000 Author: hrs Date: Thu Jun 20 07:23:04 2013 New Revision: 252021 URL: http://svnweb.freebsd.org/changeset/base/252021 Log: MFC r250251: Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group Address. Although KAME implementation used FF02:0:0:0:0:2::/96 based on older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed in RFC 4620. The kernel always joins the /104-prefixed address, and additionally does /96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1. The default value of the sysctl is 1. ping6(8) -N flag now uses /104-prefixed one. When this flag is specified twice, it uses /96-prefixed one instead. Reviewed by: ume Based on work by: Thomas Scheffler PR: conf/174957 Modified: stable/9/sbin/ping6/ping6.8 stable/9/sbin/ping6/ping6.c stable/9/sys/netinet/icmp6.h stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/in6_ifattach.c stable/9/sys/netinet6/in6_ifattach.h stable/9/sys/netinet6/in6_proto.c Modified: stable/9/sbin/ping6/ping6.8 ============================================================================== --- stable/9/sbin/ping6/ping6.8 Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sbin/ping6/ping6.8 Thu Jun 20 07:23:04 2013 (r252021) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2010 +.Dd May 5, 2013 .Dt PING6 8 .Os .Sh NAME @@ -215,8 +215,8 @@ unicast and multicast packets. Numeric output only. No attempt will be made to lookup symbolic names from addresses in the reply. .It Fl N -Probe node information multicast group -.Pq Li ff02::2:xxxx:xxxx . +Probe node information multicast group address +.Pq Li ff02::2:ffxx:xxxx . .Ar host must be string hostname of the target (must not be a numeric IPv6 address). @@ -227,6 +227,15 @@ Since node information multicast group i outgoing interface needs to be specified by .Fl I option. +.Pp +When specified twice, the address +.Pq Li ff02::2:xxxx:xxxx +is used instead. +The former is in RFC 4620, the latter is in an old Internet Draft +draft-ietf-ipngwg-icmp-name-lookup. +Note that KAME-derived implementations including +.Fx +use the latter. .It Fl o Exit successfully after receiving one reply packet. .It Fl p Ar pattern Modified: stable/9/sbin/ping6/ping6.c ============================================================================== --- stable/9/sbin/ping6/ping6.c Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sbin/ping6/ping6.c Thu Jun 20 07:23:04 2013 (r252021) @@ -287,7 +287,7 @@ void pr_retip(struct ip6_hdr *, u_char void summary(void); void tvsub(struct timeval *, struct timeval *); int setpolicy(int, char *); -char *nigroup(char *); +char *nigroup(char *, int); void usage(void); int @@ -306,6 +306,7 @@ main(int argc, char *argv[]) struct addrinfo hints; int cc, i; int ch, hold, packlen, preload, optval, ret_ga; + int nig_oldmcprefix = -1; u_char *datap; char *e, *target, *ifname = NULL, *gateway = NULL; int ip6optlen = 0; @@ -490,6 +491,7 @@ main(int argc, char *argv[]) break; case 'N': options |= F_NIGROUP; + nig_oldmcprefix++; break; case 'o': options |= F_ONCE; @@ -605,7 +607,7 @@ main(int argc, char *argv[]) } if (options & F_NIGROUP) { - target = nigroup(argv[argc - 1]); + target = nigroup(argv[argc - 1], nig_oldmcprefix); if (target == NULL) { usage(); /*NOTREACHED*/ @@ -2721,7 +2723,7 @@ setpolicy(int so __unused, char *policy) #endif char * -nigroup(char *name) +nigroup(char *name, int nig_oldmcprefix) { char *p; char *q; @@ -2731,6 +2733,7 @@ nigroup(char *name) size_t l; char hbuf[NI_MAXHOST]; struct in6_addr in6; + int valid; p = strchr(name, '.'); if (!p) @@ -2746,7 +2749,7 @@ nigroup(char *name) *q = tolower(*(unsigned char *)q); } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ memset(&ctxt, 0, sizeof(ctxt)); MD5Init(&ctxt); c = l & 0xff; @@ -2754,9 +2757,23 @@ nigroup(char *name) MD5Update(&ctxt, (unsigned char *)name, l); MD5Final(digest, &ctxt); - if (inet_pton(AF_INET6, "ff02::2:0000:0000", &in6) != 1) + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + valid = inet_pton(AF_INET6, "ff02::2:0000:0000", &in6); + } else { + /* RFC 4620 */ + valid = inet_pton(AF_INET6, "ff02::2:ff00:0000", &in6); + } + if (valid != 1) return NULL; /*XXX*/ - bcopy(digest, &in6.s6_addr[12], 4); + + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + bcopy(digest, &in6.s6_addr[12], 4); + } else { + /* RFC 4620 */ + bcopy(digest, &in6.s6_addr[13], 3); + } if (inet_ntop(AF_INET6, &in6, hbuf, sizeof(hbuf)) == NULL) return NULL; Modified: stable/9/sys/netinet/icmp6.h ============================================================================== --- stable/9/sys/netinet/icmp6.h Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sys/netinet/icmp6.h Thu Jun 20 07:23:04 2013 (r252021) @@ -659,7 +659,8 @@ void kmod_icmp6stat_inc(int statnum); #define ICMPV6CTL_MLD_SOMAXSRC 22 #define ICMPV6CTL_MLD_VERSION 23 #define ICMPV6CTL_ND6_MAXQLEN 24 -#define ICMPV6CTL_MAXID 25 +#define ICMPV6CTL_NODEINFO_OLDMCPREFIX 25 +#define ICMPV6CTL_MAXID 26 #define RTF_PROBEMTU RTF_PROTO1 Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sys/netinet6/in6.c Thu Jun 20 07:23:04 2013 (r252021) @@ -105,6 +105,9 @@ __FBSDID("$FreeBSD$"); #include #include +VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); +#define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) + /* * Definitions of some costant IP6 addresses. */ @@ -921,6 +924,17 @@ in6_update_ifa_join_mc(struct ifnet *ifp else LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); } + if (V_icmp6_nodeinfo_oldmcprefix && + in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) { + imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, delay); + if (imm == NULL) + nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, + &mltaddr.sin6_addr), if_name(ifp), error)); + /* XXX not very fatal, go on... */ + else + LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); + } /* * Join interface-local all-nodes address. Modified: stable/9/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/9/sys/netinet6/in6_ifattach.c Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sys/netinet6/in6_ifattach.c Thu Jun 20 07:23:04 2013 (r252021) @@ -616,13 +616,16 @@ in6_ifattach_loopback(struct ifnet *ifp) /* * compute NI group address, based on the current hostname setting. - * see draft-ietf-ipngwg-icmp-name-lookup-* (04 and later). + * see RFC 4620. * * when ifp == NULL, the caller is responsible for filling scopeid. + * + * If oldmcprefix == 1, FF02:0:0:0:0:2::/96 is used for NI group address + * while it is FF02:0:0:0:0:2:FF00::/104 in RFC 4620. */ -int -in6_nigroup(struct ifnet *ifp, const char *name, int namelen, - struct in6_addr *in6) +static int +in6_nigroup0(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6, int oldmcprefix) { struct prison *pr; const char *p; @@ -667,7 +670,7 @@ in6_nigroup(struct ifnet *ifp, const cha *q = *q - 'A' + 'a'; } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ bzero(&ctxt, sizeof(ctxt)); MD5Init(&ctxt); MD5Update(&ctxt, &l, sizeof(l)); @@ -677,13 +680,36 @@ in6_nigroup(struct ifnet *ifp, const cha bzero(in6, sizeof(*in6)); in6->s6_addr16[0] = IPV6_ADDR_INT16_MLL; in6->s6_addr8[11] = 2; - bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + if (oldmcprefix == 0) { + in6->s6_addr8[12] = 0xff; + /* Copy the first 24 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr8[13], 3); + } else { + /* Copy the first 32 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + } if (in6_setscope(in6, ifp, NULL)) return (-1); /* XXX: should not fail */ return 0; } +int +in6_nigroup(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 0)); +} + +int +in6_nigroup_oldmcprefix(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 1)); +} + /* * XXX multiple loopback interface needs more care. for instance, * nodelocal address needs to be configured onto only one of them. Modified: stable/9/sys/netinet6/in6_ifattach.h ============================================================================== --- stable/9/sys/netinet6/in6_ifattach.h Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sys/netinet6/in6_ifattach.h Thu Jun 20 07:23:04 2013 (r252021) @@ -40,6 +40,7 @@ int in6_get_tmpifid(struct ifnet *, u_in void in6_tmpaddrtimer(void *); int in6_get_hw_ifid(struct ifnet *, struct in6_addr *); int in6_nigroup(struct ifnet *, const char *, int, struct in6_addr *); +int in6_nigroup_oldmcprefix(struct ifnet *, const char *, int, struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_IFATTACH_H_ */ Modified: stable/9/sys/netinet6/in6_proto.c ============================================================================== --- stable/9/sys/netinet6/in6_proto.c Thu Jun 20 05:51:44 2013 (r252020) +++ stable/9/sys/netinet6/in6_proto.c Thu Jun 20 07:23:04 2013 (r252021) @@ -448,6 +448,7 @@ VNET_DEFINE(int, icmp6errppslim) = 100; /* control how to respond to NI queries */ VNET_DEFINE(int, icmp6_nodeinfo) = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); +VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1; /* UDP on IP6 parameters */ VNET_DEFINE(int, udp6_sendspace) = 9216;/* really max datagram size */ @@ -617,6 +618,11 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, ""); +SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, + nodeinfo_oldmcprefix, CTLFLAG_RW, + &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, + "Join old IPv6 NI group address in draft-ietf-ipngwg-icmp-name-lookup" + " for compatibility with KAME implememtation."); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 07:30:13 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E656A7CC; Thu, 20 Jun 2013 07:30:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8C801F5C; Thu, 20 Jun 2013 07:30: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 r5K7UDOm063873; Thu, 20 Jun 2013 07:30:13 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K7UDAU063871; Thu, 20 Jun 2013 07:30:13 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306200730.r5K7UDAU063871@svn.freebsd.org> From: Hiroki Sato Date: Thu, 20 Jun 2013 07:30:13 +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: r252023 - in stable/9/sys: net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 07:30:14 -0000 Author: hrs Date: Thu Jun 20 07:30:13 2013 New Revision: 252023 URL: http://svnweb.freebsd.org/changeset/base/252023 Log: MFC r250523: Add IFF_MONITOR support to gre(4). Tested by: Chip Marshall Modified: stable/9/sys/net/if_gre.c stable/9/sys/netinet/ip_gre.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_gre.c ============================================================================== --- stable/9/sys/net/if_gre.c Thu Jun 20 07:29:42 2013 (r252022) +++ stable/9/sys/net/if_gre.c Thu Jun 20 07:30:13 2013 (r252023) @@ -343,6 +343,12 @@ gre_output(struct ifnet *ifp, struct mbu bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); } + if ((ifp->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + error = ENETDOWN; + goto end; + } + m->m_flags &= ~(M_BCAST|M_MCAST); if (sc->g_proto == IPPROTO_MOBILE) { Modified: stable/9/sys/netinet/ip_gre.c ============================================================================== --- stable/9/sys/netinet/ip_gre.c Thu Jun 20 07:29:42 2013 (r252022) +++ stable/9/sys/netinet/ip_gre.c Thu Jun 20 07:30:13 2013 (r252023) @@ -205,6 +205,11 @@ gre_input2(struct mbuf *m ,int hlen, u_c bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m); } + if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + return(NULL); + } + m->m_pkthdr.rcvif = GRE2IFP(sc); netisr_queue(isr, m); @@ -289,6 +294,11 @@ gre_mobile_input(struct mbuf *m, int hle bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m); } + if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + return; + } + m->m_pkthdr.rcvif = GRE2IFP(sc); netisr_queue(NETISR_IP, m); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 07:56:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 483F82AA; Thu, 20 Jun 2013 07:56:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 20DB61120; Thu, 20 Jun 2013 07:56: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 r5K7u5h7072351; Thu, 20 Jun 2013 07:56:05 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K7u5Lt072350; Thu, 20 Jun 2013 07:56:05 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201306200756.r5K7u5Lt072350@svn.freebsd.org> From: Hiroki Sato Date: Thu, 20 Jun 2013 07:56:05 +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: r252024 - in stable/9: sbin/ping6 sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 07:56:06 -0000 Author: hrs Date: Thu Jun 20 07:56:05 2013 New Revision: 252024 URL: http://svnweb.freebsd.org/changeset/base/252024 Log: Fix mergeinfo. Modified: Directory Properties: stable/9/sbin/ping6/ (props changed) stable/9/sys/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 08:19:30 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7EED9C64; Thu, 20 Jun 2013 08:19:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7168D123F; Thu, 20 Jun 2013 08:19: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 r5K8JUww079706; Thu, 20 Jun 2013 08:19:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K8JU6M079705; Thu, 20 Jun 2013 08:19:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306200819.r5K8JU6M079705@svn.freebsd.org> From: Devin Teske Date: Thu, 20 Jun 2013 08:19:30 +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: r252025 - stable/9/usr.sbin/sysinstall X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 08:19:30 -0000 Author: dteske Date: Thu Jun 20 08:19:29 2013 New Revision: 252025 URL: http://svnweb.freebsd.org/changeset/base/252025 Log: Fix a copy/paste error introduced by r248313 (s/ftp/http/ in menu text). MFC after: 3 days Modified: stable/9/usr.sbin/sysinstall/menus.c Modified: stable/9/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/9/usr.sbin/sysinstall/menus.c Thu Jun 20 07:56:05 2013 (r252024) +++ stable/9/usr.sbin/sysinstall/menus.c Thu Jun 20 08:19:29 2013 (r252025) @@ -891,7 +891,7 @@ DMenu MenuMediaHTTPDirect = { "guaranteed to carry the full range of possible distributions.", "Select a site that's close!", NULL, - { { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, + { { "URL", "Specify some other http site by URL", NULL, dmenuSetVariable, NULL, VAR_HTTP_PATH "=other" }, { NULL } } From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 11:24:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80E7DBD1; Thu, 20 Jun 2013 11:24:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70B7B1DF1; Thu, 20 Jun 2013 11:24: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 r5KBOdl8090116; Thu, 20 Jun 2013 11:24:39 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KBOdJF090115; Thu, 20 Jun 2013 11:24:39 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306201124.r5KBOdJF090115@svn.freebsd.org> From: Steven Hartland Date: Thu, 20 Jun 2013 11:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252027 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 11:24:39 -0000 Author: smh Date: Thu Jun 20 11:24:38 2013 New Revision: 252027 URL: http://svnweb.freebsd.org/changeset/base/252027 Log: MFC r248573: Don't register repair writes in the trim map. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 20 09:55:53 2013 (r252026) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 20 11:24:38 2013 (r252027) @@ -2553,7 +2553,13 @@ zio_vdev_io_start(zio_t *zio) } } - if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE) { + /* + * Note that we ignore repair writes for TRIM because they can conflict + * with normal writes. This isn't an issue because, by definition, we + * only repair blocks that aren't freed. + */ + if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) { if (!trim_map_write_start(zio)) return (ZIO_PIPELINE_STOP); } @@ -2575,13 +2581,12 @@ zio_vdev_io_done(zio_t *zio) zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); if (vd != NULL && vd->vdev_ops->vdev_op_leaf && - zio->io_type == ZIO_TYPE_WRITE) { - trim_map_write_done(zio); - } - - if (vd != NULL && vd->vdev_ops->vdev_op_leaf && (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) { + if (zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) + trim_map_write_done(zio); + vdev_queue_io_done(zio); if (zio->io_type == ZIO_TYPE_WRITE) From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 16:51:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B2019E0; Thu, 20 Jun 2013 16:51:26 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7287A167F; Thu, 20 Jun 2013 16:51: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 r5KGpQWa095895; Thu, 20 Jun 2013 16:51:26 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KGpQFp095894; Thu, 20 Jun 2013 16:51:26 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201306201651.r5KGpQFp095894@svn.freebsd.org> From: Pietro Cerutti Date: Thu, 20 Jun 2013 16:51: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: r252035 - stable/9/usr.bin/at X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 16:51:26 -0000 Author: gahr (ports committer) Date: Thu Jun 20 16:51:25 2013 New Revision: 252035 URL: http://svnweb.freebsd.org/changeset/base/252035 Log: MFC: r249406 - Do not bail out if stat(2) fails with ENOENT in the spool directory. This happens if another atrm process removes a job while we're scanning through the directory. - While at it, optimize a bit the directory scanning, so that we quit looping as soon as all jobs specified in argv have been dealt with. Approved by: cognet Modified: stable/9/usr.bin/at/at.c Directory Properties: stable/9/usr.bin/at/ (props changed) Modified: stable/9/usr.bin/at/at.c ============================================================================== --- stable/9/usr.bin/at/at.c Thu Jun 20 16:50:05 2013 (r252034) +++ stable/9/usr.bin/at/at.c Thu Jun 20 16:51:25 2013 (r252035) @@ -533,6 +533,10 @@ process_jobs(int argc, char **argv, int /* Delete every argument (job - ID) given */ int i; + int rc; + int nofJobs; + int nofDone; + int statErrno; struct stat buf; DIR *spool; struct dirent *dirent; @@ -540,6 +544,9 @@ process_jobs(int argc, char **argv, int char queue; long jobno; + nofJobs = argc - optind; + nofDone = 0; + PRIV_START if (chdir(ATJOB_DIR) != 0) @@ -555,9 +562,20 @@ process_jobs(int argc, char **argv, int while((dirent = readdir(spool)) != NULL) { PRIV_START - if (stat(dirent->d_name, &buf) != 0) - perr("cannot stat in " ATJOB_DIR); + rc = stat(dirent->d_name, &buf); + statErrno = errno; PRIV_END + /* There's a race condition between readdir above and stat here: + * another atrm process could have removed the file from the spool + * directory under our nose. If this happens, stat will set errno to + * ENOENT, which we shouldn't treat as fatal. + */ + if (rc != 0) { + if (statErrno == ENOENT) + continue; + else + perr("cannot stat in " ATJOB_DIR); + } if(sscanf(dirent->d_name, "%c%5lx%8lx", &queue, &jobno, &ctm)!=3) continue; @@ -603,9 +621,15 @@ process_jobs(int argc, char **argv, int errx(EXIT_FAILURE, "internal error, process_jobs = %d", what); } + + /* All arguments have been processed + */ + if (++nofDone == nofJobs) + goto end; } } } +end: closedir(spool); } /* delete_jobs */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 17:45:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89A6CE81; Thu, 20 Jun 2013 17:45:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7A218CA; Thu, 20 Jun 2013 17:45: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 r5KHjTb9012855; Thu, 20 Jun 2013 17:45:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KHjTYi012854; Thu, 20 Jun 2013 17:45:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201306201745.r5KHjTYi012854@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 20 Jun 2013 17: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: r252038 - stable/9/sys/dev/mfi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 17:45:29 -0000 Author: jkim Date: Thu Jun 20 17:45:29 2013 New Revision: 252038 URL: http://svnweb.freebsd.org/changeset/base/252038 Log: Fix two swapped definitions. Note it is directly committed to this branch because it fixes r250496, i.e., MFC of r247369 to stable/9. Modified: stable/9/sys/dev/mfi/mfivar.h Modified: stable/9/sys/dev/mfi/mfivar.h ============================================================================== --- stable/9/sys/dev/mfi/mfivar.h Thu Jun 20 17:26:25 2013 (r252037) +++ stable/9/sys/dev/mfi/mfivar.h Thu Jun 20 17:45:29 2013 (r252038) @@ -106,8 +106,8 @@ struct mfi_command { #define MFI_CMD_CCB (1<<6) #define MFI_CMD_TBOLT (1<<7) #define MFI_ON_MFIQ_FREE (1<<8) -#define MFI_ON_MFIQ_BUSY (1<<9) -#define MFI_ON_MFIQ_READY (1<<10) +#define MFI_ON_MFIQ_READY (1<<9) +#define MFI_ON_MFIQ_BUSY (1<<10) #define MFI_ON_MFIQ_MASK (MFI_ON_MFIQ_FREE | MFI_ON_MFIQ_READY| \ MFI_ON_MFIQ_BUSY) #define MFI_CMD_FLAGS_FMT "\20" \ From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 19:56:27 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 46E566C5; Thu, 20 Jun 2013 19:56:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F2BF1286; Thu, 20 Jun 2013 19:56: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 r5KJuRe3054356; Thu, 20 Jun 2013 19:56:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KJuQcI054354; Thu, 20 Jun 2013 19:56:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306201956.r5KJuQcI054354@svn.freebsd.org> From: John Baldwin Date: Thu, 20 Jun 2013 19:56: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: r252041 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 19:56:27 -0000 Author: jhb Date: Thu Jun 20 19:56:26 2013 New Revision: 252041 URL: http://svnweb.freebsd.org/changeset/base/252041 Log: MFC 251617: Store a reference to the vnode associated with a file descriptor in the linux_file structure and use it instead of directly accessing td_fpop when destroying the linux_file structure. The td_fpop pointer is not valid when a cdevpriv destructor is run, and the type-specific close method has already been called, so f_vnode may not be valid (and the vnode might have been recycled without our own reference). Modified: stable/9/sys/ofed/include/linux/fs.h stable/9/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/fs.h ============================================================================== --- stable/9/sys/ofed/include/linux/fs.h Thu Jun 20 19:08:12 2013 (r252040) +++ stable/9/sys/ofed/include/linux/fs.h Thu Jun 20 19:56:26 2013 (r252041) @@ -73,6 +73,7 @@ struct linux_file { struct dentry f_dentry_store; struct selinfo f_selinfo; struct sigio *f_sigio; + struct vnode *f_vnode; }; #define file linux_file Modified: stable/9/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/9/sys/ofed/include/linux/linux_compat.c Thu Jun 20 19:08:12 2013 (r252040) +++ stable/9/sys/ofed/include/linux/linux_compat.c Thu Jun 20 19:56:26 2013 (r252041) @@ -211,7 +211,8 @@ linux_file_dtor(void *cdp) struct linux_file *filp; filp = cdp; - filp->f_op->release(curthread->td_fpop->f_vnode, filp); + filp->f_op->release(filp->f_vnode, filp); + vdrop(filp->f_vnode); kfree(filp); } @@ -231,6 +232,8 @@ linux_dev_open(struct cdev *dev, int ofl filp->f_dentry = &filp->f_dentry_store; filp->f_op = ldev->ops; filp->f_flags = file->f_flag; + vhold(file->f_vnode); + filp->f_vnode = file->f_vnode; if (filp->f_op->open) { error = -filp->f_op->open(file->f_vnode, filp); if (error) { From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 21:19:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 43565599; Thu, 20 Jun 2013 21:19:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAC217B8; Thu, 20 Jun 2013 21:19: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 r5KLJmTP080930; Thu, 20 Jun 2013 21:19:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KLJmno080921; Thu, 20 Jun 2013 21:19:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201306202119.r5KLJmno080921@svn.freebsd.org> From: Xin LI Date: Thu, 20 Jun 2013 21:19:48 +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: r252043 - stable/9/usr.sbin/kldxref X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 21:19:49 -0000 Author: delphij Date: Thu Jun 20 21:19:47 2013 New Revision: 252043 URL: http://svnweb.freebsd.org/changeset/base/252043 Log: MFC r251439: Remove unneeded reference to link.h (sys/link_elf.h). Modified: stable/9/usr.sbin/kldxref/ef.c stable/9/usr.sbin/kldxref/ef_amd64.c stable/9/usr.sbin/kldxref/ef_i386.c stable/9/usr.sbin/kldxref/ef_obj.c stable/9/usr.sbin/kldxref/kldxref.c Directory Properties: stable/9/usr.sbin/kldxref/ (props changed) Modified: stable/9/usr.sbin/kldxref/ef.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef.c Thu Jun 20 21:16:46 2013 (r252042) +++ stable/9/usr.sbin/kldxref/ef.c Thu Jun 20 21:19:47 2013 (r252043) @@ -42,7 +42,6 @@ #include #include #define FREEBSD_ELF -#include #include Modified: stable/9/usr.sbin/kldxref/ef_amd64.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef_amd64.c Thu Jun 20 21:16:46 2013 (r252042) +++ stable/9/usr.sbin/kldxref/ef_amd64.c Thu Jun 20 21:19:47 2013 (r252043) @@ -32,7 +32,6 @@ #include #include -#include #include "ef.h" Modified: stable/9/usr.sbin/kldxref/ef_i386.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef_i386.c Thu Jun 20 21:16:46 2013 (r252042) +++ stable/9/usr.sbin/kldxref/ef_i386.c Thu Jun 20 21:19:47 2013 (r252043) @@ -32,7 +32,6 @@ #include #include -#include #include "ef.h" Modified: stable/9/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef_obj.c Thu Jun 20 21:16:46 2013 (r252042) +++ stable/9/usr.sbin/kldxref/ef_obj.c Thu Jun 20 21:19:47 2013 (r252043) @@ -44,7 +44,6 @@ #include #include #define FREEBSD_ELF -#include #include Modified: stable/9/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/9/usr.sbin/kldxref/kldxref.c Thu Jun 20 21:16:46 2013 (r252042) +++ stable/9/usr.sbin/kldxref/kldxref.c Thu Jun 20 21:19:47 2013 (r252043) @@ -42,7 +42,6 @@ #include #include #define FREEBSD_ELF -#include #include #include #include From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 21:29:04 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E458C1B; Thu, 20 Jun 2013 21:29:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FD471845; Thu, 20 Jun 2013 21:29: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 r5KLT3tt084040; Thu, 20 Jun 2013 21:29:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KLT387084039; Thu, 20 Jun 2013 21:29:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201306202129.r5KLT387084039@svn.freebsd.org> From: Xin LI Date: Thu, 20 Jun 2013 21:29:03 +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: r252044 - stable/9/usr.sbin/kldxref X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 21:29:04 -0000 Author: delphij Date: Thu Jun 20 21:29:03 2013 New Revision: 252044 URL: http://svnweb.freebsd.org/changeset/base/252044 Log: MFC r251440: use calloc(). Modified: stable/9/usr.sbin/kldxref/ef_obj.c Directory Properties: stable/9/usr.sbin/kldxref/ (props changed) Modified: stable/9/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/9/usr.sbin/kldxref/ef_obj.c Thu Jun 20 21:19:47 2013 (r252043) +++ stable/9/usr.sbin/kldxref/ef_obj.c Thu Jun 20 21:29:03 2013 (r252044) @@ -343,7 +343,7 @@ ef_obj_open(const char *filename, struct if ((fd = open(filename, O_RDONLY)) == -1) return errno; - ef = malloc(sizeof(*ef)); + ef = calloc(1, sizeof(*ef)); if (ef == NULL) { close(fd); return (ENOMEM); @@ -352,7 +352,6 @@ ef_obj_open(const char *filename, struct efile->ef_ef = ef; efile->ef_ops = &ef_obj_file_ops; - bzero(ef, sizeof(*ef)); ef->ef_verbose = verbose; ef->ef_fd = fd; ef->ef_name = strdup(filename); From owner-svn-src-stable-9@FreeBSD.ORG Thu Jun 20 22:50:11 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 09EA0362; Thu, 20 Jun 2013 22:50:11 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF7F11B30; Thu, 20 Jun 2013 22:50: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 r5KMoArT011341; Thu, 20 Jun 2013 22:50:10 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KMo8ag010730; Thu, 20 Jun 2013 22:50:08 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201306202250.r5KMo8ag010730@svn.freebsd.org> From: "Simon J. Gerraty" Date: Thu, 20 Jun 2013 22:50:08 +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: r252048 - in stable/9: . share/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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 22:50:11 -0000 Author: sjg Date: Thu Jun 20 22:50:08 2013 New Revision: 252048 URL: http://svnweb.freebsd.org/changeset/base/252048 Log: share/mk: merge: r241298,243393,249057,251506 from head for bmake support. Makefile: buildworld etc will be done with make from src tree, make sure that bmake's -J 15,16 are not passed to it. Reviewed by: obrien Modified: stable/9/Makefile stable/9/share/mk/bsd.crunchgen.mk stable/9/share/mk/bsd.dep.mk stable/9/share/mk/bsd.obj.mk stable/9/share/mk/bsd.own.mk stable/9/share/mk/bsd.subdir.mk stable/9/share/mk/bsd.sys.mk (contents, props changed) stable/9/share/mk/sys.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/Makefile Thu Jun 20 22:50:08 2013 (r252048) @@ -127,7 +127,13 @@ MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/ BINMAKE= \ `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ -m ${.CURDIR}/share/mk + +.if defined(.PARSEDIR) +# don't pass -J to fmake +_MAKE= PATH=${PATH} MAKEFLAGS="${MAKEFLAGS:N-J:N1*,1*}" ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.else _MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.endif # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) Modified: stable/9/share/mk/bsd.crunchgen.mk ============================================================================== --- stable/9/share/mk/bsd.crunchgen.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.crunchgen.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -36,6 +36,8 @@ OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache CRUNCHOBJS= ${.OBJDIR} .if defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" +CANONICALOBJDIR:=${MAKEOBJDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} .endif Modified: stable/9/share/mk/bsd.dep.mk ============================================================================== --- stable/9/share/mk/bsd.dep.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.dep.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -123,6 +123,9 @@ ${_YC:R}.o: ${_YC} .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend +# Tell bmake not to look for generated files via .PATH +.NOPATH: ${DEPENDFILE} + # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \ Modified: stable/9/share/mk/bsd.obj.mk ============================================================================== --- stable/9/share/mk/bsd.obj.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.obj.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -44,6 +44,8 @@ ____: .if defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} +.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" +CANONICALOBJDIR:=${MAKEOBJDIR} .else CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif @@ -116,6 +118,11 @@ cleanobj: clean cleandepend .endif @if [ -L ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi +# Tell bmake not to look for generated files via .PATH +.if !empty(CLEANFILES) +.NOPATH: ${CLEANFILES} +.endif + .if !target(clean) clean: .if defined(CLEANFILES) && !empty(CLEANFILES) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.own.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -652,7 +652,7 @@ MK_${vv:H}:= ${MK_${vv:T}} .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif ${MAKE_VERSION} >= 9201210220 +.elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220 CTFCONVERT_CMD= .else CTFCONVERT_CMD= @: Modified: stable/9/share/mk/bsd.subdir.mk ============================================================================== --- stable/9/share/mk/bsd.subdir.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.subdir.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -42,7 +42,7 @@ distribute: _SUBDIR: .USE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}for entry in ${SUBDIR}; do \ + @${_+_}set -e; for entry in ${SUBDIR}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ edir=$${entry}.${MACHINE_ARCH}; \ @@ -79,7 +79,7 @@ ${__stage}${__target}: _SUBDIR .endif .endfor ${__target}: - ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} + ${_+_}set -e; cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} .endfor .if !target(install) Modified: stable/9/share/mk/bsd.sys.mk ============================================================================== --- stable/9/share/mk/bsd.sys.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/bsd.sys.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -126,3 +126,18 @@ CFLAGS+= ${SSP_CFLAGS} # Allow user-specified additional warning flags CFLAGS+= ${CWARNFLAGS} + + +# Tell bmake not to mistake standard targets for things to be searched for +# or expect to ever be up-to-date. +PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ + beforelinking build build-tools buildfiles buildincludes \ + checkdpadd clean cleandepend cleandir cleanobj configure \ + depend dependall distclean distribute exe extract fetch \ + html includes install installfiles installincludes lint \ + obj objlink objs objwarn patch realall realdepend \ + realinstall regress subdir-all subdir-depend subdir-install \ + tags whereobj + +.PHONY: ${PHONY_NOTMAIN} +.NOTMAIN: ${PHONY_NOTMAIN} Modified: stable/9/share/mk/sys.mk ============================================================================== --- stable/9/share/mk/sys.mk Thu Jun 20 22:01:36 2013 (r252047) +++ stable/9/share/mk/sys.mk Thu Jun 20 22:50:08 2013 (r252048) @@ -16,6 +16,10 @@ unix ?= We run FreeBSD, not UNIX. MACHINE_CPUARCH=${MACHINE_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .endif +# Set any local definitions first. Place this early, but it needs +# MACHINE_CPUARCH to be defined. +.sinclude + # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall # process the makefile as specified by the Posix 1003.2 specification. @@ -320,8 +324,22 @@ SHELL= ${__MAKE_SHELL} # XXX hint for bsd.port.mk OBJFORMAT?= elf +# Tell bmake to expand -V VAR by default +.MAKE.EXPAND_VARIABLES= yes + +# Tell bmake the makefile preference +.MAKE.MAKEFILE_PREFERENCE= BSDmakefile makefile Makefile + +.if !defined(.PARSEDIR) +# We are not bmake, which is more aggressive about searching .PATH +# It is sometime necessary to curb its enthusiasm with .NOPATH +# The following allows us to quietly ignore .NOPATH when not using bmake. +.NOTMAIN: .NOPATH +.NOPATH: + # Toggle on warnings .WARN: dirsyntax +.endif .endif From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 06:28:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A4AC193A; Fri, 21 Jun 2013 06:28:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96DF61BD2; Fri, 21 Jun 2013 06:28: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 r5L6StPe058255; Fri, 21 Jun 2013 06:28:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5L6StWe058254; Fri, 21 Jun 2013 06:28:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201306210628.r5L6StWe058254@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Jun 2013 06:28: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: r252054 - stable/9/sys/dev/drm2/i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 06:28:55 -0000 Author: kib Date: Fri Jun 21 06:28:55 2013 New Revision: 252054 URL: http://svnweb.freebsd.org/changeset/base/252054 Log: MFC r251959: Remove stray empty line. Modified: stable/9/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_gem.c Fri Jun 21 06:11:03 2013 (r252053) +++ stable/9/sys/dev/drm2/i915/i915_gem.c Fri Jun 21 06:28:55 2013 (r252054) @@ -1362,7 +1362,6 @@ unlocked_vmobj: cause = ret = 0; m = NULL; - if (i915_intr_pf) { ret = i915_mutex_lock_interruptible(dev); if (ret != 0) { From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 15:17:45 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7D32676B; Fri, 21 Jun 2013 15:17:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6FC5E1623; Fri, 21 Jun 2013 15:17: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 r5LFHjH7025555; Fri, 21 Jun 2013 15:17:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LFHj69025554; Fri, 21 Jun 2013 15:17:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306211517.r5LFHj69025554@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Jun 2013 15:17:45 +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: r252057 - stable/9/sys/boot/pc98/libpc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 15:17:45 -0000 Author: jhb Date: Fri Jun 21 15:17:44 2013 New Revision: 252057 URL: http://svnweb.freebsd.org/changeset/base/252057 Log: MFC 250333: Don't pad disk partition sizes with leading zeros. Modified: stable/9/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 21 12:02:09 2013 (r252056) +++ stable/9/sys/boot/pc98/libpc98/biosdisk.c Fri Jun 21 15:17:44 2013 (r252057) @@ -296,7 +296,7 @@ display_size(uint64_t size) size /= 1024; unit = 'M'; } - sprintf(buf, "%.6ld%cB", (long)size, unit); + sprintf(buf, "%6ld%cB", (long)size, unit); return (buf); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 17:36:34 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3888BA4A; Fri, 21 Jun 2013 17:36:34 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2893A1BFE; Fri, 21 Jun 2013 17:36: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 r5LHaYIw070053; Fri, 21 Jun 2013 17:36:34 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LHaYPN070052; Fri, 21 Jun 2013 17:36:34 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201306211736.r5LHaYPN070052@svn.freebsd.org> From: Scott Long Date: Fri, 21 Jun 2013 17:36:34 +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: r252063 - stable/9/sys/geom/mirror X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 17:36:34 -0000 Author: scottl Date: Fri Jun 21 17:36:33 2013 New Revision: 252063 URL: http://svnweb.freebsd.org/changeset/base/252063 Log: MFC r252010, r252011: Mark geom_mirror as capable of unmapped i/o Obtained from: Netflix Modified: stable/9/sys/geom/mirror/g_mirror.c Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Fri Jun 21 17:23:19 2013 (r252062) +++ stable/9/sys/geom/mirror/g_mirror.c Fri Jun 21 17:36:33 2013 (r252063) @@ -2028,7 +2028,7 @@ static void g_mirror_launch_provider(struct g_mirror_softc *sc) { struct g_mirror_disk *disk; - struct g_provider *pp; + struct g_provider *pp, *dp; sx_assert(&sc->sc_lock, SX_LOCKED); @@ -2038,11 +2038,24 @@ g_mirror_launch_provider(struct g_mirror pp->sectorsize = sc->sc_sectorsize; pp->stripesize = 0; pp->stripeoffset = 0; + + /* Splitting of unmapped BIO's could work but isn't implemented now */ + if (sc->sc_balance != G_MIRROR_BALANCE_SPLIT) + pp->flags |= G_PF_ACCEPT_UNMAPPED; + LIST_FOREACH(disk, &sc->sc_disks, d_next) { - if (disk->d_consumer && disk->d_consumer->provider && - disk->d_consumer->provider->stripesize > pp->stripesize) { - pp->stripesize = disk->d_consumer->provider->stripesize; - pp->stripeoffset = disk->d_consumer->provider->stripeoffset; + if (disk->d_consumer && disk->d_consumer->provider) { + dp = disk->d_consumer->provider; + if (dp->stripesize > pp->stripesize) { + pp->stripesize = dp->stripesize; + pp->stripeoffset = dp->stripeoffset; + } + /* A provider underneath us doesn't support unmapped */ + if ((dp->flags & G_PF_ACCEPT_UNMAPPED) == 0) { + G_MIRROR_DEBUG(0, "cancelling unmapped " + "because of %s\n", dp->name); + pp->flags &= ~G_PF_ACCEPT_UNMAPPED; + } } } sc->sc_provider = pp; From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 19:28:58 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6FAAF2C; Fri, 21 Jun 2013 19:28:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A86121125; Fri, 21 Jun 2013 19:28: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 r5LJSwUT006612; Fri, 21 Jun 2013 19:28:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LJSwn7006611; Fri, 21 Jun 2013 19:28:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306211928.r5LJSwn7006611@svn.freebsd.org> From: John Baldwin Date: Fri, 21 Jun 2013 19:28: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: r252065 - stable/9/lib/libprocstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 19:28:58 -0000 Author: jhb Date: Fri Jun 21 19:28:58 2013 New Revision: 252065 URL: http://svnweb.freebsd.org/changeset/base/252065 Log: MFC 251637: Borrow the algorithm from kvm_getprocs() to fix procstat_getprocs() to handle the case where the process tables grows in between the calls to fetch the size and fetch the table. Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Fri Jun 21 18:16:54 2013 (r252064) +++ stable/9/lib/libprocstat/libprocstat.c Fri Jun 21 19:28:58 2013 (r252065) @@ -248,7 +248,7 @@ procstat_getprocs(struct procstat *procs unsigned int *count) { struct kinfo_proc *p0, *p; - size_t len; + size_t len, olen; int name[4]; int cnt; int error; @@ -285,12 +285,16 @@ procstat_getprocs(struct procstat *procs warnx("no processes?"); goto fail; } - p = malloc(len); - if (p == NULL) { - warnx("malloc(%zu)", len); - goto fail; - } - error = sysctl(name, 4, p, &len, NULL, 0); + do { + len += len / 10; + p = reallocf(p, len); + if (p == NULL) { + warnx("reallocf(%zu)", len); + goto fail; + } + olen = len; + error = sysctl(name, 4, p, &len, NULL, 0); + } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 20:16:42 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 77F71CB4; Fri, 21 Jun 2013 20:16:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5797712B0; Fri, 21 Jun 2013 20:16: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 r5LKGgLx022787; Fri, 21 Jun 2013 20:16:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LKGghD022786; Fri, 21 Jun 2013 20:16:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201306212016.r5LKGghD022786@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jun 2013 20:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252068 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 20:16:42 -0000 Author: rmacklem Date: Fri Jun 21 20:16:41 2013 New Revision: 252068 URL: http://svnweb.freebsd.org/changeset/base/252068 Log: MFC: r251444, r251476 Add a "-v" (verbose) option to the gssd daemon, to help with diagnosis of kerberized NFS mount problems. When set, messages are sent to syslog() (or fprintf(stderr,...) if "-d" is also specified) to indicate activity/results of kgssapi upcalls. Modified: stable/9/usr.sbin/gssd/gssd.c Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.c ============================================================================== --- stable/9/usr.sbin/gssd/gssd.c Fri Jun 21 19:41:30 2013 (r252067) +++ stable/9/usr.sbin/gssd/gssd.c Fri Jun 21 20:16:41 2013 (r252068) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include #include @@ -71,10 +72,12 @@ uint32_t gss_start_time; int debug_level; static char ccfile_dirlist[PATH_MAX + 1], ccfile_substring[NAME_MAX + 1]; static char pref_realm[1024]; +static int verbose; static void gssd_load_mech(void); static int find_ccache_file(const char *, uid_t, char *); static int is_a_valid_tgt_cache(const char *, uid_t, int *, time_t *); +static void gssd_verbose_out(const char *, ...); extern void gssd_1(struct svc_req *rqstp, SVCXPRT *transp); extern int gssd_syscall(char *path); @@ -99,11 +102,15 @@ main(int argc, char **argv) ccfile_dirlist[0] = '\0'; pref_realm[0] = '\0'; debug = 0; - while ((ch = getopt(argc, argv, "ds:c:r:")) != -1) { + verbose = 0; + while ((ch = getopt(argc, argv, "dvs:c:r:")) != -1) { switch (ch) { case 'd': debug_level++; break; + case 'v': + verbose = 1; + break; case 's': #ifndef WITHOUT_KERBEROS /* @@ -299,10 +306,26 @@ gssd_delete_resource(uint64_t id) } } +static void +gssd_verbose_out(const char *fmt, ...) +{ + va_list ap; + + if (verbose != 0) { + va_start(ap, fmt); + if (debug_level == 0) + vsyslog(LOG_INFO | LOG_DAEMON, fmt, ap); + else + vfprintf(stderr, fmt, ap); + va_end(ap); + } +} + bool_t gssd_null_1_svc(void *argp, void *result, struct svc_req *rqstp) { + gssd_verbose_out("gssd_null: done\n"); return (TRUE); } @@ -337,6 +360,9 @@ gssd_init_sec_context_1_svc(init_sec_con } while (cp != NULL && *cp != '\0'); if (gotone == 0) { result->major_status = GSS_S_CREDENTIALS_EXPIRED; + gssd_verbose_out("gssd_init_sec_context: -s no" + " credential cache file found for uid=%d\n", + (int)argp->uid); return (TRUE); } } else { @@ -362,6 +388,8 @@ gssd_init_sec_context_1_svc(init_sec_con cred = gssd_find_resource(argp->cred); if (!cred) { result->major_status = GSS_S_CREDENTIALS_EXPIRED; + gssd_verbose_out("gssd_init_sec_context: cred" + " resource not found\n"); return (TRUE); } } @@ -369,6 +397,8 @@ gssd_init_sec_context_1_svc(init_sec_con ctx = gssd_find_resource(argp->ctx); if (!ctx) { result->major_status = GSS_S_CONTEXT_EXPIRED; + gssd_verbose_out("gssd_init_sec_context: context" + " resource not found\n"); return (TRUE); } } @@ -376,6 +406,8 @@ gssd_init_sec_context_1_svc(init_sec_con name = gssd_find_resource(argp->name); if (!name) { result->major_status = GSS_S_BAD_NAME; + gssd_verbose_out("gssd_init_sec_context: name" + " resource not found\n"); return (TRUE); } } @@ -385,6 +417,9 @@ gssd_init_sec_context_1_svc(init_sec_con argp->req_flags, argp->time_req, argp->input_chan_bindings, &argp->input_token, &result->actual_mech_type, &result->output_token, &result->ret_flags, &result->time_rec); + gssd_verbose_out("gssd_init_sec_context: done major=0x%x minor=%d" + " uid=%d\n", (unsigned int)result->major_status, + (int)result->minor_status, (int)argp->uid); if (result->major_status == GSS_S_COMPLETE || result->major_status == GSS_S_CONTINUE_NEEDED) { @@ -410,6 +445,8 @@ gssd_accept_sec_context_1_svc(accept_sec ctx = gssd_find_resource(argp->ctx); if (!ctx) { result->major_status = GSS_S_CONTEXT_EXPIRED; + gssd_verbose_out("gssd_accept_sec_context: ctx" + " resource not found\n"); return (TRUE); } } @@ -417,6 +454,8 @@ gssd_accept_sec_context_1_svc(accept_sec cred = gssd_find_resource(argp->cred); if (!cred) { result->major_status = GSS_S_CREDENTIALS_EXPIRED; + gssd_verbose_out("gssd_accept_sec_context: cred" + " resource not found\n"); return (TRUE); } } @@ -427,6 +466,8 @@ gssd_accept_sec_context_1_svc(accept_sec &src_name, &result->mech_type, &result->output_token, &result->ret_flags, &result->time_rec, &delegated_cred_handle); + gssd_verbose_out("gssd_accept_sec_context: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); if (result->major_status == GSS_S_COMPLETE || result->major_status == GSS_S_CONTINUE_NEEDED) { @@ -455,6 +496,8 @@ gssd_delete_sec_context_1_svc(delete_sec result->major_status = GSS_S_COMPLETE; result->minor_status = 0; } + gssd_verbose_out("gssd_delete_sec_context: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -476,6 +519,8 @@ gssd_export_sec_context_1_svc(export_sec result->interprocess_token.length = 0; result->interprocess_token.value = NULL; } + gssd_verbose_out("gssd_export_sec_context: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -487,6 +532,8 @@ gssd_import_name_1_svc(import_name_args result->major_status = gss_import_name(&result->minor_status, &argp->input_name_buffer, argp->input_name_type, &name); + gssd_verbose_out("gssd_import_name: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); if (result->major_status == GSS_S_COMPLETE) result->output_name = gssd_make_resource(name); @@ -510,6 +557,8 @@ gssd_canonicalize_name_1_svc(canonicaliz result->major_status = gss_canonicalize_name(&result->minor_status, name, argp->mech_type, &output_name); + gssd_verbose_out("gssd_canonicalize_name: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); if (result->major_status == GSS_S_COMPLETE) result->output_name = gssd_make_resource(output_name); @@ -527,11 +576,14 @@ gssd_export_name_1_svc(export_name_args memset(result, 0, sizeof(*result)); if (!name) { result->major_status = GSS_S_BAD_NAME; + gssd_verbose_out("gssd_export_name: name resource not found\n"); return (TRUE); } result->major_status = gss_export_name(&result->minor_status, name, &result->exported_name); + gssd_verbose_out("gssd_export_name: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -549,6 +601,8 @@ gssd_release_name_1_svc(release_name_arg result->major_status = GSS_S_COMPLETE; result->minor_status = 0; } + gssd_verbose_out("gssd_release_name: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -600,17 +654,27 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg mem_alloc(len * sizeof(int)); memcpy(result->gidlist.gidlist_val, groups, len * sizeof(int)); + gssd_verbose_out("gssd_pname_to_uid: mapped" + " to uid=%d, gid=%d\n", (int)result->uid, + (int)result->gid); } else { result->gid = 65534; result->gidlist.gidlist_len = 0; result->gidlist.gidlist_val = NULL; + gssd_verbose_out("gssd_pname_to_uid: mapped" + " to uid=%d, but no groups\n", + (int)result->uid); } if (bufp != NULL && buflen > sizeof(buf)) free(bufp); - } + } else + gssd_verbose_out("gssd_pname_to_uid: failed major=0x%x" + " minor=%d\n", (unsigned int)result->major_status, + (int)result->minor_status); } else { result->major_status = GSS_S_BAD_NAME; result->minor_status = 0; + gssd_verbose_out("gssd_pname_to_uid: no name\n"); } return (TRUE); @@ -646,6 +710,8 @@ gssd_acquire_cred_1_svc(acquire_cred_arg } while (cp != NULL && *cp != '\0'); if (gotone == 0) { result->major_status = GSS_S_CREDENTIALS_EXPIRED; + gssd_verbose_out("gssd_acquire_cred: no cred cache" + " file found\n"); return (TRUE); } } else { @@ -672,6 +738,8 @@ gssd_acquire_cred_1_svc(acquire_cred_arg desired_name = gssd_find_resource(argp->desired_name); if (!desired_name) { result->major_status = GSS_S_BAD_NAME; + gssd_verbose_out("gssd_acquire_cred: no desired name" + " found\n"); return (TRUE); } } @@ -679,6 +747,8 @@ gssd_acquire_cred_1_svc(acquire_cred_arg result->major_status = gss_acquire_cred(&result->minor_status, desired_name, argp->time_req, argp->desired_mechs, argp->cred_usage, &cred, &result->actual_mechs, &result->time_rec); + gssd_verbose_out("gssd_acquire_cred: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); if (result->major_status == GSS_S_COMPLETE) result->output_cred = gssd_make_resource(cred); @@ -696,11 +766,14 @@ gssd_set_cred_option_1_svc(set_cred_opti memset(result, 0, sizeof(*result)); if (!cred) { result->major_status = GSS_S_CREDENTIALS_EXPIRED; + gssd_verbose_out("gssd_set_cred: no credentials\n"); return (TRUE); } result->major_status = gss_set_cred_option(&result->minor_status, &cred, argp->option_name, &argp->option_value); + gssd_verbose_out("gssd_set_cred: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -718,6 +791,8 @@ gssd_release_cred_1_svc(release_cred_arg result->major_status = GSS_S_COMPLETE; result->minor_status = 0; } + gssd_verbose_out("gssd_release_cred: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } @@ -730,6 +805,8 @@ gssd_display_status_1_svc(display_status result->major_status = gss_display_status(&result->minor_status, argp->status_value, argp->status_type, argp->mech_type, &result->message_context, &result->status_string); + gssd_verbose_out("gssd_display_status: done major=0x%x minor=%d\n", + (unsigned int)result->major_status, (int)result->minor_status); return (TRUE); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 20:21:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DE6E21FD; Fri, 21 Jun 2013 20:21:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDC9C12D3; Fri, 21 Jun 2013 20:21: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 r5LKLEPf025166; Fri, 21 Jun 2013 20:21:14 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LKLE3Y025165; Fri, 21 Jun 2013 20:21:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201306212021.r5LKLE3Y025165@svn.freebsd.org> From: Rick Macklem Date: Fri, 21 Jun 2013 20:21:14 +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: r252069 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 20:21:15 -0000 Author: rmacklem Date: Fri Jun 21 20:21:14 2013 New Revision: 252069 URL: http://svnweb.freebsd.org/changeset/base/252069 Log: MFC: r251445 Document the new "-v" option for the gssd daemon. This is a content change. Modified: stable/9/usr.sbin/gssd/gssd.8 Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.8 ============================================================================== --- stable/9/usr.sbin/gssd/gssd.8 Fri Jun 21 20:16:41 2013 (r252068) +++ stable/9/usr.sbin/gssd/gssd.8 Fri Jun 21 20:21:14 2013 (r252069) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2012 +.Dd June 5, 2013 .Dt GSSD 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl d +.Op Fl v .Op Fl s Ar dir-list .Op Fl c Ar file-substring .Op Fl r Ar preferred-realm @@ -49,6 +50,16 @@ Run in debug mode. In this mode, .Nm will not fork when it starts. +.It Fl v +Run in verbose mode. +In this mode, +.Nm +will log activity messages to syslog using LOG_INFO | LOG_DAEMON or to +stderr, if the +.Fl d +option has also been specified. +The minor status is logged as a decimal number, since it is actually a +Kerberos return status, which is signed. .It Fl s Ar dir-list Look for an appropriate credential cache file in this list of directories. The list should be full pathnames from root, separated by ':' characters. @@ -79,7 +90,8 @@ by kernel GSS-API services. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr gssapi 3 +.Xr gssapi 3 , +.Xr syslog 3 .Sh HISTORY The .Nm From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 21 21:38:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F25F59E; Fri, 21 Jun 2013 21:38:48 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E32451752; Fri, 21 Jun 2013 21:38: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 r5LLcmK2048021; Fri, 21 Jun 2013 21:38:48 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5LLcmed048020; Fri, 21 Jun 2013 21:38:48 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201306212138.r5LLcmed048020@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 21 Jun 2013 21:38:48 +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: r252070 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 21:38:49 -0000 Author: gnn Date: Fri Jun 21 21:38:48 2013 New Revision: 252070 URL: http://svnweb.freebsd.org/changeset/base/252070 Log: MFC: 249514 Point args[0] not at the thread that is ending but at the one that is starting. This is in line with practice in OpenSolaris. Note that this change is only in ULE and not in the 4BSD scheduler. Once this change settles in (MFC timeout has expired) we'll try it out on 4BSD as well. PR: 177706 Submitted by: Tiwei Bie Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Fri Jun 21 20:21:14 2013 (r252069) +++ stable/9/sys/kern/sched_ule.c Fri Jun 21 21:38:48 2013 (r252070) @@ -1896,7 +1896,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; sched_pctcpu_update(newtd->td_sched, 0); From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 02:22:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03B3CC3C; Sat, 22 Jun 2013 02:22:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E81C0167D; Sat, 22 Jun 2013 02:22: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 r5M2MDax040357; Sat, 22 Jun 2013 02:22:13 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M2MD47040349; Sat, 22 Jun 2013 02:22:13 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306220222.r5M2MD47040349@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 22 Jun 2013 02:22:13 +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: r252080 - in stable/9: contrib/gcc contrib/gcc/config/i386 contrib/gcc/doc gnu/usr.bin/cc/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-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 02:22:14 -0000 Author: pfg Date: Sat Jun 22 02:22:12 2013 New Revision: 252080 URL: http://svnweb.freebsd.org/changeset/base/252080 Log: MFC r251212, r251480: GCC: bring back experimental support for amdfam10/barcelona CPUs. This is a revised subset of the support initially brought in in r236962 and later reverted. The collateral efects seem to have disappeared but it is still recommended to set the CPUTYPE with caution. While here also install AMD intrinsics header ammintrin.h Reviewed by: jkim (ages ago) Added: stable/9/contrib/gcc/config/i386/ammintrin.h - copied unchanged from r251212, head/contrib/gcc/config/i386/ammintrin.h Modified: stable/9/contrib/gcc/ChangeLog.gcc43 stable/9/contrib/gcc/config.gcc stable/9/contrib/gcc/config/i386/athlon.md stable/9/contrib/gcc/config/i386/driver-i386.c stable/9/contrib/gcc/config/i386/emmintrin.h stable/9/contrib/gcc/config/i386/i386.c stable/9/contrib/gcc/config/i386/i386.h stable/9/contrib/gcc/config/i386/i386.md stable/9/contrib/gcc/config/i386/i386.opt stable/9/contrib/gcc/config/i386/pmmintrin.h stable/9/contrib/gcc/config/i386/sse.md stable/9/contrib/gcc/config/i386/tmmintrin.h stable/9/contrib/gcc/doc/extend.texi stable/9/contrib/gcc/doc/invoke.texi stable/9/gnu/usr.bin/cc/include/Makefile Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/gnu/usr.bin/cc/include/ (props changed) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/9/contrib/gcc/ChangeLog.gcc43 Fri Jun 21 23:21:16 2013 (r252079) +++ stable/9/contrib/gcc/ChangeLog.gcc43 Sat Jun 22 02:22:12 2013 (r252080) @@ -1,3 +1,8 @@ +2007-05-01 Dwarakanath Rajagopal (r124341) + + * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of + 'AMD Family 10 core'. + 2007-05-01 Dwarakanath Rajagopal (r124339) * config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3 @@ -5,6 +10,12 @@ with SSE3 instruction set support. * doc/invoke.texi: Likewise. +2007-05-01 Dwarakanath Rajagopal (r124330) + + * config/i386/i386.c (override_options): Tuning 32-byte loop + alignment for amdfam10 architecture. Increasing the max loop + alignment to 24 bytes. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -21,6 +32,17 @@ * config/i386/i386.c (ix86_handle_option): Handle SSSE3. +2007-03-28 Dwarakanath Rajagopal (r123313) + + * config.gcc: Accept barcelona as a variant of amdfam10. + * config/i386/i386.c (override_options): Likewise. + * doc/invoke.texi: Likewise. + +2007-02-09 Dwarakanath Rajagopal (r121763) + + * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. + (bit_SSE4a): New. + 2007-02-08 Harsha Jagasia (r121726) * config/i386/xmmintrin.h: Make inclusion of emmintrin.h @@ -38,6 +60,168 @@ * config/i386/i386.c (override_options): Set PTA_SSSE3 for core2. +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_fldxf_k8, athlon_fld_k8, + athlon_fstxf_k8, athlon_fst_k8, athlon_fist, athlon_fmov, + athlon_fadd_load, athlon_fadd_load_k8, athlon_fadd, athlon_fmul, + athlon_fmul_load, athlon_fmul_load_k8, athlon_fsgn, + athlon_fdiv_load, athlon_fdiv_load_k8, athlon_fdiv_k8, + athlon_fpspc_load, athlon_fpspc, athlon_fcmov_load, + athlon_fcmov_load_k8, athlon_fcmov_k8, athlon_fcomi_load_k8, + athlon_fcomi, athlon_fcom_load_k8, athlon_fcom): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.md (x86_sahf_1, cmpfp_i_mixed, cmpfp_i_sse, + cmpfp_i_i387, cmpfp_iu_mixed, cmpfp_iu_sse, cmpfp_iu_387, + swapsi, swaphi_1, swapqi_1, swapdi_rex64, fix_truncsfdi_sse, + fix_truncdfdi_sse, fix_truncsfsi_sse, fix_truncdfsi_sse, + x86_fldcw_1, floatsisf2_mixed, floatsisf2_sse, floatdisf2_mixed, + floatdisf2_sse, floatsidf2_mixed, floatsidf2_sse, + floatdidf2_mixed, floatdidf2_sse, muldi3_1_rex64, mulsi3_1, + mulsi3_1_zext, mulhi3_1, mulqi3_1, umulqihi3_1, mulqihi3_insn, + umulditi3_insn, umulsidi3_insn, mulditi3_insn, mulsidi3_insn, + umuldi3_highpart_rex64, umulsi3_highpart_insn, + umulsi3_highpart_zext, smuldi3_highpart_rex64, + smulsi3_highpart_insn, smulsi3_highpart_zext, x86_64_shld, + x86_shld_1, x86_64_shrd, sqrtsf2_mixed, sqrtsf2_sse, + sqrtsf2_i387, sqrtdf2_mixed, sqrtdf2_sse, sqrtdf2_i387, + sqrtextendsfdf2_i387, sqrtxf2, sqrtextendsfxf2_i387, + sqrtextenddfxf2_i387): Added amdfam10_decode. + + * config/i386/athlon.md (athlon_idirect_amdfam10, + athlon_ivector_amdfam10, athlon_idirect_load_amdfam10, + athlon_ivector_load_amdfam10, athlon_idirect_both_amdfam10, + athlon_ivector_both_amdfam10, athlon_idirect_store_amdfam10, + athlon_ivector_store_amdfam10): New define_insn_reservation. + (athlon_idirect_loadmov, athlon_idirect_movstore): Added + amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_call_amdfam10, + athlon_pop_amdfam10, athlon_lea_amdfam10): New + define_insn_reservation. + (athlon_branch, athlon_push, athlon_leave_k8, athlon_imul_k8, + athlon_imul_k8_DI, athlon_imul_mem_k8, athlon_imul_mem_k8_DI, + athlon_idiv, athlon_idiv_mem, athlon_str): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseld_amdfam10, + athlon_mmxld_amdfam10, athlon_ssest_amdfam10, + athlon_mmxssest_short_amdfam10): New define_insn_reservation. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_sseins_amdfam10): New + define_insn_reservation. + * config/i386/i386.md (sseins): Added sseins to define_attr type + and define_attr unit. + * config/i386/sse.md: Set type attribute to sseins for insertq + and insertqi. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (sselog_load_amdfam10, sselog_amdfam10, + ssecmpvector_load_amdfam10, ssecmpvector_amdfam10, + ssecomi_load_amdfam10, ssecomi_amdfam10, + sseaddvector_load_amdfam10, sseaddvector_amdfam10): New + define_insn_reservation. + (ssecmp_load_k8, ssecmp, sseadd_load_k8, seadd): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (cvtss2sd_load_amdfam10, + cvtss2sd_amdfam10, cvtps2pd_load_amdfam10, cvtps2pd_amdfam10, + cvtsi2sd_load_amdfam10, cvtsi2ss_load_amdfam10, + cvtsi2sd_amdfam10, cvtsi2ss_amdfam10, cvtsd2ss_load_amdfam10, + cvtsd2ss_amdfam10, cvtpd2ps_load_amdfam10, cvtpd2ps_amdfam10, + cvtsX2si_load_amdfam10, cvtsX2si_amdfam10): New + define_insn_reservation. + + * config/i386/sse.md (cvtsi2ss, cvtsi2ssq, cvtss2si, + cvtss2siq, cvttss2si, cvttss2siq, cvtsi2sd, cvtsi2sdq, + cvtsd2si, cvtsd2siq, cvttsd2si, cvttsd2siq, + cvtpd2dq, cvttpd2dq, cvtsd2ss, cvtss2sd, + cvtpd2ps, cvtps2pd): Added amdfam10_decode attribute. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/athlon.md (athlon_ssedivvector_amdfam10, + athlon_ssedivvector_load_amdfam10, athlon_ssemulvector_amdfam10, + athlon_ssemulvector_load_amdfam10): New define_insn_reservation. + (athlon_ssediv, athlon_ssediv_load_k8, athlon_ssemul, + athlon_ssemul_load_k8): Added amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_SSE_UNALIGNED_MOVE_OPTIMAL): New macro. + (x86_sse_unaligned_move_optimal): New variable. + + * config/i386/i386.c (x86_sse_unaligned_move_optimal): Enable for + m_AMDFAM10. + (ix86_expand_vector_move_misalign): Add code to generate movupd/movups + for unaligned vector SSE double/single precision loads for AMDFAM10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.h (TARGET_AMDFAM10): New macro. + (TARGET_CPU_CPP_BUILTINS): Add code for amdfam10. + Define TARGET_CPU_DEFAULT_amdfam10. + (TARGET_CPU_DEFAULT_NAMES): Add amdfam10. + (processor_type): Add PROCESSOR_AMDFAM10. + + * config/i386/i386.md: Add amdfam10 as a new cpu attribute to match + processor_type in config/i386/i386.h. + Enable imul peepholes for TARGET_AMDFAM10. + + * config.gcc: Add support for --with-cpu option for amdfam10. + + * config/i386/i386.c (amdfam10_cost): New variable. + (m_AMDFAM10): New macro. + (m_ATHLON_K8_AMDFAM10): New macro. + (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen, + x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_simode_fiop, + x86_promote_QImode, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_accumulate_outgoing_args, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_sse_typeless_stores, + x86_use_ffreep, x86_use_incdec, x86_four_jump_limit, + x86_schedule, x86_use_bt, x86_cmpxchg16b, x86_pad_returns): + Enable/disable for amdfam10. + (override_options): Add amdfam10_cost to processor_target_table. + Set up PROCESSOR_AMDFAM10 for amdfam10 entry in + processor_alias_table. + (ix86_issue_rate): Add PROCESSOR_AMDFAM10. + (ix86_adjust_cost): Add code for amdfam10. + +2007-02-05 Harsha Jagasia (r121625) + + * config/i386/i386.opt: Add new Advanced Bit Manipulation (-mabm) + instruction set feature flag. Add new (-mpopcnt) flag for popcnt + instruction. Add new SSE4A (-msse4a) instruction set feature flag. + * config/i386/i386.h: Add builtin definition for SSE4A. + * config/i386/i386.md: Add support for ABM instructions + (popcnt and lzcnt). + * config/i386/sse.md: Add support for SSE4A instructions + (movntss, movntsd, extrq, insertq). + * config/i386/i386.c: Add support for ABM and SSE4A builtins. + Add -march=amdfam10 flag. + * config/i386/ammintrin.h: Add support for SSE4A intrinsics. + * doc/invoke.texi: Add documentation on flags for sse4a, abm, popcnt + and amdfam10. + * doc/extend.texi: Add documentation for SSE4A builtins. + +2007-01-24 Jakub Jelinek (r121140) + + * config/i386/i386.h (x86_cmpxchg16b): Remove const. + (TARGET_CMPXCHG16B): Define to x86_cmpxchg16b. + * config/i386/i386.c (x86_cmpxchg16b): Remove const. + (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b + for CPUs that have PTA_CX16 set. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. @@ -47,6 +231,11 @@ PR target/30040 * config/i386/driver-i386.c (bit_SSSE3): New. +2006-11-27 Uros Bizjak (r119260) + + * config/i386/i386.c (x86_ext_80387_constants): Add m_K8, m_CORE2 + and m_GENERIC64. + 2006-11-18 Vladimir Makarov (r118973) * doc/invoke.texi (core2): Add item. @@ -182,7 +371,7 @@ * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. -2006-10-22 H.J. Lu +2006-10-22 H.J. Lu (r117959) * config/i386/tmmintrin.h: Remove the duplicated content. Modified: stable/9/contrib/gcc/config.gcc ============================================================================== --- stable/9/contrib/gcc/config.gcc Fri Jun 21 23:21:16 2013 (r252079) +++ stable/9/contrib/gcc/config.gcc Sat Jun 22 02:22:12 2013 (r252080) @@ -269,12 +269,12 @@ xscale-*-*) i[34567]86-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" ;; x86_64-*-*) cpu_type=i386 extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h - pmmintrin.h tmmintrin.h" + pmmintrin.h tmmintrin.h ammintrin.h" need_64bit_hwint=yes ;; ia64-*-*) @@ -1209,14 +1209,14 @@ i[34567]86-*-solaris2*) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 exit 1 ;; esac @@ -2515,6 +2515,9 @@ if test x$with_cpu = x ; then ;; i686-*-* | i786-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2555,6 +2558,9 @@ if test x$with_cpu = x ; then ;; x86_64-*-*) case ${target_noncanonical} in + amdfam10-*|barcelona-*) + with_cpu=amdfam10 + ;; k8-*|opteron-*|athlon_64-*) with_cpu=k8 ;; @@ -2795,7 +2801,7 @@ case "${target}" in esac # OK ;; - "" | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) + "" | amdfam10 | barcelona | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) Copied: stable/9/contrib/gcc/config/i386/ammintrin.h (from r251212, head/contrib/gcc/config/i386/ammintrin.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/gcc/config/i386/ammintrin.h Sat Jun 22 02:22:12 2013 (r252080, copy of r251212, head/contrib/gcc/config/i386/ammintrin.h) @@ -0,0 +1,73 @@ +/* Copyright (C) 2007 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the AMD Programmers + Manual Update, version 2.x */ + +#ifndef _AMMINTRIN_H_INCLUDED +#define _AMMINTRIN_H_INCLUDED + +#ifndef __SSE4A__ +# error "SSE4A instruction set not enabled" +#else + +/* We need definitions from the SSE3, SSE2 and SSE header files*/ +#include + +static __inline void __attribute__((__always_inline__)) +_mm_stream_sd (double * __P, __m128d __Y) +{ + __builtin_ia32_movntsd (__P, (__v2df) __Y); +} + +static __inline void __attribute__((__always_inline__)) +_mm_stream_ss (float * __P, __m128 __Y) +{ + __builtin_ia32_movntss (__P, (__v4sf) __Y); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_extract_si64 (__m128i __X, __m128i __Y) +{ + return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y); +} + +#define _mm_extracti_si64(X, I, L) \ +((__m128i) __builtin_ia32_extrqi ((__v2di)(X), I, L)) + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_si64 (__m128i __X,__m128i __Y) +{ + return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y); +} + +#define _mm_inserti_si64(X, Y, I, L) \ +((__m128i) __builtin_ia32_insertqi ((__v2di)(X), (__v2di)(Y), I, L)) + + +#endif /* __SSE4A__ */ + +#endif /* _AMMINTRIN_H_INCLUDED */ Modified: stable/9/contrib/gcc/config/i386/athlon.md ============================================================================== --- stable/9/contrib/gcc/config/i386/athlon.md Fri Jun 21 23:21:16 2013 (r252079) +++ stable/9/contrib/gcc/config/i386/athlon.md Sat Jun 22 02:22:12 2013 (r252080) @@ -29,6 +29,8 @@ (const_string "vector")] (const_string "direct"))) +(define_attr "amdfam10_decode" "direct,vector,double" + (const_string "direct")) ;; ;; decode0 decode1 decode2 ;; \ | / @@ -131,18 +133,22 @@ ;; Jump instructions are executed in the branch unit completely transparent to us (define_insn_reservation "athlon_branch" 0 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "ibr")) "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_call" 0 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "call,callv")) "athlon-vector,athlon-ieu") +(define_insn_reservation "athlon_call_amdfam10" 0 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "call,callv")) + "athlon-double,athlon-ieu") ;; Latency of push operation is 3 cycles, but ESP value is available ;; earlier (define_insn_reservation "athlon_push" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "push")) "athlon-direct,athlon-agu,athlon-store") (define_insn_reservation "athlon_pop" 4 @@ -153,12 +159,16 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "pop")) "athlon-double,(athlon-ieu+athlon-load)") +(define_insn_reservation "athlon_pop_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "pop")) + "athlon-direct,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "leave")) "athlon-vector,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "leave")) "athlon-double,(athlon-ieu+athlon-load)") @@ -167,6 +177,11 @@ (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "lea")) "athlon-direct,athlon-agu,nothing") +;; Lea executes in AGU unit with 1 cycle latency on AMDFAM10 +(define_insn_reservation "athlon_lea_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "lea")) + "athlon-direct,athlon-agu,nothing") ;; Mul executes in special multiplier unit attached to IEU0 (define_insn_reservation "athlon_imul" 5 @@ -176,29 +191,35 @@ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0") ;; ??? Widening multiply is vector or double. (define_insn_reservation "athlon_imul_k8_DI" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "none,unknown")))) "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_k8" 3 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "none,unknown"))) "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0") +(define_insn_reservation "athlon_imul_amdfam10_HI" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "imul") + (and (eq_attr "mode" "HI") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_mem" 8 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8_DI" 7 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "load,both")))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu") @@ -209,21 +230,23 @@ ;; other instructions. ;; ??? Experiments show that the idiv can overlap with roughly 6 cycles ;; of the other code +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_idiv" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "none,unknown"))) "athlon-vector,(athlon-ieu0*6+(athlon-fpsched,athlon-fvector))") (define_insn_reservation "athlon_idiv_mem" 9 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "idiv") (eq_attr "memory" "load,both"))) "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))") ;; The parallelism of string instructions is not documented. Model it same way ;; as idiv to create smaller automata. This probably does not matter much. +;; Using the same heuristics for amdfam10 as K8 with idiv (define_insn_reservation "athlon_str" 6 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "str") (eq_attr "memory" "load,both,store"))) "athlon-vector,athlon-load,athlon-ieu0*6") @@ -234,34 +257,62 @@ (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-direct,athlon-ieu") +(define_insn_reservation "athlon_idirect_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_ivector" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-vector,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "none,unknown")))) + "athlon-vector,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_loadmov" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "load"))) "athlon-direct,athlon-load") + (define_insn_reservation "athlon_idirect_load" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-direct,athlon-load,athlon-ieu") +(define_insn_reservation "athlon_idirect_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-direct,athlon-load,athlon-ieu") (define_insn_reservation "athlon_ivector_load" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") +(define_insn_reservation "athlon_ivector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "load")))) + "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") + (define_insn_reservation "athlon_idirect_movstore" 1 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "imov") (eq_attr "memory" "store"))) "athlon-direct,athlon-agu,athlon-store") + (define_insn_reservation "athlon_idirect_both" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -270,6 +321,15 @@ "athlon-direct,athlon-load, athlon-ieu,athlon-store, athlon-store") +(define_insn_reservation "athlon_idirect_both_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-direct,athlon-load, + athlon-ieu,athlon-store, + athlon-store") + (define_insn_reservation "athlon_ivector_both" 6 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -279,6 +339,16 @@ athlon-ieu, athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_both_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "both")))) + "athlon-vector,athlon-load, + athlon-ieu, + athlon-ieu, + athlon-store") + (define_insn_reservation "athlon_idirect_store" 1 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") @@ -286,6 +356,14 @@ (eq_attr "memory" "store")))) "athlon-direct,(athlon-ieu+athlon-agu), athlon-store") +(define_insn_reservation "athlon_idirect_store_amdfam10" 1 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "direct") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-direct,(athlon-ieu+athlon-agu), + athlon-store") + (define_insn_reservation "athlon_ivector_store" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") @@ -293,6 +371,13 @@ (eq_attr "memory" "store")))) "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, athlon-store") +(define_insn_reservation "athlon_ivector_store_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "amdfam10_decode" "vector") + (and (eq_attr "unit" "integer,unknown") + (eq_attr "memory" "store")))) + "athlon-vector,(athlon-ieu+athlon-agu),athlon-ieu, + athlon-store") ;; Athlon floatin point unit (define_insn_reservation "athlon_fldxf" 12 @@ -302,7 +387,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,athlon-fpload2,athlon-fvector*9") (define_insn_reservation "athlon_fldxf_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "load") (eq_attr "mode" "XF")))) @@ -314,7 +399,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fany") (define_insn_reservation "athlon_fld_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") @@ -326,7 +411,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,(athlon-fpsched+athlon-agu),(athlon-store2+(athlon-fvector*7))") (define_insn_reservation "athlon_fstxf_k8" 8 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "store,both") (eq_attr "mode" "XF")))) @@ -337,16 +422,16 @@ (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fst_k8" 2 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fist" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fistp,fisttp")) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fmov" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmov")) "athlon-direct,athlon-fpsched,athlon-faddmul") (define_insn_reservation "athlon_fadd_load" 4 @@ -355,12 +440,12 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fop") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fop")) "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_fmul_load" 4 @@ -369,16 +454,16 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fmul_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fmul") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") (define_insn_reservation "athlon_fmul" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fmul")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fsgn" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fsgn")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_load" 24 @@ -387,7 +472,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fdiv_load_k8" 13 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fdiv") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") @@ -396,16 +481,16 @@ (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_k8" 11 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fpspc_load" 103 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "fpspc") (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload,athlon-fvector") (define_insn_reservation "athlon_fpspc" 100 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fpspc")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load" 7 @@ -418,12 +503,12 @@ (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load_k8" 17 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmov") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fvector") (define_insn_reservation "athlon_fcmov_k8" 15 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") ;; fcomi is vector decoded by uses only one pipe. @@ -434,13 +519,13 @@ (eq_attr "memory" "load")))) "athlon-vector,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcomi_load_k8" 5 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (and (eq_attr "athlon_decode" "vector") (eq_attr "memory" "load")))) "athlon-vector,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcomi" 3 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "athlon_decode" "vector") (eq_attr "type" "fcmp"))) "athlon-vector,athlon-fpsched,athlon-fadd") @@ -450,18 +535,18 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcom_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "fcmp") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcom" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (eq_attr "type" "fcmp")) "athlon-direct,athlon-fpsched,athlon-fadd") ;; Never seen by the scheduler because we still don't do post reg-stack ;; scheduling. ;(define_insn_reservation "athlon_fxch" 2 -; (and (eq_attr "cpu" "athlon,k8,generic64") +; (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") ; (eq_attr "type" "fxch")) ; "athlon-direct,athlon-fpsched,athlon-fany") @@ -516,6 +601,23 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") +;; On AMDFAM10 all double, single and integer packed and scalar SSEx data +;; loads generated are direct path, latency of 2 and do not use any FP +;; executions units. No seperate entries for movlpx/movhpx loads, which +;; are direct path, latency of 4 and use the FADD/FMUL FP execution units, +;; as they will not be generated. +(define_insn_reservation "athlon_sseld_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8") +;; On AMDFAM10 MMX data loads generated are direct path, latency of 4 +;; and can use any FP executions units +(define_insn_reservation "athlon_mmxld_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8, athlon-fany") (define_insn_reservation "athlon_mmxssest" 3 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") @@ -533,6 +635,25 @@ (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") +;; On AMDFAM10 all double, single and integer packed SSEx data stores +;; generated are all double path, latency of 2 and use the FSTORE FP +;; execution unit. No entries seperate for movupx/movdqu, which are +;; vector path, latency of 3 and use the FSTORE*2 FP execution unit, +;; as they will not be generated. +(define_insn_reservation "athlon_ssest_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssemov") + (and (eq_attr "mode" "V4SF,V2DF,TI") + (eq_attr "memory" "store,both")))) + "athlon-double,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store)*2)") +;; On AMDFAM10 all double, single and integer scalar SSEx and MMX +;; data stores generated are all direct path, latency of 2 and use +;; the FSTORE FP execution unit +(define_insn_reservation "athlon_mmxssest_short_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "mmxmov,ssemov") + (eq_attr "memory" "store,both"))) + "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_movaps_k8" 2 (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") @@ -578,6 +699,11 @@ (and (eq_attr "type" "sselog,sselog1") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fmul*2)") +(define_insn_reservation "athlon_sselog_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sselog,sselog1") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,(athlon-fadd|athlon-fmul)") (define_insn_reservation "athlon_sselog" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sselog,sselog1")) @@ -586,6 +712,11 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sselog,sselog1")) "athlon-double,athlon-fpsched,athlon-fmul") +(define_insn_reservation "athlon_sselog_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sselog,sselog1")) + "athlon-direct,athlon-fpsched,(athlon-fadd|athlon-fmul)") + ;; ??? pcmp executes in addmul, probably not worthwhile to bother about that. (define_insn_reservation "athlon_ssecmp_load" 2 (and (eq_attr "cpu" "athlon") @@ -594,13 +725,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_ssecmp_load_k8" 4 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (and (eq_attr "mode" "SF,DF,DI,TI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmp" 2 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "ssecmp") (eq_attr "mode" "SF,DF,DI,TI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -614,6 +745,11 @@ (and (eq_attr "type" "ssecmp") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecmp") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmpvector" 3 (and (eq_attr "cpu" "athlon") (eq_attr "type" "ssecmp")) @@ -622,6 +758,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssecmp")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_ssecmpvector_amdfam10" 2 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "ssecmp")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_ssecomi_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssecomi") @@ -632,10 +772,20 @@ (and (eq_attr "type" "ssecomi") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_load_amdfam10" 5 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecomi") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecomi" 4 (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "ssecmp")) "athlon-vector,athlon-fpsched,athlon-fadd") +(define_insn_reservation "athlon_ssecomi_amdfam10" 3 + (and (eq_attr "cpu" "amdfam10") +;; It seems athlon_ssecomi has a bug in the attr_type, fixed for amdfam10 + (eq_attr "type" "ssecomi")) + "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_sseadd_load" 4 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "sseadd") @@ -643,13 +793,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_sseadd_load_k8" 6 - (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "cpu" "k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (and (eq_attr "mode" "SF,DF,DI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseadd" 4 - (and (eq_attr "cpu" "athlon,k8,generic64") + (and (eq_attr "cpu" "athlon,k8,generic64,amdfam10") (and (eq_attr "type" "sseadd") (eq_attr "mode" "SF,DF,DI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -663,6 +813,11 @@ (and (eq_attr "type" "sseadd") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_load_amdfam10" 6 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "sseadd") + (eq_attr "memory" "load"))) + "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseaddvector" 5 (and (eq_attr "cpu" "athlon") (eq_attr "type" "sseadd")) @@ -671,6 +826,10 @@ (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sseadd")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") +(define_insn_reservation "athlon_sseaddvector_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") + (eq_attr "type" "sseadd")) + "athlon-direct,athlon-fpsched,athlon-fadd") ;; Conversions behaves very irregularly and the scheduling is critical here. ;; Take each instruction separately. Assume that the mode is always set to the @@ -684,12 +843,25 @@ (and (eq_attr "mode" "DF") (eq_attr "memory" "load"))))) "athlon-direct,athlon-fploadk8,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_load_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "double") + (and (eq_attr "mode" "DF") + (eq_attr "memory" "load"))))) + "athlon-double,athlon-fploadk8,(athlon-faddmul+athlon-fstore)") (define_insn_reservation "athlon_ssecvt_cvtss2sd" 2 (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "direct") (eq_attr "mode" "DF")))) "athlon-direct,athlon-fpsched,athlon-fstore") +(define_insn_reservation "athlon_ssecvt_cvtss2sd_amdfam10" 7 + (and (eq_attr "cpu" "amdfam10") + (and (eq_attr "type" "ssecvt") + (and (eq_attr "amdfam10_decode" "vector") + (eq_attr "mode" "DF")))) + "athlon-vector,athlon-fpsched,athlon-faddmul,(athlon-fstore*2)") ;; cvtps2pd. Model same way the other double decoded FP conversions. (define_insn_reservation "athlon_ssecvt_cvtps2pd_load_k8" 5 (and (eq_attr "cpu" "k8,athlon,generic64") @@ -698,12 +870,25 @@ (and (eq_attr "mode" "V2DF,V4SF,TI") (eq_attr "memory" "load"))))) "athlon-double,athlon-fpload2k8,(athlon-fstore*2)") +(define_insn_reservation "athlon_ssecvt_cvtps2pd_load_amdfam10" 4 + (and (eq_attr "cpu" "amdfam10") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 04:03:58 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB9AF615; Sat, 22 Jun 2013 04:03:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ADBDD1A29; Sat, 22 Jun 2013 04:03: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 r5M43w0Z067689; Sat, 22 Jun 2013 04:03:58 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M43w9H067687; Sat, 22 Jun 2013 04:03:58 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306220403.r5M43w9H067687@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Jun 2013 04:03: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: r252087 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 04:03:58 -0000 Author: markj Date: Sat Jun 22 04:03:57 2013 New Revision: 252087 URL: http://svnweb.freebsd.org/changeset/base/252087 Log: MFC r251723: The functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}(). Modified: stable/9/share/man/man9/pci.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Sat Jun 22 03:54:17 2013 (r252086) +++ stable/9/share/man/man9/pci.9 Sat Jun 22 04:03:57 2013 (r252087) @@ -436,13 +436,13 @@ A driver is only allowed to use either M but not both. .Pp The -.Fn pci_count_msi +.Fn pci_msi_count function returns the maximum number of MSI messages supported by the device .Fa dev . If the device does not support MSI, then -.Fn pci_count_msi +.Fn pci_msi_count returns zero. .Pp The @@ -489,13 +489,13 @@ The function returns zero on success and an error on failure. .Pp The -.Fn pci_count_msix +.Fn pci_msix_count function returns the maximum number of MSI-X messages supported by the device .Fa dev . If the device does not support MSI-X, then -.Fn pci_count_msix +.Fn pci_msix_count returns zero. .Pp The From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 04:50:26 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 78BA4142; Sat, 22 Jun 2013 04:50:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB191C11; Sat, 22 Jun 2013 04:50: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 r5M4oQAW080047; Sat, 22 Jun 2013 04:50:26 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M4oQV3080046; Sat, 22 Jun 2013 04:50:26 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306220450.r5M4oQV3080046@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Jun 2013 04:50: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: r252089 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 04:50:26 -0000 Author: markj Date: Sat Jun 22 04:50:25 2013 New Revision: 252089 URL: http://svnweb.freebsd.org/changeset/base/252089 Log: MFC r251166: Add macros which allow one to define SDT probes with six or seven arguments; they are needed when porting some of the Solaris providers (ip, iscsi, and tcp in particular). dtrace_probe() only takes five arguments from the probe site, so we need to add the appropriate cast to allow for more than five arguments. The extra arguments are later copied out of dtrace_probe()'s stack frame by dtrace_getarg() (or the provider-specific getarg method) as needed. Modified: stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Sat Jun 22 04:04:34 2013 (r252088) +++ stable/9/sys/sys/sdt.h Sat Jun 22 04:50:25 2013 (r252089) @@ -91,6 +91,10 @@ #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2) #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE_DEFINE6(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5) +#define SDT_PROBE_DEFINE7(prov, mod, func, name, snamp, arg0, arg1, arg2, \ + arg3, arg4, arg5, arg6) #define SDT_PROBE0(prov, mod, func, name) #define SDT_PROBE1(prov, mod, func, name, arg0) @@ -98,6 +102,9 @@ #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) #define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) #else @@ -232,6 +239,27 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); + +#define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ + arg4, arg5, arg6) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6); + #define SDT_PROBE0(prov, mod, func, name) \ SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0) #define SDT_PROBE1(prov, mod, func, name, arg0) \ @@ -244,6 +272,27 @@ struct sdt_provider { SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0) #define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\ + } while (0) +#define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ + arg6) \ + do { \ + if (sdt_##prov##_##mod##_##func##_##name->id) \ + (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \ + uintptr_t, uintptr_t, uintptr_t, uintptr_t)) \ + sdt_probe_func)( \ + sdt_##prov##_##mod##_##func##_##name->id, \ + (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \ + (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \ + (uintptr_t)arg6); \ + } while (0) typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *); typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *); From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 05:24:30 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 45D7D560; Sat, 22 Jun 2013 05:24:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBCD1CC4; Sat, 22 Jun 2013 05:24: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 r5M5OT37088082; Sat, 22 Jun 2013 05:24:29 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M5OTXg088081; Sat, 22 Jun 2013 05:24:29 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306220524.r5M5OTXg088081@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Jun 2013 05:24: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: r252091 - stable/9/sys/dev/coretemp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 05:24:30 -0000 Author: markj Date: Sat Jun 22 05:24:29 2013 New Revision: 252091 URL: http://svnweb.freebsd.org/changeset/base/252091 Log: MFC r246951: Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be held unnecessarily by a user thread waiting to run on a specific CPU after calling sched_bind(). Modified: stable/9/sys/dev/coretemp/coretemp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/coretemp/coretemp.c ============================================================================== --- stable/9/sys/dev/coretemp/coretemp.c Sat Jun 22 04:52:12 2013 (r252090) +++ stable/9/sys/dev/coretemp/coretemp.c Sat Jun 22 05:24:29 2013 (r252091) @@ -274,23 +274,23 @@ coretemp_attach(device_t dev) * Add the MIBs to dev.cpu.N and dev.cpu.N.coretemp. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, dev, - CORETEMP_TEMP, coretemp_get_val_sysctl, "IK", + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, CORETEMP_TEMP, coretemp_get_val_sysctl, "IK", "Current temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "delta", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_DELTA, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_DELTA, coretemp_get_val_sysctl, "I", "Delta between TCC activation and current temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "resolution", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_RESOLUTION, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_RESOLUTION, coretemp_get_val_sysctl, "I", "Resolution of CPU thermal sensor"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "tjmax", - CTLTYPE_INT | CTLFLAG_RD, dev, CORETEMP_TJMAX, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, CORETEMP_TJMAX, coretemp_get_val_sysctl, "IK", "TCC activation temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "throttle_log", CTLTYPE_INT | CTLFLAG_RW, dev, 0, + "throttle_log", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, 0, coretemp_throttle_log_sysctl, "I", "Set to 1 if the thermal sensor has tripped"); From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 05:32:11 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF271A60; Sat, 22 Jun 2013 05:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B28211D09; Sat, 22 Jun 2013 05:32: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 r5M5WBxR090192; Sat, 22 Jun 2013 05:32:11 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5M5WBsq090191; Sat, 22 Jun 2013 05:32:11 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201306220532.r5M5WBsq090191@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Jun 2013 05:32: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: r252093 - stable/9/usr.sbin/mfiutil X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 05:32:11 -0000 Author: markj Date: Sat Jun 22 05:32:11 2013 New Revision: 252093 URL: http://svnweb.freebsd.org/changeset/base/252093 Log: MFC r250599: Add a remark to the effect that a manually started relearn will always result in the battery being completely drained, even in transparent learning mode. Modified: stable/9/usr.sbin/mfiutil/mfiutil.8 Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/9/usr.sbin/mfiutil/mfiutil.8 Sat Jun 22 05:25:12 2013 (r252092) +++ stable/9/usr.sbin/mfiutil/mfiutil.8 Sat Jun 22 05:32:11 2013 (r252093) @@ -573,6 +573,10 @@ Updates the flash on the controller with A reboot is required for the new firmware to take effect. .It Cm start learn Start a battery relearn. +Note that this seems to always result in the battery being completely drained, +regardless of the BBU mode. +In particular, the controller write cache will be disabled during the relearn +even if transparent learning mode is enabled. .It Cm bbu Ar setting Ar value Update battery backup unit (BBU) properties related to battery relearning. The following settings are configurable: From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 17:28:57 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D3D02B3A; Sat, 22 Jun 2013 17:28:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4222166F; Sat, 22 Jun 2013 17:28: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 r5MHSvp0009958; Sat, 22 Jun 2013 17:28:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5MHSvXD009957; Sat, 22 Jun 2013 17:28:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201306221728.r5MHSvXD009957@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 22 Jun 2013 17:28: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: r252098 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 17:28:57 -0000 Author: jilles Date: Sat Jun 22 17:28:57 2013 New Revision: 252098 URL: http://svnweb.freebsd.org/changeset/base/252098 Log: MFC r251443: release: Allow empty extra distributions. For example, WITHOUT_SHAREDOCS= in src.conf creates an empty doc distribution. Submitted by: Kurt Lidl Tested by: Kurt Lidl Modified: stable/9/Makefile.inc1 (contents, props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Sat Jun 22 16:10:57 2013 (r252097) +++ stable/9/Makefile.inc1 Sat Jun 22 17:28:57 2013 (r252098) @@ -754,7 +754,7 @@ distributeworld installworld: installche ${IMAKEENV} rm -rf ${INSTALLTMP} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} - find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete + find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete .endfor .if defined(NO_ROOT) .for dist in base ${EXTRA_DISTRIBUTIONS} From owner-svn-src-stable-9@FreeBSD.ORG Sat Jun 22 21:32:01 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 476E494F; Sat, 22 Jun 2013 21:32:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38BB01F05; Sat, 22 Jun 2013 21:32: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 r5MLW1hb079427; Sat, 22 Jun 2013 21:32:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5MLVx1W079408; Sat, 22 Jun 2013 21:31:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306222131.r5MLVx1W079408@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 22 Jun 2013 21:31:59 +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: r252099 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2013 21:32:01 -0000 Author: pfg Date: Sat Jun 22 21:31:59 2013 New Revision: 252099 URL: http://svnweb.freebsd.org/changeset/base/252099 Log: MFC r251809, r251952, r252012: Re-sort ext2fs headers to make things easier to find. In the ext2fs driver we have a mixture of headers: - The ext2_ prefixed headers have strong influence from NetBSD and are carry specific ext2/3/4 information. - The unprefixed headers are inspired on UFS and carry implementation specific information. Do some small adjustments so that the information is easier to find coming from either UFS or the NetBSD implementation. Also - Set MAXMNTLEN nearer to where it is used. - Move EXT2_LINK_MAX to ext2_dir.h . - Rename some prefixes in the Block Group Descriptor fields. Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c stable/9/sys/fs/ext2fs/ext2_balloc.c stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2_dir.h stable/9/sys/fs/ext2fs/ext2fs.h stable/9/sys/fs/ext2fs/fs.h stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_alloc.c Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Sat Jun 22 21:31:59 2013 (r252099) @@ -46,10 +46,10 @@ #include #include +#include #include #include #include -#include #include static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Sat Jun 22 21:31:59 2013 (r252099) @@ -44,11 +44,13 @@ #include #include +#include #include #include -#include +#include #include #include + /* * Balloc defines the structure of filesystem storage * by allocating the physical blocks on a device given Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Jun 22 21:31:59 2013 (r252099) @@ -81,6 +81,16 @@ EXT2F_ROCOMPAT_EXTRA_ISIZE)) /* + * Constants relative to the data blocks + */ +#define EXT2_NDIR_BLOCKS 12 +#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS +#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) +#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) +#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) +#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) + +/* * Structure of an inode on the disk */ struct ext2fs_dinode { Modified: stable/9/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dir.h Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/ext2_dir.h Sat Jun 22 21:31:59 2013 (r252099) @@ -53,6 +53,12 @@ struct ext2fs_direct_2 { uint8_t e2d_type; /* file type */ char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */ }; + +/* + * Maximal count of links to a file + */ +#define EXT2_LINK_MAX 32000 + /* * Ext2 directory file types. Only the low 3 bits are used. The * other bits are reserved for now. Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Jun 22 21:31:59 2013 (r252099) @@ -40,38 +40,6 @@ #include /* - * Maximal count of links to a file - */ -#define EXT2_LINK_MAX 32000 - -/* - * A summary of contiguous blocks of various sizes is maintained - * in each cylinder group. Normally this is set by the initial - * value of fs_maxcontig. - * - * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set - * EXT2_MAXCONTIG to 32 for better performance. - */ -#define EXT2_MAXCONTIG 32 - -/* - * Constants relative to the data blocks - */ -#define EXT2_NDIR_BLOCKS 12 -#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS -#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) -#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) -#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) -#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) - -/* - * The path name on which the file system is mounted is maintained - * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in - * the super block for this name. - */ -#define MAXMNTLEN 512 - -/* * Super block for an ext2fs file system. */ struct ext2fs { @@ -141,6 +109,12 @@ struct ext2fs { uint32_t reserved2[162]; /* Padding to the end of the block */ }; +/* + * The path name on which the file system is mounted is maintained + * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in + * the super block for this name. + */ +#define MAXMNTLEN 512 /* * In-Memory Superblock @@ -175,11 +149,12 @@ struct m_ext2fs { struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ }; -/* - * The second extended file system version - */ -#define E2FS_DATE "95/08/09" -#define E2FS_VERSION "0.5b" +/* cluster summary information */ + +struct csum { + int8_t cs_init; /* cluster summary has been initialized */ + int32_t *cs_sum; /* cluster summary array */ +}; /* * The second extended file system magic number @@ -192,9 +167,6 @@ struct m_ext2fs { #define E2FS_REV0 0 /* The good old (original) format */ #define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ -#define E2FS_CURRENT_REV E2FS_REV0 -#define E2FS_MAX_SUPP_REV E2FS_REV1 - #define E2FS_REV0_INODE_SIZE 128 /* @@ -251,23 +223,6 @@ struct m_ext2fs { ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) /* - * Definitions of behavior on errors - */ -#define E2FS_BEH_CONTINUE 1 /* continue operation */ -#define E2FS_BEH_READONLY 2 /* remount fs read only */ -#define E2FS_BEH_PANIC 3 /* cause panic */ -#define E2FS_BEH_DEFAULT E2FS_BEH_CONTINUE - -/* - * OS identification - */ -#define E2FS_OS_LINUX 0 -#define E2FS_OS_HURD 1 -#define E2FS_OS_MASIX 2 -#define E2FS_OS_FREEBSD 3 -#define E2FS_OS_LITES 4 - -/* * File clean flags */ #define E2FS_ISCLEAN 0x0001 /* Unmounted cleanly */ @@ -282,20 +237,14 @@ struct ext2_gd { uint16_t ext2bgd_nbfree; /* number of free blocks */ uint16_t ext2bgd_nifree; /* number of free inodes */ uint16_t ext2bgd_ndirs; /* number of directories */ - uint16_t ext2bgd_flags; /* block group flags */ - uint32_t ext2bgd_x_bitmap; /* snapshot exclusion bitmap loc. */ - uint16_t ext2bgd_b_bmap_csum; /* block bitmap checksum */ - uint16_t ext2bgd_i_bmap_csum; /* inode bitmap checksum */ - uint16_t ext2bgd_i_unused; /* unused inode count */ - uint16_t ext2bgd_csum; /* group descriptor checksum */ + uint16_t ext4bgd_flags; /* block group flags */ + uint32_t ext4bgd_x_bitmap; /* snapshot exclusion bitmap loc. */ + uint16_t ext4bgd_b_bmap_csum; /* block bitmap checksum */ + uint16_t ext4bgd_i_bmap_csum; /* inode bitmap checksum */ + uint16_t ext4bgd_i_unused; /* unused inode count */ + uint16_t ext4bgd_csum; /* group descriptor checksum */ }; -/* cluster summary information */ - -struct csum { - int8_t cs_init; /* cluster summary has been initialized */ - int32_t *cs_sum; /* cluster summary array */ -}; /* EXT2FS metadatas are stored in little-endian byte order. These macros * helps reading these metadatas Modified: stable/9/sys/fs/ext2fs/fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/fs.h Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/fs.h Sat Jun 22 21:31:59 2013 (r252099) @@ -65,6 +65,16 @@ #define MAXMNTLEN 512 /* + * A summary of contiguous blocks of various sizes is maintained + * in each cylinder group. Normally this is set by the initial + * value of fs_maxcontig. + * + * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set + * EXT2_MAXCONTIG to 32 for better performance. + */ +#define EXT2_MAXCONTIG 32 + +/* * Grigoriy Orlov has done some extensive work to fine * tune the layout preferences for directories within a filesystem. * His algorithm can be tuned by adjusting the following parameters Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Sat Jun 22 17:28:57 2013 (r252098) +++ stable/9/sys/fs/ext2fs/inode.h Sat Jun 22 21:31:59 2013 (r252099) @@ -41,14 +41,14 @@ #include #include -#define NDADDR 12 /* Direct addresses in inode. */ -#define NIADDR 3 /* Indirect addresses in inode. */ - /* * This must agree with the definition in . */ #define doff_t int32_t +#define NDADDR 12 /* Direct addresses in inode. */ +#define NIADDR 3 /* Indirect addresses in inode. */ + /* * The inode is used to describe each active (or recently active) file in the * EXT2FS filesystem. It is composed of two types of information. The first